Cache the models for the Arcane Enervation Emitter (#23)

* Cache the models for the Arcane Enervation Emitter

Could be the reason why there's a memory leak but I can't tell if it's
actually been fixed by this change

* spotlessApply (#24)

Co-authored-by: GitHub GTNH Actions <>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
firenooGitHub GTNH Actionsgithub-actions[bot]
authored and GitHub committed 2023-07-31 10:09:00 +02:00
1 parent 435c6f4766
commit 829d0f6efb
1 file changed
+5 -2
@@ -22,6 +22,9 @@ public class RenderTileBlockProtector extends TileJarRenderer {
private static final ResourceLocation TEXTURE_OFF = new SimpleResourceLocation("models/block_protector_off.png");
private static final ResourceLocation TEXTURE_ON = new SimpleResourceLocation("models/block_protector_on.png");
private static final ModelBlockProtector MODEL_BP = new ModelBlockProtector();
private static final ModelJar MODEL_JAR = new ModelJar();
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
this.renderTileEntityAt((TileBlockProtector) tile, x, y, z, partialTicks);
@@ -53,7 +56,7 @@ public class RenderTileBlockProtector extends TileJarRenderer {
this.bindTexture(
tile.getPowerLevel() > 0 ? RenderTileBlockProtector.TEXTURE_ON : RenderTileBlockProtector.TEXTURE_OFF);
new ModelBlockProtector().render(null, 0, 0, 0, 0, 0, 0.0625f);
MODEL_BP.render(null, 0, 0, 0, 0, 0, 0.0625f);
GL11.glPopMatrix();
GL11.glTranslatef(0, -2 / 16f - 0.03f, 0);
@@ -64,7 +67,7 @@ public class RenderTileBlockProtector extends TileJarRenderer {
GL11.glTranslatef(-0.5f, 0, 0.5f);
this.bindTexture(new ResourceLocation("thaumcraft", "textures/models/jar.png"));
new ModelJar().renderAll();
MODEL_JAR.renderAll();
GL11.glPopMatrix();
}