Fix lamps

This commit is contained in:
Andrew-71 2023-07-17 21:48:00 +03:00
parent ee51f94613
commit e3eeccfd60
3 changed files with 99 additions and 84 deletions

View file

@ -83,10 +83,30 @@ public class LampBlock extends Block implements Waterloggable {
return false; return false;
} }
public static VoxelShape getHangingShape(){
VoxelShape shape = VoxelShapes.empty();
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.34375, -0.221875, 0.34375, 0.65625, 0.090625, 0.65625));
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.125, 0.0625, 0.125, 0.875, 0.4375, 0.875));
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.5, 0.5, 0.125, 0.5, 0.875, 0.875));
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.09375, 0.4375, 0.09375, 0.90625, 0.5, 0.15625));
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.4375, 0.875, 0.4375, 0.5625, 0.90625, 0.5625));
shape.simplify();
return shape;
}
public static VoxelShape getStandingShape(){
VoxelShape shape = VoxelShapes.empty();
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.1875, 0.4375, 0.1875, 0.8125, 1.0625, 0.8125));
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.375, 0, 0.375, 0.625, 0.25, 0.625));
shape = VoxelShapes.union(shape, VoxelShapes.cuboid(0.4375, 0.25, 0.4375, 0.5625, 0.875, 0.5625));
shape.simplify();
return shape;
}
static { static {
HANGING = Properties.HANGING; HANGING = Properties.HANGING;
WATERLOGGED = Properties.WATERLOGGED; WATERLOGGED = Properties.WATERLOGGED;
STANDING_SHAPE = VoxelShapes.union(Block.createCuboidShape(5.0, 0.0, 5.0, 11.0, 7.0, 11.0), Block.createCuboidShape(6.0, 7.0, 6.0, 10.0, 9.0, 10.0)); STANDING_SHAPE = getStandingShape();
HANGING_SHAPE = VoxelShapes.union(Block.createCuboidShape(5.0, 1.0, 5.0, 11.0, 8.0, 11.0), Block.createCuboidShape(6.0, 8.0, 6.0, 10.0, 10.0, 10.0)); HANGING_SHAPE = getHangingShape();
} }
} }

View file

