render chests from the dumped vanilla models (single, double, trapped, ender, copper)
This commit is contained in:
1 parent
9a6c8b538d
commit
5852d4b367
7 files changed
+161
-21
No files matched your search
@@ -56,6 +56,11 @@ public class PPTest extends JavaPlugin {
|
||||
scenes.put("pistondown", new Scene("pistondown", this::piston, -1.6, 2.6, -1.6, 0.5, 1.4, 0.5));
|
||||
scenes.put("pistonup", new Scene("pistonup", this::piston, 0.4, 2.6, -1.6, 2.5, 1.4, 0.5));
|
||||
scenes.put("vehicles", new Scene("vehicles", this::vehicles, 5, 3, -7, 5, 0.6, 1.5));
|
||||
// Chests: same layout seen from all four sides (single/double per facing, trapped, ender, copper).
|
||||
scenes.put("chests_s", new Scene("chests_s", this::chests, 4.5, 5, 13, 4.5, 0, 3));
|
||||
scenes.put("chests_n", new Scene("chests_n", this::chests, 4.5, 5, -7, 4.5, 0, 3));
|
||||
scenes.put("chests_e", new Scene("chests_e", this::chests, 16, 5, 3, 4.5, 0, 3));
|
||||
scenes.put("chests_w", new Scene("chests_w", this::chests, -7, 5, 3, 4.5, 0, 3));
|
||||
scenes.put("translucent", new Scene("translucent", this::translucent, 4.5, 2.8, -5.5, 4.5, 0.8, 2));
|
||||
}
|
||||
|
||||
@@ -430,6 +435,29 @@ public class PPTest extends JavaPlugin {
|
||||
o.clone().add(9, 0, 4).getBlock().setBlockData(Bukkit.createBlockData("minecraft:oak_log[axis=z]"), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Row z=0: single chests facing S/W/N/E (x=0,3,6,9). Row z=3: double chests per facing — the LEFT half
|
||||
* at x, its RIGHT partner on facing.getClockWise(). Row z=6: trapped double (S), ender, copper, oxidized
|
||||
* copper double (N).
|
||||
*/
|
||||
private void chests(Location o) {
|
||||
String[] f = {"south", "west", "north", "east"};
|
||||
int[][] cw = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
|
||||
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);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
put.accept(new int[] {i * 3, 0, 0}, "chest[facing=" + f[i] + ",type=single]");
|
||||
put.accept(new int[] {i * 3, 0, 3}, "chest[facing=" + f[i] + ",type=left]");
|
||||
put.accept(new int[] {i * 3 + cw[i][0], 0, 3 + cw[i][1]}, "chest[facing=" + f[i] + ",type=right]");
|
||||
}
|
||||
put.accept(new int[] {0, 0, 6}, "trapped_chest[facing=south,type=left]");
|
||||
put.accept(new int[] {-1, 0, 6}, "trapped_chest[facing=south,type=right]");
|
||||
put.accept(new int[] {3, 0, 6}, "ender_chest[facing=south]");
|
||||
put.accept(new int[] {6, 0, 6}, "copper_chest[facing=east,type=single]");
|
||||
put.accept(new int[] {9, 0, 6}, "oxidized_copper_chest[facing=north,type=left]");
|
||||
put.accept(new int[] {10, 0, 6}, "oxidized_copper_chest[facing=north,type=right]");
|
||||
}
|
||||
|
||||
/** 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()
|
||||
|
||||
Reference in new issue
Block a user