Quad cable model
build / build (push) Canceled after 0s

This commit is contained in:
2025-11-13 19:45:40 +01:00
parent bc177a9b05
commit 907e9448a7
8 changed files with 332 additions and 7 deletions
@@ -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))
@@ -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" } },
@@ -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"},
@@ -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"}
}
}
]
}
@@ -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"}
}
}
]
}
@@ -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"}
}
}
]
}
@@ -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"}
}
}
]
}
@@ -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"}
}
}
]
}