Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,42 @@ public MeshBuilderVertexConsumerProvider(MeshBuilder mesh) {

@Override
public VertexConsumer getBuffer(RenderLayer layer) {
return vertexConsumer;
return new W(vertexConsumer); // new instance each call to fix duplicate delegates
}

private record W(MeshBuilderVertexConsumer d) implements VertexConsumer {
public VertexConsumer vertex(float x, float y, float z) {
d.vertex(x, y, z);
return this;
}

public VertexConsumer color(int r, int g, int b, int a) {
return this;
}

public VertexConsumer color(int c) {
return this;
}

public VertexConsumer texture(float u, float v) {
return this;
}

public VertexConsumer overlay(int u, int v) {
return this;
}

public VertexConsumer light(int u, int v) {
return this;
}

public VertexConsumer normal(float x, float y, float z) {
return this;
}

public VertexConsumer lineWidth(float w) {
return this;
}
}

public void setColor(Color color) {
Expand Down