@ -6,9 +6,9 @@
}, },
"elements": [ "elements": [
{ {
"from": [13, -5.1, 13], "from": [10.5, 1.45, 10.5],
"to": [3, -15.1, 3], "to": [5.5, -3.55, 5.5],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"north": {"uv": [6.5, 8, 9, 10.5], "texture": "#0", "tintindex": 1}, "north": {"uv": [6.5, 8, 9, 10.5], "texture": "#0", "tintindex": 1},
"east": {"uv": [6.5, 8, 9, 10.5], "texture": "#0", "tintindex": 1}, "east": {"uv": [6.5, 8, 9, 10.5], "texture": "#0", "tintindex": 1},
@ -19,9 +19,9 @@
} }
}, },
{ {
"from": [3, -15.1, 3], "from": [5.5, -3.55, 5.5],
"to": [13, -5.1, 13], "to": [10.5, 1.45, 10.5],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"north": {"uv": [6.5, 8, 9, 10.5], "texture": "#0", "tintindex": 1}, "north": {"uv": [6.5, 8, 9, 10.5], "texture": "#0", "tintindex": 1},
"east": {"uv": [6.5, 8, 9, 10.5], "texture": "#0", "tintindex": 1}, "east": {"uv": [6.5, 8, 9, 10.5], "texture": "#0", "tintindex": 1},
@ -32,9 +32,9 @@
} }
}, },
{ {
"from": [-4, -6, -4], "from": [2, 1, 2],
"to": [20, 6, 20], "to": [14, 7, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"north": {"uv": [6, 0, 12, 3], "texture": "#0", "tintindex": 1}, "north": {"uv": [6, 0, 12, 3], "texture": "#0", "tintindex": 1},
"east": {"uv": [6, 0, 12, 3], "texture": "#0", "tintindex": 1}, "east": {"uv": [6, 0, 12, 3], "texture": "#0", "tintindex": 1},
@ -44,9 +44,9 @@
} }
}, },
{ {
"from": [20, 6, 20], "from": [14, 7, 14],
"to": [-4, -6, -4], "to": [2, 1, 2],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"north": {"uv": [6, 0, 12, 3], "rotation": 180, "texture": "#0", "tintindex": 1}, "north": {"uv": [6, 0, 12, 3], "rotation": 180, "texture": "#0", "tintindex": 1},
"east": {"uv": [6, 0, 12, 3], "rotation": 180, "texture": "#0", "tintindex": 1}, "east": {"uv": [6, 0, 12, 3], "rotation": 180, "texture": "#0", "tintindex": 1},
@ -56,27 +56,27 @@
} }
}, },
{ {
"from": [8, 8, -4], "from": [8, 8, 2],
"to": [8, 20, 20], "to": [8, 14, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"east": {"uv": [6.5, 4.75, 12.5, 7.75], "texture": "#0"}, "east": {"uv": [6.5, 4.75, 12.5, 7.75], "texture": "#0"},
"west": {"uv": [6.5, 4.75, 12.5, 7.75], "texture": "#0"} "west": {"uv": [6.5, 4.75, 12.5, 7.75], "texture": "#0"}
} }
}, },
{ {
"from": [-4, 8, 8], "from": [2, 8, 8],
"to": [20, 20, 8], "to": [14, 14, 8],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"north": {"uv": [6.5, 4.75, 12.5, 7.75], "texture": "#0"}, "north": {"uv": [6.5, 4.75, 12.5, 7.75], "texture": "#0"},
"south": {"uv": [6.5, 4.75, 12.5, 7.75], "texture": "#0"} "south": {"uv": [6.5, 4.75, 12.5, 7.75], "texture": "#0"}
} }
}, },
{ {
"from": [-5, 6, -5], "from": [1.5, 7, 1.5],
"to": [21, 8, -3], "to": [14.5, 8, 2.5],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"north": {"uv": [6, 3, 12.5, 3.5], "texture": "#0"}, "north": {"uv": [6, 3, 12.5, 3.5], "texture": "#0"},
"east": {"uv": [6.5, 3, 6, 3.5], "texture": "#0"}, "east": {"uv": [6.5, 3, 6, 3.5], "texture": "#0"},
@ -87,9 +87,9 @@
} }
}, },
{ {
"from": [-5, 6, 19], "from": [1.5, 7, 13.5],
"to": [21, 8, 21], "to": [14.5, 8, 14.5],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"north": {"uv": [6, 3, 12.5, 3.5], "texture": "#0"}, "north": {"uv": [6, 3, 12.5, 3.5], "texture": "#0"},
"east": {"uv": [6, 3, 6.5, 3.5], "texture": "#0"}, "east": {"uv": [6, 3, 6.5, 3.5], "texture": "#0"},
@ -100,9 +100,9 @@
} }
}, },
{ {
"from": [-5, 6, -3], "from": [1.5, 7, 2.5],
"to": [-3, 8, 19], "to": [2.5, 8, 13.5],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"east": {"uv": [6.5, 3, 12, 3.5], "texture": "#0"}, "east": {"uv": [6.5, 3, 12, 3.5], "texture": "#0"},
"west": {"uv": [6.5, 3, 12, 3.5], "texture": "#0"}, "west": {"uv": [6.5, 3, 12, 3.5], "texture": "#0"},
@ -111,9 +111,9 @@
} }
}, },
{ {
"from": [19, 6, -3], "from": [13.5, 7, 2.5],
"to": [21, 8, 19], "to": [14.5, 8, 13.5],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"east": {"uv": [6.5, 3, 12, 3.5], "texture": "#0"}, "east": {"uv": [6.5, 3, 12, 3.5], "texture": "#0"},
"west": {"uv": [6.5, 3, 12, 3.5], "texture": "#0"}, "west": {"uv": [6.5, 3, 12, 3.5], "texture": "#0"},
@ -122,26 +122,27 @@
} }
}, },
{ {
"from": [-4, 7, -4], "from": [2, 7.5, 2],
"to": [20, 7, 20], "to": [14, 7.5, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"up": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"}, "up": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"},
"down": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"} "down": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"}
} }
}, },
{ {
"from": [-4, -5, -4], "from": [2, 1.5, 2],
"to": [20, -5, 20], "to": [14, 1.5, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]},
"faces": { "faces": {
"up": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"}, "up": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"},
"down": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"} "down": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"}
} }
}, },
{ {
"from": [6, 20, 6], "from": [7, 14, 7],
"to": [10, 21, 10], "to": [9, 14.5, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [4, 4, 4]},
"faces": { "faces": {
"north": {"uv": [6.5, 3.5, 7.5, 3.75], "texture": "#0"}, "north": {"uv": [6.5, 3.5, 7.5, 3.75], "texture": "#0"},
"east": {"uv": [6.5, 3.5, 7.5, 3.75], "texture": "#0"}, "east": {"uv": [6.5, 3.5, 7.5, 3.75], "texture": "#0"},
@ -194,15 +195,11 @@
"name": "group", "name": "group",
"origin": [8, 8, 8], "origin": [8, 8, 8],
"color": 0, "color": 0,
"nbt": "{}",
"armAnimationEnabled": false,
"children": [ "children": [
{ {
"name": "group", "name": "group",
"origin": [8, 8, 8], "origin": [8, 8, 8],
"color": 0, "color": 0,
"nbt": "{}",
"armAnimationEnabled": false,
"children": [0, 1, 2, 3] "children": [0, 1, 2, 3]
}, },
4, 4,

View file

@ -6,63 +6,63 @@
}, },
"elements": [ "elements": [
{ {
"from": [3, -1, 3], "from": [3, 7, 3],
"to": [13, 9, 13], "to": [13, 17, 13],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 8]}, "rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [5, 0, 10, 5], "rotation": 180, "texture": "#0", "tintindex": 1},
"east": {"uv": [5, 0, 10, 5], "rotation": 180, "texture": "#0", "tintindex": 1},
"south": {"uv": [5, 0, 10, 5], "rotation": 180, "texture": "#0", "tintindex": 1},
"west": {"uv": [5, 0, 10, 5], "rotation": 180, "texture": "#0", "tintindex": 1},
"up": {"uv": [0, 5, 5, 10], "texture": "#0", "tintindex": 1},
"down": {"uv": [0, 0, 5, 5], "texture": "#0", "tintindex": 1}
}
},
{
"from": [13, 9, 13],
"to": [3, -1, 3],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 8]},
"faces": { "faces": {
"north": {"uv": [5, 0, 10, 5], "texture": "#0", "tintindex": 1}, "north": {"uv": [5, 0, 10, 5], "texture": "#0", "tintindex": 1},
"east": {"uv": [5, 0, 10, 5], "texture": "#0", "tintindex": 1}, "east": {"uv": [5, 0, 10, 5], "texture": "#0", "tintindex": 1},
"south": {"uv": [5, 0, 10, 5], "texture": "#0", "tintindex": 1}, "south": {"uv": [5, 0, 10, 5], "texture": "#0", "tintindex": 1},
"west": {"uv": [5, 0, 10, 5], "texture": "#0", "tintindex": 1}, "west": {"uv": [5, 0, 10, 5], "texture": "#0", "tintindex": 1},
"up": {"uv": [0, 0, 5, 5], "texture": "#0", "tintindex": 1}, "up": {"uv": [0, 0, 5, 5], "rotation": 180, "texture": "#0", "tintindex": 1},
"down": {"uv": [0, 5, 5, 10], "texture": "#0", "tintindex": 1} "down": {"uv": [0, 5, 5, 10], "rotation": 180, "texture": "#0", "tintindex": 1}
}
},
{
"from": [13, 17, 13],
"to": [3, 7, 3],
"rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [5, 0, 10, 5], "rotation": 180, "texture": "#0", "tintindex": 1},
"east": {"uv": [5, 0, 10, 5], "rotation": 180, "texture": "#0", "tintindex": 1},
"south": {"uv": [5, 0, 10, 5], "rotation": 180, "texture": "#0", "tintindex": 1},
"west": {"uv": [5, 0, 10, 5], "rotation": 180, "texture": "#0", "tintindex": 1},
"up": {"uv": [0, 5, 5, 10], "rotation": 180, "texture": "#0", "tintindex": 1},
"down": {"uv": [0, 0, 5, 5], "rotation": 180, "texture": "#0", "tintindex": 1}
} }
}, },
{ {
"from": [3, 8, 3], "from": [3, 8, 3],
"to": [13, 8, 13], "to": [13, 8, 13],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 8]}, "rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]},
"faces": { "faces": {
"up": {"uv": [5, 5, 10, 10], "texture": "#0"}, "up": {"uv": [5, 5, 10, 10], "rotation": 180, "texture": "#0"},
"down": {"uv": [5, 5, 10, 10], "texture": "#0"} "down": {"uv": [5, 5, 10, 10], "rotation": 180, "texture": "#0"}
} }
}, },
{ {
"from": [6, 12, 6], "from": [6, 0, 6],
"to": [10, 16, 10], "to": [10, 4, 10],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 8]}, "rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]},
"faces": { "faces": {
"north": {"uv": [11, 2, 13, 4], "rotation": 180, "texture": "#0"}, "north": {"uv": [11, 2, 13, 4], "texture": "#0"},
"east": {"uv": [11, 2, 13, 4], "rotation": 180, "texture": "#0"}, "east": {"uv": [11, 2, 13, 4], "texture": "#0"},
"south": {"uv": [11, 2, 13, 4], "rotation": 180, "texture": "#0"}, "south": {"uv": [11, 2, 13, 4], "texture": "#0"},
"west": {"uv": [11, 2, 13, 4], "rotation": 180, "texture": "#0"}, "west": {"uv": [11, 2, 13, 4], "texture": "#0"},
"up": {"uv": [12, 3, 13, 3.5], "texture": "#0"}, "up": {"uv": [11, 0, 13, 2], "rotation": 180, "texture": "#0"},
"down": {"uv": [11, 0, 13, 2], "texture": "#0"} "down": {"uv": [12, 3, 13, 3.5], "rotation": 180, "texture": "#0"}
} }
}, },
{ {
"from": [7, 2, 7], "from": [7, 4, 7],
"to": [9, 12, 9], "to": [9, 14, 9],
"rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 8]}, "rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]},
"faces": { "faces": {
"north": {"uv": [10, 0, 11, 5], "rotation": 180, "texture": "#0"}, "north": {"uv": [10, 0, 11, 5], "texture": "#0"},
"east": {"uv": [10, 0, 11, 5], "rotation": 180, "texture": "#0"}, "east": {"uv": [10, 0, 11, 5], "texture": "#0"},
"south": {"uv": [10, 0, 11, 5], "rotation": 180, "texture": "#0"}, "south": {"uv": [10, 0, 11, 5], "texture": "#0"},
"west": {"uv": [10, 0, 11, 5], "rotation": 180, "texture": "#0"}, "west": {"uv": [10, 0, 11, 5], "texture": "#0"},
"down": {"uv": [10, 0, 11, 1], "texture": "#0"} "up": {"uv": [10, 0, 11, 1], "rotation": 180, "texture": "#0"}
} }
} }
], ],
@ -109,8 +109,6 @@
"name": "group", "name": "group",
"origin": [8, 8, 8], "origin": [8, 8, 8],
"color": 0, "color": 0,
"nbt": "{}",
"armAnimationEnabled": false,
"children": [0, 1, 2, 3, 4] "children": [0, 1, 2, 3, 4]
} }
] ]