fix meshemitter

This commit is contained in:
IThundxr 2024-10-14 17:44:55 -04:00
parent aeb9781bd4
commit 008b09891a
Failed to generate hash of commit
2 changed files with 11 additions and 6 deletions

View file

@ -31,7 +31,9 @@ class MeshEmitter {
public void end() { public void end() {
if (((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding()) { if (((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding()) {
emit(); emit();
bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
} }
resultConsumer = null; resultConsumer = null;
} }
@ -41,10 +43,11 @@ class MeshEmitter {
} }
void prepareForGeometry(boolean shade) { void prepareForGeometry(boolean shade) {
bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); if (!((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding()) {
bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
if (((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding() && shade != currentShade) { } else if (shade != currentShade) {
emit(); emit();
bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
} }
currentShade = shade; currentShade = shade;

View file

@ -34,6 +34,7 @@ class MeshEmitter implements VertexConsumer {
public void end() { public void end() {
if (((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding()) { if (((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding()) {
emit(); emit();
bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
} }
resultConsumer = null; resultConsumer = null;
} }
@ -44,10 +45,11 @@ class MeshEmitter implements VertexConsumer {
} }
void prepareForGeometry(boolean shade) { void prepareForGeometry(boolean shade) {
bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK); if (!((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding()) {
bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
if (((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding() && shade != currentShade) { } else if (shade != currentShade) {
emit(); emit();
bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);
} }
currentShade = shade; currentShade = shade;