diff --git a/fabric/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitter.java b/fabric/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitter.java index 9f0c7e2d0..c858bf6a1 100644 --- a/fabric/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitter.java +++ b/fabric/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitter.java @@ -31,9 +31,7 @@ public void prepare(BakedModelBufferer.ResultConsumer resultConsumer) { public void end() { if (((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding()) { emit(); - bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); } - resultConsumer = null; } @@ -47,7 +45,6 @@ void prepareForGeometry(boolean shade) { bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); } else if (shade != currentShade) { emit(); - bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); } currentShade = shade; @@ -60,5 +57,7 @@ void emit() { resultConsumer.accept(renderType, currentShade, renderedBuffer); renderedBuffer.close(); } + + bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); } } diff --git a/forge/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitter.java b/forge/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitter.java index 204df5b35..7a93e9e26 100644 --- a/forge/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitter.java +++ b/forge/src/lib/java/dev/engine_room/flywheel/lib/model/baked/MeshEmitter.java @@ -34,7 +34,6 @@ public void prepare(BakedModelBufferer.ResultConsumer resultConsumer) { public void end() { if (((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding()) { emit(); - bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); } resultConsumer = null; } @@ -49,7 +48,6 @@ void prepareForGeometry(boolean shade) { bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); } else if (shade != currentShade) { emit(); - bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); } currentShade = shade; @@ -66,6 +64,8 @@ private void emit() { resultConsumer.accept(renderType, currentShade, renderedBuffer); renderedBuffer.close(); } + + bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); } @Override