Polygon shape broken on servers
vlad2305m opened this issue ยท 7 comments
/script run draw_shape('polygon',20,{'points'->[[0,100,0],[0,100,1],[1,100,1]]})
works in singleplayer (returns true and shows the polygon), but gives no output at all on servers. fabric-carpet-1.19.3-1.4.93+v221230
The problem is that, instead of just sending the shape to the client, you initialize the shape on the server first. Of course, not all rendering configurations are available on a standalone server ;)
Just replacing the enum values in question with their ordinal solves the issue.
@Environment(EnvType.CLIENT)
public static enum Mode {
LINES(4, 2, 2, false),
LINE_STRIP(5, 2, 1, true),
DEBUG_LINES(1, 2, 2, false),
DEBUG_LINE_STRIP(3, 2, 1, true),
TRIANGLES(4, 3, 3, false),
TRIANGLE_STRIP(5, 3, 1, true),
TRIANGLE_FAN(6, 3, 1, true),
QUADS(4, 4, 4, false);
...
probably due to very broad catch around scarpet executions.
I think it warrants cherrypicking to 1.19.3