Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

My Goal: I want a block that ignores "light effects".

I believe I can accomplish this with a tile entity, but cant fully figure out TileEntityRenderer. 

 

So to start with my TileEntityRenderer class:

public class TestTileRenderer extends TileEntityRenderer<TestTile> {
    @Override
    public void render(TestTile te, double x, double y, double z, float partialTicks, int destroyStage) {
  		this.setLightmapDisabled(true);
    }
}

I believe that should disable "light effects", but seems to have no effect.  I'm sure it's my lack of understanding that is the problem.   But if anyone could point out something that i'm doing wrong I would appreciate it or know of another way of achieving my goal.

 

Maybe I am registering it wrong:

 

@Mod("genericname")
public class GenericName {

    ...

    public GenericName() {

        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientRegistries);
        ...
    }
	...
    }

    private void clientRegistries(final FMLCommonSetupEvent event) {
        ClientRegistry.bindTileEntitySpecialRenderer(TestTile.class, new TestTileRenderer());
    }

 

 

  • Author
On 11/19/2019 at 5:12 PM, diesieben07 said:

That's not where this method tells you to call it. Read the documentation.

 

It seems to have no effect, because your renderer does not actually render anything...

Duh. Thanks. So now that I have that fixed I'm having an issue with the render. 

 

This is what it occasionally looks like, and how it should look.

Spoiler

2019-11-20_20_40_59.png.21f27ed5aa27b93c92a44324f2a83c92.png

 

But then it well look like this with the cut outs rendering black which just doesn't look appealing.

Spoiler

2019-11-20_20_41_37.png.dbe5b772ed2ab64302e3f6c6f19f408a.png

 

 

Any suggestions on this would be appreciated.

 

Here is my new render code if that helps.

 

    @Override
    public void render(DiamondTreeLeavesTile tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage) {
        GlStateManager.enableDepthTest();
        GlStateManager.depthFunc(515);
        GlStateManager.depthMask(true);
        GlStateManager.pushMatrix();
        GlStateManager.translatef((float)x , (float)y , (float)z);
        this.bindTexture(TEXTURE);
        this.setLightmapDisabled(true);
        this.isGlobalRenderer(tileEntityIn);
        MODEL.renderThis();
        this.setLightmapDisabled(false);
        GlStateManager.popMatrix();
    }

 

 

 

Unless there's a reason you need to, you should definitely use a FastTESR here instead of a normal one, to have much lower performance impact. That would fix your transparency issue, too, since the settings are already correct. Otherwise, I think you need to GlStateManager#enableAlpha().

 

As an aside, what's with the translatef() and isGlobalRenderer() calls?

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.