From 5cdf884853e1bc677a6b1bfabb7480decb10f8ec Mon Sep 17 00:00:00 2001 From: quentin452 <42176772+quentin452@users.noreply.github.com> Date: Sat, 19 Aug 2023 22:32:25 +0200 Subject: [PATCH] Micro reduce fps lags with tileentities (#236) * Fix this pullrequest [here](https://github.com/GTNewHorizons/Hodgepodge/pull/235) that make tile entities invisible and optimize more the mixin : Fix this pullrequest [here](https://github.com/GTNewHorizons/Hodgepodge/pull/235) that make tile entities invisible and optimize more the mixin : Same ammount of ceramic jar from zelda mod before https://cdn.discordapp.com/attachments/1022680913122951258/1142524047641546852/Capture_decran_2023-08-19_20-20-52.png After https://cdn.discordapp.com/attachments/1022680913122951258/1142524047322792036/Capture_decran_2023-08-19_20-21-32.png * spotlessApply --- .../early/minecraft/MixinRenderGlobal.java | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinRenderGlobal.java b/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinRenderGlobal.java index f304d010..f100d229 100644 --- a/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinRenderGlobal.java +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinRenderGlobal.java @@ -47,6 +47,8 @@ public class MixinRenderGlobal { by = 1)) public void hodgepodge$prepareTESR(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_, CallbackInfo ci) { + ManagedEnum renderDebugMode = HodgepodgeClient.renderDebugMode; + if (renderDebugMode.is(RenderDebugMode.OFF)) return; RenderDebugHelper.recordGLStates(); } @@ -64,32 +66,30 @@ public class MixinRenderGlobal { instance.renderTileEntity(j, k); - if (renderDebugMode.is(RenderDebugMode.OFF)) { - knownIssues.clear(); - return; - } + if (!renderDebugMode.is(RenderDebugMode.OFF)) { - if (!knownIssues.contains(j) && !RenderDebugHelper.checkGLStates()) { - knownIssues.add(j); - Minecraft.getMinecraft().thePlayer.addChatMessage( - new ChatComponentText( - "TileEntity (" + j.getClass().getName() - + " at " - + j.xCoord - + ", " - + j.yCoord - + ", " - + j.zCoord - + ") is messing up render states!")); - RenderDebugHelper.log.error( - "TileEntity {} at ({}, {}, {}) alter render state after TESR call: {}", - j.getClass(), - j.xCoord, - j.yCoord, - j.zCoord, - RenderDebugHelper.compose()); - } + if (!knownIssues.contains(j) && !RenderDebugHelper.checkGLStates()) { + knownIssues.add(j); + Minecraft.getMinecraft().thePlayer.addChatMessage( + new ChatComponentText( + "TileEntity (" + j.getClass().getName() + + " at " + + j.xCoord + + ", " + + j.yCoord + + ", " + + j.zCoord + + ") is messing up render states!")); + RenderDebugHelper.log.error( + "TileEntity {} at ({}, {}, {}) alter render state after TESR call: {}", + j.getClass(), + j.xCoord, + j.yCoord, + j.zCoord, + RenderDebugHelper.compose()); + } - GL11.glPopAttrib(); + GL11.glPopAttrib(); + } } }