parse 26.x texture objects in block models (redstone, glass, panes)
Since 26.x a model texture can be an object {"sprite": ..., "force_translucent": ...}
instead of a string. The block-model DTO only accepted strings, so those
models failed to load and rendered as the grey fallback cube: redstone
wire and every glass block and pane (110 models). Accept both forms in
ModelResolver (shared with ItemGeometry).
Edge-case test plugin: redstone/glass scene.
This commit is contained in:
1 parent
9e59435e13
commit
73e521131b
4 files changed
+37
-9
No files matched your search
@@ -50,6 +50,7 @@ public class PPTest extends JavaPlugin {
|
||||
scenes.put("shelftop", new Scene("shelftop", this::shelf, 0.52, 6, 0.5, 0.5, 0, 0.5));
|
||||
scenes.put("rotated", new Scene("rotated", this::rotated, 3, 4.5, -4, 3, 0.5, 2));
|
||||
scenes.put("rotated2", new Scene("rotated2", this::rotated, -0.5, 3.5, 9.5, -0.5, 0.5, 5));
|
||||
scenes.put("redstone", new Scene("redstone", this::redstone, 3, 3, -3, 3, 0, 2));
|
||||
scenes.put("vehicles", new Scene("vehicles", this::vehicles, 5, 3, -7, 5, 0.6, 1.5));
|
||||
}
|
||||
|
||||
@@ -424,6 +425,23 @@ public class PPTest extends JavaPlugin {
|
||||
o.clone().add(9, 0, 4).getBlock().setBlockData(Bukkit.createBlockData("minecraft:oak_log[axis=z]"), false);
|
||||
}
|
||||
|
||||
/** Redstone wire (dot, line, corner, climbing a wall, powered/unpowered) next to glass and panes. */
|
||||
private void redstone(Location o) {
|
||||
java.util.function.BiConsumer<int[], String> put = (p, data) -> o.clone().add(p[0], p[1], p[2]).getBlock()
|
||||
.setBlockData(Bukkit.createBlockData("minecraft:" + data), false);
|
||||
put.accept(new int[] {0, 0, 0}, "redstone_wire[power=0]");
|
||||
for (int x = 1; x <= 4; x++) put.accept(new int[] {x, 0, 0}, "redstone_wire[east=side,west=side,power=" + (x * 3) + "]");
|
||||
put.accept(new int[] {5, 0, 0}, "redstone_wire[west=side,north=side,power=15]");
|
||||
put.accept(new int[] {5, 0, -1}, "redstone_wire[south=side,north=up,power=15]");
|
||||
put.accept(new int[] {5, 0, -2}, "stone");
|
||||
put.accept(new int[] {5, 1, -2}, "redstone_wire[south=side,power=15]");
|
||||
put.accept(new int[] {0, 0, 3}, "glass");
|
||||
put.accept(new int[] {1, 0, 3}, "red_stained_glass");
|
||||
put.accept(new int[] {2, 0, 3}, "glass_pane[east=true,west=false]");
|
||||
put.accept(new int[] {3, 0, 3}, "blue_stained_glass_pane[east=true,west=true]");
|
||||
put.accept(new int[] {4, 0, 3}, "blue_stained_glass_pane[west=true,north=true]");
|
||||
}
|
||||
|
||||
private void vehicles(Location o) {
|
||||
spawn(o, 0, 0, 0, 0, EntityType.CHEST_MINECART);
|
||||
spawn(o, 1.8, 0, 0, 90, EntityType.FURNACE_MINECART);
|
||||
|
||||
Reference in new issue
Block a user