fixed use of client side classes in shape dispatcher

This commit is contained in:
gnembon committed 2023-01-31 21:54:34 +01:00
1 parent d49be89e23
commit 85f7c64847
1 file changed
+4 -1
@@ -549,6 +549,9 @@ public class ShapesRenderer
} }
public static class RenderedPolyface extends RenderedShape<ShapeDispatcher.Polyface> public static class RenderedPolyface extends RenderedShape<ShapeDispatcher.Polyface>
{ {
private static final VertexFormat.Mode[] faceIndices = new VertexFormat.Mode[]{
Mode.LINES, Mode.LINE_STRIP, Mode.DEBUG_LINES, Mode.DEBUG_LINE_STRIP, Mode.TRIANGLES, Mode.TRIANGLE_STRIP, Mode.TRIANGLE_FAN, Mode.QUADS};
public RenderedPolyface(Minecraft client, ShapeDispatcher.ExpiringShape shape) public RenderedPolyface(Minecraft client, ShapeDispatcher.ExpiringShape shape)
{ {
super(client, (ShapeDispatcher.Polyface)shape); super(client, (ShapeDispatcher.Polyface)shape);
@@ -563,7 +566,7 @@ public class ShapesRenderer
else else
RenderSystem.enableCull(); RenderSystem.enableCull();
bufferBuilder.begin(VertexFormat.Mode.values()[shape.mode], DefaultVertexFormat.POSITION_COLOR); bufferBuilder.begin(faceIndices[shape.mode], DefaultVertexFormat.POSITION_COLOR);
for(int i=0;i<shape.vertex_list.size();i++){ for(int i=0;i<shape.vertex_list.size();i++){
Vec3 vec=shape.vertex_list.get(i); Vec3 vec=shape.vertex_list.get(i);
if(shape.relative.get(i)){ if(shape.relative.get(i)){