From c9156674464d0ba39a3f38af129f0ec1f9d962d2 Mon Sep 17 00:00:00 2001 From: charagarlnad <27380203+charagarlnad@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:28:04 -0500 Subject: [PATCH] Reuse modelview in firefly render (#95) (cherry picked from commit 2a1e618c128bbb5953644c8e980f01d361423792) --- .../client/renderer/entity/RenderTFTinyFirefly.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/twilightforest/client/renderer/entity/RenderTFTinyFirefly.java b/src/main/java/twilightforest/client/renderer/entity/RenderTFTinyFirefly.java index b2befc3a6a..08e22e4674 100644 --- a/src/main/java/twilightforest/client/renderer/entity/RenderTFTinyFirefly.java +++ b/src/main/java/twilightforest/client/renderer/entity/RenderTFTinyFirefly.java @@ -20,6 +20,8 @@ public class RenderTFTinyFirefly extends Render { private static final ResourceLocation textureLoc = new ResourceLocation( TwilightForestMod.MODEL_DIR + "firefly-tiny.png"); + private static final FloatBuffer modelview = BufferUtils.createFloatBuffer(16); + public RenderTFTinyFirefly() { fireflyModel = new ModelTFTinyFirefly(); } @@ -42,7 +44,7 @@ public void doRenderTinyFirefly(EntityTFTinyFirefly firefly, double x, double y, GL11.glTranslatef((float) x, (float) y + 0.5F, (float) z); // undo rotations so we can draw a billboarded firefly - FloatBuffer modelview = BufferUtils.createFloatBuffer(16); + modelview.clear(); GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview);