diff --git a/src/main/java/dev/kleo/redstonerewired/QuadCableBlock.java b/src/main/java/dev/kleo/redstonerewired/QuadCableBlock.java index 09df54d..c679b03 100644 --- a/src/main/java/dev/kleo/redstonerewired/QuadCableBlock.java +++ b/src/main/java/dev/kleo/redstonerewired/QuadCableBlock.java @@ -72,12 +72,12 @@ public class QuadCableBlock extends Block { } private void updateStates(World world, BlockPos pos, BlockState state) { - boolean north = world.getBlockState(pos.north()).getBlock() instanceof CableBlock; - boolean south = world.getBlockState(pos.south()).getBlock() instanceof CableBlock; - boolean east = world.getBlockState(pos.east()).getBlock() instanceof CableBlock; - boolean west = world.getBlockState(pos.west()).getBlock() instanceof CableBlock; - boolean up = world.getBlockState(pos.up()).getBlock() instanceof CableBlock; - boolean down = world.getBlockState(pos.down()).getBlock() instanceof CableBlock; + boolean north = world.getBlockState(pos.north()).getBlock() instanceof QuadCableBlock; + boolean south = world.getBlockState(pos.south()).getBlock() instanceof QuadCableBlock; + boolean east = world.getBlockState(pos.east()).getBlock() instanceof QuadCableBlock; + boolean west = world.getBlockState(pos.west()).getBlock() instanceof QuadCableBlock; + boolean up = world.getBlockState(pos.up()).getBlock() instanceof QuadCableBlock; + boolean down = world.getBlockState(pos.down()).getBlock() instanceof QuadCableBlock; world.setBlockState(pos, state .with(NORTH, north || (south && !east && !west && !up && !down)) diff --git a/src/main/resources/assets/redstone-rewired/blockstates/quad_cable.json b/src/main/resources/assets/redstone-rewired/blockstates/quad_cable.json index 6fe0d26..8d8c9c9 100644 --- a/src/main/resources/assets/redstone-rewired/blockstates/quad_cable.json +++ b/src/main/resources/assets/redstone-rewired/blockstates/quad_cable.json @@ -1,6 +1,10 @@ { "multipart": [ - { "apply": { "model": "redstone-rewired:block/quad_cable/core" } }, + { "when": { "north": "true" }, "apply": { "model": "redstone-rewired:block/quad_cable/core" } }, + { "when": { "south": "true" }, "apply": { "model": "redstone-rewired:block/quad_cable/core" } }, + + { "when": { "west": "true" }, "apply": { "model": "redstone-rewired:block/quad_cable/core2" } }, + { "when": { "east": "true" }, "apply": { "model": "redstone-rewired:block/quad_cable/core2" } }, { "when": { "up": "true" }, "apply": { "model": "redstone-rewired:block/quad_cable/up" } }, { "when": { "down": "true" }, "apply": { "model": "redstone-rewired:block/quad_cable/down" } }, diff --git a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/core.json b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/core.json index da7bb0a..ade24d4 100644 --- a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/core.json +++ b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/core.json @@ -7,9 +7,58 @@ "particle": "redstone-rewired:block/cable" }, "elements": [ + { + "from": [3.5, 3.5, 6.75], + "to": [6, 6, 9.25], + "faces": { + "north": {"uv": [3, 1.5, 4.5, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 0, 4.5, 1.5], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [10, 3.5, 6.75], + "to": [12.5, 6, 9.25], + "faces": { + "north": {"uv": [3, 1.5, 4.5, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 0, 4.5, 1.5], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [3.5, 10, 6.75], + "to": [6, 12.5, 9.25], + "faces": { + "north": {"uv": [3, 1.5, 4.5, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 0, 4.5, 1.5], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, { "from": [6.75, 6.75, 6.75], "to": [9.25, 9.25, 9.25], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -3, 0]}, + "faces": { + "north": {"uv": [3, 1.5, 4.5, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 0, 4.5, 1.5], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [10, 10, 6.75], + "to": [12.5, 12.5, 9.25], "faces": { "north": {"uv": [3, 1.5, 4.5, 3], "texture": "#0"}, "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, diff --git a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/core2.json b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/core2.json new file mode 100644 index 0000000..62c7aa0 --- /dev/null +++ b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/core2.json @@ -0,0 +1,72 @@ +{ + "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, 3.5, 3.75], + "to": [9.25, 6, 6.25], + "faces": { + "north": {"uv": [3, 1.5, 4.5, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 0, 4.5, 1.5], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [6.75, 3.5, 10], + "to": [9.25, 6, 12.5], + "faces": { + "north": {"uv": [3, 1.5, 4.5, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 0, 4.5, 1.5], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [6.75, 10, 3.75], + "to": [9.25, 12.5, 6.25], + "faces": { + "north": {"uv": [3, 1.5, 4.5, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 0, 4.5, 1.5], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [6.75, 6.75, 6.75], + "to": [9.25, 9.25, 9.25], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -3, 0]}, + "faces": { + "north": {"uv": [3, 1.5, 4.5, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 0, 4.5, 1.5], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [6.75, 10, 10], + "to": [9.25, 12.5, 12.5], + "faces": { + "north": {"uv": [3, 1.5, 4.5, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 0, 4.5, 1.5], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/east.json b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/east.json index b203b0c..e127ca2 100644 --- a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/east.json +++ b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/east.json @@ -19,6 +19,58 @@ "up": {"uv": [1.5, 11, 0, 3], "rotation": 270, "texture": "#0"}, "down": {"uv": [3, 3, 1.5, 11], "rotation": 90, "texture": "#0"} } + }, + { + "from": [9.25, 3.5, 3.5], + "to": [16, 6, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [6.75, 6.75, 6.75]}, + "faces": { + "north": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "east": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "south": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "west": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [9.25, 3.5, 10], + "to": [16, 6, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [6.75, 6.75, 6.75]}, + "faces": { + "north": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "east": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "south": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "west": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [9.25, 10, 3.5], + "to": [16, 12.5, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [6.75, 6.75, 6.75]}, + "faces": { + "north": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "east": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "south": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "west": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [9.25, 10, 10], + "to": [16, 12.5, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [6.75, 6.75, 6.75]}, + "faces": { + "north": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "east": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "south": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "west": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "rotation": 90, "texture": "#0"} + } } ] } \ No newline at end of file diff --git a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/north.json b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/north.json index 7014378..cca04b2 100644 --- a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/north.json +++ b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/north.json @@ -18,6 +18,54 @@ "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} } + }, + { + "from": [3.5, 3.5, 0], + "to": [6, 6, 6.75], + "faces": { + "north": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [10, 3.5, 0], + "to": [12.5, 6, 6.75], + "faces": { + "north": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [3.5, 10, 0], + "to": [6, 12.5, 6.75], + "faces": { + "north": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [10, 10, 0], + "to": [12.5, 12.5, 6.75], + "faces": { + "north": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } } ] } \ No newline at end of file diff --git a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/south.json b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/south.json index 81189a9..cda8767 100644 --- a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/south.json +++ b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/south.json @@ -18,6 +18,54 @@ "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} } + }, + { + "from": [3.5, 3.5, 9.25], + "to": [6, 6, 16], + "faces": { + "north": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [10, 10, 9.25], + "to": [12.5, 12.5, 16], + "faces": { + "north": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [3.5, 10, 9.25], + "to": [6, 12.5, 16], + "faces": { + "north": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } + }, + { + "from": [10, 3.5, 9.25], + "to": [12.5, 6, 16], + "faces": { + "north": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "east": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "south": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "west": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "texture": "#0"} + } } ] } \ No newline at end of file diff --git a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/west.json b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/west.json index 97a99af..12dfd6c 100644 --- a/src/main/resources/assets/redstone-rewired/models/block/quad_cable/west.json +++ b/src/main/resources/assets/redstone-rewired/models/block/quad_cable/west.json @@ -19,6 +19,58 @@ "up": {"uv": [1.5, 11, 0, 3], "rotation": 270, "texture": "#0"}, "down": {"uv": [3, 3, 1.5, 11], "rotation": 90, "texture": "#0"} } + }, + { + "from": [0, 3.5, 3.5], + "to": [6.75, 6, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [6.75, 6.75, 6.75]}, + "faces": { + "north": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "east": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "south": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "west": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [0, 3.5, 10], + "to": [6.75, 6, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [6.75, 6.75, 6.75]}, + "faces": { + "north": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "east": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "south": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "west": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [0, 10, 3.5], + "to": [6.75, 12.5, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [6.75, 6.75, 6.75]}, + "faces": { + "north": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "east": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "south": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "west": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [0, 10, 10], + "to": [6.75, 12.5, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [6.75, 6.75, 6.75]}, + "faces": { + "north": {"uv": [0, 0, 8, 1.5], "texture": "#0"}, + "east": {"uv": [3, 4.5, 4.5, 6], "texture": "#0"}, + "south": {"uv": [0, 1.5, 8, 3], "texture": "#0"}, + "west": {"uv": [3, 3, 4.5, 4.5], "texture": "#0"}, + "up": {"uv": [1.5, 11, 0, 3], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 3, 1.5, 11], "rotation": 90, "texture": "#0"} + } } ] } \ No newline at end of file