Skip to content

Commit

Permalink
Micro reduce fps lags with tileentities (#236)
Browse files Browse the repository at this point in the history
* Fix this pullrequest [here](#235) that make tile entities invisible and optimize more the mixin :

Fix this pullrequest [here](#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
  • Loading branch information
quentin452 authored Aug 19, 2023
1 parent 7f39d59 commit 5cdf884
Showing 1 changed file with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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> renderDebugMode = HodgepodgeClient.renderDebugMode;
if (renderDebugMode.is(RenderDebugMode.OFF)) return;
RenderDebugHelper.recordGLStates();
}

Expand All @@ -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();
}
}
}

0 comments on commit 5cdf884

Please sign in to comment.