Skip to content

Commit 2d22601

Browse files
noramibuWide-Cat
authored andcommitted
fix duplicate delegates crash in StorageESP
1 parent 7a68800 commit 2d22601

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

src/main/java/meteordevelopment/meteorclient/utils/render/MeshBuilderVertexConsumerProvider.java

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,42 @@ public MeshBuilderVertexConsumerProvider(MeshBuilder mesh) {
1919

2020
@Override
2121
public VertexConsumer getBuffer(RenderLayer layer) {
22-
return vertexConsumer;
22+
return new W(vertexConsumer); // new instance each call to fix duplicate delegates
23+
}
24+
25+
private record W(MeshBuilderVertexConsumer d) implements VertexConsumer {
26+
public VertexConsumer vertex(float x, float y, float z) {
27+
d.vertex(x, y, z);
28+
return this;
29+
}
30+
31+
public VertexConsumer color(int r, int g, int b, int a) {
32+
return this;
33+
}
34+
35+
public VertexConsumer color(int c) {
36+
return this;
37+
}
38+
39+
public VertexConsumer texture(float u, float v) {
40+
return this;
41+
}
42+
43+
public VertexConsumer overlay(int u, int v) {
44+
return this;
45+
}
46+
47+
public VertexConsumer light(int u, int v) {
48+
return this;
49+
}
50+
51+
public VertexConsumer normal(float x, float y, float z) {
52+
return this;
53+
}
54+
55+
public VertexConsumer lineWidth(float w) {
56+
return this;
57+
}
2358
}
2459

2560
public void setColor(Color color) {

0 commit comments

Comments
 (0)