From c9fa2ef069671a1fce05953a8791279a1e08cf3f Mon Sep 17 00:00:00 2001 From: Leo dev Date: Wed, 12 Nov 2025 21:09:41 +0100 Subject: [PATCH] Vertical model --- .../dev/kleo/redstonerewired/CableBlock.java | 12 +++++----- .../redstone-rewired/blockstates/cable.json | 14 +++++++---- .../models/block/cable_down.json | 24 +++++++++++++++++++ .../models/block/cable_up.json | 24 +++++++++++++++++++ 4 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 src/main/resources/assets/redstone-rewired/models/block/cable_down.json create mode 100644 src/main/resources/assets/redstone-rewired/models/block/cable_up.json diff --git a/src/main/java/dev/kleo/redstonerewired/CableBlock.java b/src/main/java/dev/kleo/redstonerewired/CableBlock.java index 716e71c..11cfb5f 100644 --- a/src/main/java/dev/kleo/redstonerewired/CableBlock.java +++ b/src/main/java/dev/kleo/redstonerewired/CableBlock.java @@ -88,17 +88,17 @@ public class CableBlock extends Block { boolean up = state.get(UP); boolean down = state.get(DOWN); - if (north || (south && !east && !west)) + if (north || (south && !east && !west && !up && !down)) shape = VoxelShapes.union(shape, Block.createCuboidShape(6, 6, 0, 10, 10, 6)); - if (south || (north && !east && !west)) + if (south || (north && !east && !west && !up && !down)) shape = VoxelShapes.union(shape, Block.createCuboidShape(6, 6, 10, 10, 10, 16)); - if (east || (!north && !south && west)) + if (east || (!north && !south && west && !up && !down)) shape = VoxelShapes.union(shape, Block.createCuboidShape(10, 6, 6, 16, 10, 10)); - if (west || (!north && !south && east)) + if (west || (!north && !south && east && !up && !down)) shape = VoxelShapes.union(shape, Block.createCuboidShape(0, 6, 6, 6, 10, 10)); - if (up) + if (up || (down && !north && !south && !east && !west)) shape = VoxelShapes.union(shape, Block.createCuboidShape(6, 6, 6, 10, 16, 10)); - if (down) + if (down || (up && !north && !south && !east && !west)) shape = VoxelShapes.union(shape, Block.createCuboidShape(6, 0, 6, 10, 6, 10)); return shape; diff --git a/src/main/resources/assets/redstone-rewired/blockstates/cable.json b/src/main/resources/assets/redstone-rewired/blockstates/cable.json index da1217e..0f1e86d 100644 --- a/src/main/resources/assets/redstone-rewired/blockstates/cable.json +++ b/src/main/resources/assets/redstone-rewired/blockstates/cable.json @@ -2,14 +2,20 @@ "multipart": [ { "apply": { "model": "redstone-rewired:block/cable_core" } }, + { "when": { "up": "true" }, "apply": { "model": "redstone-rewired:block/cable_up" } }, + { "when": { "down": "true" }, "apply": { "model": "redstone-rewired:block/cable_down" } }, + + { "when": { "north": "false", "south": "false", "east": "false", "west": "false", "up": "true", "down": "false" }, "apply": { "model": "redstone-rewired:block/cable_down" } }, + { "when": { "north": "false", "south": "false", "east": "false", "west": "false", "up": "false", "down": "true" }, "apply": { "model": "redstone-rewired:block/cable_up" } }, + { "when": { "north": "true" }, "apply": { "model": "redstone-rewired:block/cable_north" } }, { "when": { "south": "true" }, "apply": { "model": "redstone-rewired:block/cable_south" } }, { "when": { "east": "true" }, "apply": { "model": "redstone-rewired:block/cable_east" } }, { "when": { "west": "true" }, "apply": { "model": "redstone-rewired:block/cable_west" } }, - { "when": { "north": "true", "south": "false", "east": "false", "west": "false" }, "apply": { "model": "redstone-rewired:block/cable_south" } }, - { "when": { "north": "false", "south": "true", "east": "false", "west": "false" }, "apply": { "model": "redstone-rewired:block/cable_north" } }, - { "when": { "north": "false", "south": "false", "east": "true", "west": "false" }, "apply": { "model": "redstone-rewired:block/cable_west" } }, - { "when": { "north": "false", "south": "false", "east": "false", "west": "true" }, "apply": { "model": "redstone-rewired:block/cable_east" } } + { "when": { "north": "true", "south": "false", "east": "false", "west": "false", "up": "false", "down": "false" }, "apply": { "model": "redstone-rewired:block/cable_south" } }, + { "when": { "north": "false", "south": "true", "east": "false", "west": "false", "up": "false", "down": "false" }, "apply": { "model": "redstone-rewired:block/cable_north" } }, + { "when": { "north": "false", "south": "false", "east": "true", "west": "false", "up": "false", "down": "false" }, "apply": { "model": "redstone-rewired:block/cable_west" } }, + { "when": { "north": "false", "south": "false", "east": "false", "west": "true", "up": "false", "down": "false" }, "apply": { "model": "redstone-rewired:block/cable_east" } } ] } diff --git a/src/main/resources/assets/redstone-rewired/models/block/cable_down.json b/src/main/resources/assets/redstone-rewired/models/block/cable_down.json new file mode 100644 index 0000000..b2033e4 --- /dev/null +++ b/src/main/resources/assets/redstone-rewired/models/block/cable_down.json @@ -0,0 +1,24 @@ +{ + "format_version": "1.21.6", + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "redstone-rewired:block/cable", + "particle": "redstone-rewired:block/cable" + }, + "elements": [ + { + "from": [6.75, 0, 6.75], + "to": [9.25, 6.75, 9.25], + "rotation": {"angle": 0, "axis": "x", "origin": [6.75, 6.75, 6.75]}, + "faces": { + "north": {"uv": [3, 3, 1.5, 11], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "rotation": 90, "texture": "#0"}, + "up": {"uv": [3, 3, 4.5, 4.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/redstone-rewired/models/block/cable_up.json b/src/main/resources/assets/redstone-rewired/models/block/cable_up.json new file mode 100644 index 0000000..24addba --- /dev/null +++ b/src/main/resources/assets/redstone-rewired/models/block/cable_up.json @@ -0,0 +1,24 @@ +{ + "format_version": "1.21.6", + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "redstone-rewired:block/cable", + "particle": "redstone-rewired:block/cable" + }, + "elements": [ + { + "from": [6.75, 9.25, 6.75], + "to": [9.25, 16, 9.25], + "rotation": {"angle": 0, "axis": "x", "origin": [6.75, 6.75, 6.75]}, + "faces": { + "north": {"uv": [3, 3, 1.5, 11], "rotation": 180, "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "rotation": 90, "texture": "#0"}, + "up": {"uv": [3, 3, 4.5, 4.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"} + } + } + ] +} \ No newline at end of file