From e3eeccfd60520da65b169a567dc27693491118fc Mon Sep 17 00:00:00 2001 From: Andrew-71 Date: Mon, 17 Jul 2023 21:48:00 +0300 Subject: [PATCH] Fix lamps --- .../su/a71/new_soviet/blocks/LampBlock.java | 24 +++++- .../new_soviet/models/block/ceiling_lamp.json | 81 +++++++++---------- .../new_soviet/models/block/table_lamp.json | 78 +++++++++--------- 3 files changed, 99 insertions(+), 84 deletions(-) diff --git a/src/main/java/su/a71/new_soviet/blocks/LampBlock.java b/src/main/java/su/a71/new_soviet/blocks/LampBlock.java index aee0202..0c59a76 100644 --- a/src/main/java/su/a71/new_soviet/blocks/LampBlock.java +++ b/src/main/java/su/a71/new_soviet/blocks/LampBlock.java @@ -83,10 +83,30 @@ public class LampBlock extends Block implements Waterloggable { 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 { HANGING = Properties.HANGING; 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)); - 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)); + STANDING_SHAPE = getStandingShape(); + HANGING_SHAPE = getHangingShape(); } } \ No newline at end of file diff --git a/src/main/resources/assets/new_soviet/models/block/ceiling_lamp.json b/src/main/resources/assets/new_soviet/models/block/ceiling_lamp.json index 34a3d90..f7a1822 100644 --- a/src/main/resources/assets/new_soviet/models/block/ceiling_lamp.json +++ b/src/main/resources/assets/new_soviet/models/block/ceiling_lamp.json @@ -6,9 +6,9 @@ }, "elements": [ { - "from": [13, -5.1, 13], - "to": [3, -15.1, 3], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [10.5, 1.45, 10.5], + "to": [5.5, -3.55, 5.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "north": {"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], - "to": [13, -5.1, 13], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [5.5, -3.55, 5.5], + "to": [10.5, 1.45, 10.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "north": {"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], - "to": [20, 6, 20], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [2, 1, 2], + "to": [14, 7, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "north": {"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], - "to": [-4, -6, -4], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [14, 7, 14], + "to": [2, 1, 2], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "north": {"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], - "to": [8, 20, 20], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [8, 8, 2], + "to": [8, 14, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "east": {"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], - "to": [20, 20, 8], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [2, 8, 8], + "to": [14, 14, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "north": {"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], - "to": [21, 8, -3], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [1.5, 7, 1.5], + "to": [14.5, 8, 2.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "north": {"uv": [6, 3, 12.5, 3.5], "texture": "#0"}, "east": {"uv": [6.5, 3, 6, 3.5], "texture": "#0"}, @@ -87,9 +87,9 @@ } }, { - "from": [-5, 6, 19], - "to": [21, 8, 21], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [1.5, 7, 13.5], + "to": [14.5, 8, 14.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "north": {"uv": [6, 3, 12.5, 3.5], "texture": "#0"}, "east": {"uv": [6, 3, 6.5, 3.5], "texture": "#0"}, @@ -100,9 +100,9 @@ } }, { - "from": [-5, 6, -3], - "to": [-3, 8, 19], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [1.5, 7, 2.5], + "to": [2.5, 8, 13.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "east": {"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], - "to": [21, 8, 19], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [13.5, 7, 2.5], + "to": [14.5, 8, 13.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "east": {"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], - "to": [20, 7, 20], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [2, 7.5, 2], + "to": [14, 7.5, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "up": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"}, "down": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"} } }, { - "from": [-4, -5, -4], - "to": [20, -5, 20], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]}, + "from": [2, 1.5, 2], + "to": [14, 1.5, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 8]}, "faces": { "up": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"}, "down": {"uv": [0, 6.25, 6, 12.25], "texture": "#0"} } }, { - "from": [6, 20, 6], - "to": [10, 21, 10], + "from": [7, 14, 7], + "to": [9, 14.5, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 4, 4]}, "faces": { "north": {"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", "origin": [8, 8, 8], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, "children": [ { "name": "group", "origin": [8, 8, 8], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, "children": [0, 1, 2, 3] }, 4, diff --git a/src/main/resources/assets/new_soviet/models/block/table_lamp.json b/src/main/resources/assets/new_soviet/models/block/table_lamp.json index 1e74a47..1ae4a6c 100644 --- a/src/main/resources/assets/new_soviet/models/block/table_lamp.json +++ b/src/main/resources/assets/new_soviet/models/block/table_lamp.json @@ -6,63 +6,63 @@ }, "elements": [ { - "from": [3, -1, 3], - "to": [13, 9, 13], - "rotation": {"angle": 0, "axis": "x", "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]}, + "from": [3, 7, 3], + "to": [13, 17, 13], + "rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]}, "faces": { "north": {"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}, "west": {"uv": [5, 0, 10, 5], "texture": "#0", "tintindex": 1}, - "up": {"uv": [0, 0, 5, 5], "texture": "#0", "tintindex": 1}, - "down": {"uv": [0, 5, 5, 10], "texture": "#0", "tintindex": 1} + "up": {"uv": [0, 0, 5, 5], "rotation": 180, "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], "to": [13, 8, 13], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 8]}, + "rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]}, "faces": { - "up": {"uv": [5, 5, 10, 10], "texture": "#0"}, - "down": {"uv": [5, 5, 10, 10], "texture": "#0"} + "up": {"uv": [5, 5, 10, 10], "rotation": 180, "texture": "#0"}, + "down": {"uv": [5, 5, 10, 10], "rotation": 180, "texture": "#0"} } }, { - "from": [6, 12, 6], - "to": [10, 16, 10], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 8]}, + "from": [6, 0, 6], + "to": [10, 4, 10], + "rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]}, "faces": { - "north": {"uv": [11, 2, 13, 4], "rotation": 180, "texture": "#0"}, - "east": {"uv": [11, 2, 13, 4], "rotation": 180, "texture": "#0"}, - "south": {"uv": [11, 2, 13, 4], "rotation": 180, "texture": "#0"}, - "west": {"uv": [11, 2, 13, 4], "rotation": 180, "texture": "#0"}, - "up": {"uv": [12, 3, 13, 3.5], "texture": "#0"}, - "down": {"uv": [11, 0, 13, 2], "texture": "#0"} + "north": {"uv": [11, 2, 13, 4], "texture": "#0"}, + "east": {"uv": [11, 2, 13, 4], "texture": "#0"}, + "south": {"uv": [11, 2, 13, 4], "texture": "#0"}, + "west": {"uv": [11, 2, 13, 4], "texture": "#0"}, + "up": {"uv": [11, 0, 13, 2], "rotation": 180, "texture": "#0"}, + "down": {"uv": [12, 3, 13, 3.5], "rotation": 180, "texture": "#0"} } }, { - "from": [7, 2, 7], - "to": [9, 12, 9], - "rotation": {"angle": 0, "axis": "x", "origin": [8, 8, 8]}, + "from": [7, 4, 7], + "to": [9, 14, 9], + "rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]}, "faces": { - "north": {"uv": [10, 0, 11, 5], "rotation": 180, "texture": "#0"}, - "east": {"uv": [10, 0, 11, 5], "rotation": 180, "texture": "#0"}, - "south": {"uv": [10, 0, 11, 5], "rotation": 180, "texture": "#0"}, - "west": {"uv": [10, 0, 11, 5], "rotation": 180, "texture": "#0"}, - "down": {"uv": [10, 0, 11, 1], "texture": "#0"} + "north": {"uv": [10, 0, 11, 5], "texture": "#0"}, + "east": {"uv": [10, 0, 11, 5], "texture": "#0"}, + "south": {"uv": [10, 0, 11, 5], "texture": "#0"}, + "west": {"uv": [10, 0, 11, 5], "texture": "#0"}, + "up": {"uv": [10, 0, 11, 1], "rotation": 180, "texture": "#0"} } } ], @@ -109,8 +109,6 @@ "name": "group", "origin": [8, 8, 8], "color": 0, - "nbt": "{}", - "armAnimationEnabled": false, "children": [0, 1, 2, 3, 4] } ]