Skip to content

Commit

Permalink
fix meshemitter
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Oct 14, 2024
1 parent aeb9781 commit 008b098
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ 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;
}

Expand All @@ -41,10 +43,11 @@ public BufferBuilder getBuffer(boolean shade) {
}

void prepareForGeometry(boolean shade) {
bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);

if (((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding() && shade != currentShade) {
if (!((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding()) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,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;
}
Expand All @@ -44,10 +45,11 @@ public BufferBuilder unwrap(boolean shade) {
}

void prepareForGeometry(boolean shade) {
bufferBuilder = new BufferBuilder(byteBufferBuilder, VertexFormat.Mode.QUADS, DefaultVertexFormat.BLOCK);

if (((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding() && shade != currentShade) {
if (!((BufferBuilderAccessor) bufferBuilder).flywheel$getBuilding()) {
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;
Expand Down

0 comments on commit 008b098

Please sign in to comment.