Posted November 19, 20195 yr 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()); }
November 21, 20195 yr 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 But then it well look like this with the cut outs rendering black which just doesn't look appealing. Spoiler 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(); }
November 21, 20195 yr 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.