diff --git a/Common/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/FakeDigitalInterfaceTileEntity.java b/Common/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/FakeDigitalInterfaceTileEntity.java deleted file mode 100644 index bcfe79d..0000000 --- a/Common/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/FakeDigitalInterfaceTileEntity.java +++ /dev/null @@ -1,24 +0,0 @@ -package su.a71.tardim_ic.tardim_ic.digital_interface; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.Level; - -public class FakeDigitalInterfaceTileEntity implements IDigitalInterfaceEntity { - public BlockPos blockPos; - public Level level; - - FakeDigitalInterfaceTileEntity(BlockPos in_block, Level in_level) { - this.blockPos = in_block; - this.level = in_level; - } - - @Override - public BlockPos getPos() { - return this.blockPos; - } - - @Override - public Level getLevel() { - return this.level; - } -} diff --git a/Common/src/main/resources/assets/tardim_ic/blockstates/tardim_door_soviet.json b/Common/src/main/resources/assets/tardim_ic/blockstates/tardim_door_soviet.json new file mode 100644 index 0000000..efab0e8 --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/blockstates/tardim_door_soviet.json @@ -0,0 +1,124 @@ +{ + "variants": { + "facing=north,half=lower,open=false,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_bottom" + }, + "facing=north,half=lower,open=false,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_bottom_closed" + }, + "facing=north,half=upper,open=false,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_top" + }, + "facing=north,half=upper,open=false,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_top_front_closed" + }, + "facing=west,half=lower,open=false,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_bottom", + "y": 270 + }, + "facing=west,half=lower,open=false,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_bottom_closed", + "y": 270 + }, + "facing=west,half=upper,open=false,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_top", + "y": 270 + }, + "facing=west,half=upper,open=false,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_top_front_closed", + "y": 270 + }, + "facing=east,half=lower,open=false,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_bottom", + "y": 90 + }, + "facing=east,half=lower,open=false,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_bottom_closed", + "y": 90 + }, + "facing=east,half=upper,open=false,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_top", + "y": 90 + }, + "facing=east,half=upper,open=false,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_top_front_closed", + "y": 90 + }, + "facing=south,half=lower,open=false,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_bottom", + "y": 180 + }, + "facing=south,half=lower,open=false,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_bottom_closed", + "y": 180 + }, + "facing=south,half=upper,open=false,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_top", + "y": 180 + }, + "facing=south,half=upper,open=false,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_top_front_closed", + "y": 180 + }, + "facing=north,half=lower,open=true,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_bottom" + }, + "facing=north,half=lower,open=true,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_bottom_open" + }, + "facing=north,half=upper,open=true,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_top" + }, + "facing=north,half=upper,open=true,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_top_front_open" + }, + "facing=west,half=lower,open=true,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_bottom", + "y": 270 + }, + "facing=west,half=lower,open=true,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_bottom_open", + "y": 270 + }, + "facing=west,half=upper,open=true,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_top", + "y": 270 + }, + "facing=west,half=upper,open=true,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_top_front_open", + "y": 270 + }, + "facing=east,half=lower,open=true,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_bottom", + "y": 90 + }, + "facing=east,half=lower,open=true,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_bottom_open", + "y": 90 + }, + "facing=east,half=upper,open=true,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_top", + "y": 90 + }, + "facing=east,half=upper,open=true,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_top_front_open", + "y": 90 + }, + "facing=south,half=lower,open=true,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_bottom", + "y": 180 + }, + "facing=south,half=lower,open=true,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_bottom_open", + "y": 180 + }, + "facing=south,half=upper,open=true,front=false": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_sides_top", + "y": 180 + }, + "facing=south,half=upper,open=true,front=true": { + "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_door_top_front_open", + "y": 180 + } + } +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/tardim_ic/blockstates/tardim_floor_soviet.json b/Common/src/main/resources/assets/tardim_ic/blockstates/tardim_floor_soviet.json new file mode 100644 index 0000000..2363709 --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/blockstates/tardim_floor_soviet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_floor" } + } +} diff --git a/Common/src/main/resources/assets/tardim_ic/blockstates/tardim_roof_soviet.json b/Common/src/main/resources/assets/tardim_ic/blockstates/tardim_roof_soviet.json new file mode 100644 index 0000000..9adda15 --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/blockstates/tardim_roof_soviet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_roof" } + } +} diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/digital_tardim_interface.json b/Common/src/main/resources/assets/tardim_ic/models/block/digital_tardim_interface.json index d5fccbf..d0300c3 100644 --- a/Common/src/main/resources/assets/tardim_ic/models/block/digital_tardim_interface.json +++ b/Common/src/main/resources/assets/tardim_ic/models/block/digital_tardim_interface.json @@ -1,5 +1,5 @@ { - "credit": "Made with Blockbench", + "credit": "Made by karoter2 with Blockbench", "parent": "digital_tardim_interface", "texture_size": [64, 64], "textures": { diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/redstone_tardim_input.json b/Common/src/main/resources/assets/tardim_ic/models/block/redstone_tardim_input.json index a133d12..ac65f2f 100644 --- a/Common/src/main/resources/assets/tardim_ic/models/block/redstone_tardim_input.json +++ b/Common/src/main/resources/assets/tardim_ic/models/block/redstone_tardim_input.json @@ -1,5 +1,5 @@ { - "credit": "Made with Blockbench", + "credit": "Made by karoter2 with Blockbench", "parent": "block/cube_all", "ambientocclusion": false, "textures": { diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_dock.json b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_dock.json index bc13bb6..3ae2da8 100644 --- a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_dock.json +++ b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_dock.json @@ -1,5 +1,5 @@ { - "credit": "Made with Blockbench", + "credit": "Made by karoter2 with Blockbench", "texture_size": [64, 64], "textures": { "1": "tardim_ic:blocks/tardim_dock", diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_bottom_closed.json b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_bottom_closed.json new file mode 100644 index 0000000..5897e27 --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_bottom_closed.json @@ -0,0 +1,279 @@ +{ + "credit": "Made by karoter2", + "texture_size": [64, 64], + "textures": { + "0": "tardim_ic:blocks/tardim_soviet_chronobox", + "particle": "tardim_ic:blocks/tardim_soviet_chronobox" + }, + "elements": [ + { + "from": [13, 0, 0], + "to": [15, 32, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [12.5, 0, 13, 8], "texture": "#0"}, + "east": {"uv": [12.5, 0, 12.75, 8], "texture": "#0"}, + "south": {"uv": [12.5, 0, 13, 8], "texture": "#0"}, + "west": {"uv": [12.75, 0, 13, 8], "texture": "#0"}, + "up": {"uv": [12.5, 0, 13, 0.25], "rotation": 90, "texture": "#0"}, + "down": {"uv": [12.5, 7.75, 13, 8], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [3, 0, 0], + "to": [13, 2, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [13, 7.5, 15.5, 8], "texture": "#0"}, + "east": {"uv": [15.25, 7.5, 15.5, 8], "texture": "#0"}, + "south": {"uv": [13, 7.5, 15.5, 8], "texture": "#0"}, + "west": {"uv": [15.75, 7.5, 16, 8], "texture": "#0"}, + "up": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [3, 15, 0], + "to": [13, 17, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [13, 3.75, 15.5, 4.25], "texture": "#0"}, + "east": {"uv": [15.25, 7.5, 15.5, 8], "texture": "#0"}, + "south": {"uv": [13, 3.75, 15.5, 4.25], "texture": "#0"}, + "west": {"uv": [15.75, 7.5, 16, 8], "texture": "#0"}, + "up": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [3, 17, 0], + "to": [13, 30, 0], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "east": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "south": {"uv": [12.5, 0, 10, 3.25], "texture": "#0"}, + "west": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "up": {"uv": [10, 0, 12.5, 3.25], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 12.5, 3.25], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [3, 17, -16], + "to": [13, 30, -16], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [10, 3.25, 12.5, 6.5], "texture": "#0"}, + "east": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "south": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#0"}, + "west": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "up": {"uv": [10, 0, 12.5, 3.25], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 12.5, 3.25], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [0, 17, -13], + "to": [0, 30, -3], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "east": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "south": {"uv": [12.5, 0, 10, 3.25], "texture": "#0"}, + "west": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "up": {"uv": [10, 0, 12.5, 3.25], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 12.5, 3.25], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [16, 17, -13], + "to": [16, 30, -3], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "east": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "south": {"uv": [12.5, 0, 10, 3.25], "texture": "#0"}, + "west": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "up": {"uv": [10, 0, 12.5, 3.25], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 12.5, 3.25], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [7, 18, 0.425], + "to": [9, 20, 0.425], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [9.25, 1, 8.75, 1.5], "texture": "#0"}, + "east": {"uv": [9.25, 1, 8.75, 1.5], "texture": "#0"}, + "south": {"uv": [9.25, 1, 8.75, 1.5], "texture": "#0"}, + "west": {"uv": [9.25, 1, 8.75, 1.5], "texture": "#0"}, + "up": {"uv": [9.25, 1, 8.75, 1.5], "texture": "#0"}, + "down": {"uv": [9.25, 1, 8.75, 1.5], "texture": "#0"} + } + }, + { + "from": [6, 19, 0.425], + "to": [7, 20, 0.425], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [8.75, 1, 8.5, 1.25], "texture": "#0"}, + "east": {"uv": [8.75, 1, 8.5, 1.25], "texture": "#0"}, + "south": {"uv": [8.75, 1, 8.5, 1.25], "texture": "#0"}, + "west": {"uv": [8.75, 1, 8.5, 1.25], "texture": "#0"}, + "up": {"uv": [8.75, 1, 8.5, 1.25], "texture": "#0"}, + "down": {"uv": [8.75, 1, 8.5, 1.25], "texture": "#0"} + } + }, + { + "from": [9, 19, 0.425], + "to": [10, 20, 0.425], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [9.5, 1, 9.25, 1.25], "texture": "#0"}, + "east": {"uv": [9.5, 1, 9.25, 1.25], "texture": "#0"}, + "south": {"uv": [9.5, 1, 9.25, 1.25], "texture": "#0"}, + "west": {"uv": [9.5, 1, 9.25, 1.25], "texture": "#0"}, + "up": {"uv": [9.5, 1, 9.25, 1.25], "texture": "#0"}, + "down": {"uv": [9.5, 1, 9.25, 1.25], "texture": "#0"} + } + }, + { + "from": [11, 20, 0.425], + "to": [12, 22, 0.425], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [10, 0.5, 9.75, 1], "texture": "#0"}, + "east": {"uv": [10, 0.5, 9.75, 1], "texture": "#0"}, + "south": {"uv": [10, 0.5, 9.75, 1], "texture": "#0"}, + "west": {"uv": [10, 0.5, 9.75, 1], "texture": "#0"}, + "up": {"uv": [10, 0.5, 9.75, 1], "texture": "#0"}, + "down": {"uv": [10, 0.5, 9.75, 1], "texture": "#0"} + } + }, + { + "from": [4, 20, 0.425], + "to": [5, 22, 0.425], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [8.25, 0.5, 8, 1], "texture": "#0"}, + "east": {"uv": [8.25, 0.5, 8, 1], "texture": "#0"}, + "south": {"uv": [8.25, 0.5, 8, 1], "texture": "#0"}, + "west": {"uv": [8.25, 0.5, 8, 1], "texture": "#0"}, + "up": {"uv": [8.25, 0.5, 8, 1], "texture": "#0"}, + "down": {"uv": [8.25, 0.5, 8, 1], "texture": "#0"} + } + }, + { + "from": [5, 21, 0.425], + "to": [6, 22, 0.425], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [8.5, 0.5, 8.25, 0.75], "texture": "#0"}, + "east": {"uv": [8.5, 0.5, 8.25, 0.75], "texture": "#0"}, + "south": {"uv": [8.5, 0.5, 8.25, 0.75], "texture": "#0"}, + "west": {"uv": [8.5, 0.5, 8.25, 0.75], "texture": "#0"}, + "up": {"uv": [8.5, 0.5, 8.25, 0.75], "texture": "#0"}, + "down": {"uv": [8.5, 0.5, 8.25, 0.75], "texture": "#0"} + } + }, + { + "from": [5, 22, 0.425], + "to": [11, 23, 0.425], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [9.75, 0.25, 8.25, 0.5], "texture": "#0"}, + "east": {"uv": [9.75, 0.25, 8.25, 0.5], "texture": "#0"}, + "south": {"uv": [9.75, 0.25, 8.25, 0.5], "texture": "#0"}, + "west": {"uv": [9.75, 0.25, 8.25, 0.5], "texture": "#0"}, + "up": {"uv": [9.75, 0.25, 8.25, 0.5], "texture": "#0"}, + "down": {"uv": [9.75, 0.25, 8.25, 0.5], "texture": "#0"} + } + }, + { + "from": [7, 23, 0.425], + "to": [9, 24, 0.425], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [9.25, 0, 8.75, 0.25], "texture": "#0"}, + "east": {"uv": [9.25, 0, 8.75, 0.25], "texture": "#0"}, + "south": {"uv": [9.25, 0, 8.75, 0.25], "texture": "#0"}, + "west": {"uv": [9.25, 0, 8.75, 0.25], "texture": "#0"}, + "up": {"uv": [9.25, 0, 8.75, 0.25], "texture": "#0"}, + "down": {"uv": [9.25, 0, 8.75, 0.25], "texture": "#0"} + } + }, + { + "from": [10, 21, 0.425], + "to": [11, 22, 0.425], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [9.75, 0.5, 9.5, 0.75], "texture": "#0"}, + "east": {"uv": [9.75, 0.5, 9.5, 0.75], "texture": "#0"}, + "south": {"uv": [9.75, 0.5, 9.5, 0.75], "texture": "#0"}, + "west": {"uv": [9.75, 0.5, 9.5, 0.75], "texture": "#0"}, + "up": {"uv": [9.75, 0.5, 9.5, 0.75], "texture": "#0"}, + "down": {"uv": [9.75, 0.5, 9.5, 0.75], "texture": "#0"} + } + }, + { + "from": [3, 2, 0], + "to": [13, 15, 0], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#0"}, + "east": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#0"}, + "south": {"uv": [10, 3.25, 12.5, 6.5], "texture": "#0"}, + "west": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#0"}, + "up": {"uv": [12.5, 3.25, 10, 6.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [12.5, 3.25, 10, 6.5], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [3, 30, 0], + "to": [13, 32, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [13, 0, 15.5, 0.5], "texture": "#0"}, + "east": {"uv": [15.25, 7.5, 15.5, 8], "texture": "#0"}, + "south": {"uv": [13, 0, 15.5, 0.5], "texture": "#0"}, + "west": {"uv": [15.75, 7.5, 16, 8], "texture": "#0"}, + "up": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [1, 0, 0], + "to": [3, 32, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [15.5, 0, 16, 8], "texture": "#0"}, + "east": {"uv": [15.5, 0, 15.75, 8], "texture": "#0"}, + "south": {"uv": [15.5, 0, 16, 8], "texture": "#0"}, + "west": {"uv": [15.75, 0, 16, 8], "texture": "#0"}, + "up": {"uv": [15.5, 0, 16, 0.25], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15.5, 7.75, 16, 8], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [2, 15.5, 0.5], + "to": [5, 16.5, 1.5], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [7.25, 0, 8, 0.25], "texture": "#0"}, + "east": {"uv": [7, 0.5, 7.25, 0.75], "texture": "#0"}, + "south": {"uv": [7.25, 0, 8, 0.25], "texture": "#0"}, + "west": {"uv": [7.25, 0, 7.5, 0.25], "texture": "#0"}, + "up": {"uv": [7.25, 0, 8, 0.25], "texture": "#0"}, + "down": {"uv": [7.25, 0, 8, 0.25], "texture": "#0"} + } + } + ], + "groups": [ + { + "name": "group", + "origin": [0, 0, 0], + "color": 0, + "nbt": "{}", + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_bottom_open.json b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_bottom_open.json new file mode 100644 index 0000000..cbe3454 --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_bottom_open.json @@ -0,0 +1,279 @@ +{ + "credit": "Made by karoter2", + "texture_size": [64, 64], + "textures": { + "0": "tardim_ic:blocks/tardim_soviet_chronobox", + "particle": "tardim_ic:blocks/tardim_soviet_chronobox" + }, + "elements": [ + { + "from": [14, 0, 1], + "to": [15, 32, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [12.5, 0, 12.75, 8], "texture": "#0"}, + "east": {"uv": [12.5, 0, 13, 8], "texture": "#0"}, + "south": {"uv": [12.75, 0, 13, 8], "texture": "#0"}, + "west": {"uv": [12.5, 0, 13, 8], "texture": "#0"}, + "up": {"uv": [12.5, 0, 13, 0.25], "texture": "#0"}, + "down": {"uv": [12.5, 7.75, 13, 8], "texture": "#0"} + } + }, + { + "from": [14, 0, 3], + "to": [15, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [15.25, 7.5, 15.5, 8], "texture": "#0"}, + "east": {"uv": [13, 7.5, 15.5, 8], "texture": "#0"}, + "south": {"uv": [15.75, 7.5, 16, 8], "texture": "#0"}, + "west": {"uv": [13, 7.5, 15.5, 8], "texture": "#0"}, + "up": {"uv": [15.75, 5.25, 16, 7.75], "texture": "#0"}, + "down": {"uv": [15.75, 5.25, 16, 7.75], "texture": "#0"} + } + }, + { + "from": [14, 15, 3], + "to": [15, 17, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [15.25, 7.5, 15.5, 8], "texture": "#0"}, + "east": {"uv": [13, 3.75, 15.5, 4.25], "texture": "#0"}, + "south": {"uv": [15.75, 7.5, 16, 8], "texture": "#0"}, + "west": {"uv": [13, 3.75, 15.5, 4.25], "texture": "#0"}, + "up": {"uv": [15.75, 5.25, 16, 7.75], "texture": "#0"}, + "down": {"uv": [15.75, 5.25, 16, 7.75], "texture": "#0"} + } + }, + { + "from": [14, 17, 3], + "to": [14, 30, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "east": {"uv": [12.5, 0, 10, 3.25], "texture": "#0"}, + "south": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "west": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "up": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "down": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"} + } + }, + { + "from": [14.425, 18, 7], + "to": [14.425, 20, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [9.25, 1, 8.75, 1.5], "texture": "#0"}, + "east": {"uv": [9.25, 1, 8.75, 1.5], "texture": "#0"}, + "south": {"uv": [9.25, 1, 8.75, 1.5], "texture": "#0"}, + "west": {"uv": [9.25, 1, 8.75, 1.5], "texture": "#0"}, + "up": {"uv": [9.25, 1, 8.75, 1.5], "rotation": 270, "texture": "#0"}, + "down": {"uv": [9.25, 1, 8.75, 1.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [14.425, 19, 9], + "to": [14.425, 20, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [8.75, 1, 8.5, 1.25], "texture": "#0"}, + "east": {"uv": [8.75, 1, 8.5, 1.25], "texture": "#0"}, + "south": {"uv": [8.75, 1, 8.5, 1.25], "texture": "#0"}, + "west": {"uv": [8.75, 1, 8.5, 1.25], "texture": "#0"}, + "up": {"uv": [8.75, 1, 8.5, 1.25], "rotation": 270, "texture": "#0"}, + "down": {"uv": [8.75, 1, 8.5, 1.25], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [14.425, 19, 6], + "to": [14.425, 20, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [9.5, 1, 9.25, 1.25], "texture": "#0"}, + "east": {"uv": [9.5, 1, 9.25, 1.25], "texture": "#0"}, + "south": {"uv": [9.5, 1, 9.25, 1.25], "texture": "#0"}, + "west": {"uv": [9.5, 1, 9.25, 1.25], "texture": "#0"}, + "up": {"uv": [9.5, 1, 9.25, 1.25], "rotation": 270, "texture": "#0"}, + "down": {"uv": [9.5, 1, 9.25, 1.25], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [14.425, 20, 4], + "to": [14.425, 22, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [10, 0.5, 9.75, 1], "texture": "#0"}, + "east": {"uv": [10, 0.5, 9.75, 1], "texture": "#0"}, + "south": {"uv": [10, 0.5, 9.75, 1], "texture": "#0"}, + "west": {"uv": [10, 0.5, 9.75, 1], "texture": "#0"}, + "up": {"uv": [10, 0.5, 9.75, 1], "rotation": 270, "texture": "#0"}, + "down": {"uv": [10, 0.5, 9.75, 1], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [14.425, 20, 11], + "to": [14.425, 22, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [8.25, 0.5, 8, 1], "texture": "#0"}, + "east": {"uv": [8.25, 0.5, 8, 1], "texture": "#0"}, + "south": {"uv": [8.25, 0.5, 8, 1], "texture": "#0"}, + "west": {"uv": [8.25, 0.5, 8, 1], "texture": "#0"}, + "up": {"uv": [8.25, 0.5, 8, 1], "rotation": 270, "texture": "#0"}, + "down": {"uv": [8.25, 0.5, 8, 1], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [14.425, 21, 10], + "to": [14.425, 22, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [8.5, 0.5, 8.25, 0.75], "texture": "#0"}, + "east": {"uv": [8.5, 0.5, 8.25, 0.75], "texture": "#0"}, + "south": {"uv": [8.5, 0.5, 8.25, 0.75], "texture": "#0"}, + "west": {"uv": [8.5, 0.5, 8.25, 0.75], "texture": "#0"}, + "up": {"uv": [8.5, 0.5, 8.25, 0.75], "rotation": 270, "texture": "#0"}, + "down": {"uv": [8.5, 0.5, 8.25, 0.75], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [14.425, 22, 5], + "to": [14.425, 23, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [9.75, 0.25, 8.25, 0.5], "texture": "#0"}, + "east": {"uv": [9.75, 0.25, 8.25, 0.5], "texture": "#0"}, + "south": {"uv": [9.75, 0.25, 8.25, 0.5], "texture": "#0"}, + "west": {"uv": [9.75, 0.25, 8.25, 0.5], "texture": "#0"}, + "up": {"uv": [9.75, 0.25, 8.25, 0.5], "rotation": 270, "texture": "#0"}, + "down": {"uv": [9.75, 0.25, 8.25, 0.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [14.425, 23, 7], + "to": [14.425, 24, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [9.25, 0, 8.75, 0.25], "texture": "#0"}, + "east": {"uv": [9.25, 0, 8.75, 0.25], "texture": "#0"}, + "south": {"uv": [9.25, 0, 8.75, 0.25], "texture": "#0"}, + "west": {"uv": [9.25, 0, 8.75, 0.25], "texture": "#0"}, + "up": {"uv": [9.25, 0, 8.75, 0.25], "rotation": 270, "texture": "#0"}, + "down": {"uv": [9.25, 0, 8.75, 0.25], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [14.425, 21, 5], + "to": [14.425, 22, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [9.75, 0.5, 9.5, 0.75], "texture": "#0"}, + "east": {"uv": [9.75, 0.5, 9.5, 0.75], "texture": "#0"}, + "south": {"uv": [9.75, 0.5, 9.5, 0.75], "texture": "#0"}, + "west": {"uv": [9.75, 0.5, 9.5, 0.75], "texture": "#0"}, + "up": {"uv": [9.75, 0.5, 9.5, 0.75], "rotation": 270, "texture": "#0"}, + "down": {"uv": [9.75, 0.5, 9.5, 0.75], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [14, 2, 3], + "to": [14, 15, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#0"}, + "east": {"uv": [10, 3.25, 12.5, 6.5], "texture": "#0"}, + "south": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#0"}, + "west": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#0"}, + "up": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#0"}, + "down": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#0"} + } + }, + { + "from": [14, 30, 3], + "to": [15, 32, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [15.25, 7.5, 15.5, 8], "texture": "#0"}, + "east": {"uv": [13, 0, 15.5, 0.5], "texture": "#0"}, + "south": {"uv": [15.75, 7.5, 16, 8], "texture": "#0"}, + "west": {"uv": [13, 0, 15.5, 0.5], "texture": "#0"}, + "up": {"uv": [15.75, 5.25, 16, 7.75], "texture": "#0"}, + "down": {"uv": [15.75, 5.25, 16, 7.75], "texture": "#0"} + } + }, + { + "from": [14, 0, 13], + "to": [15, 32, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [15.5, 0, 15.75, 8], "texture": "#0"}, + "east": {"uv": [15.5, 0, 16, 8], "texture": "#0"}, + "south": {"uv": [15.75, 0, 16, 8], "texture": "#0"}, + "west": {"uv": [15.5, 0, 16, 8], "texture": "#0"}, + "up": {"uv": [15.5, 0, 16, 0.25], "texture": "#0"}, + "down": {"uv": [15.5, 7.75, 16, 8], "texture": "#0"} + } + }, + { + "from": [14.5, 15.5, 11], + "to": [15.5, 16.5, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [7, 0.5, 7.25, 0.75], "texture": "#0"}, + "east": {"uv": [7.25, 0, 8, 0.25], "texture": "#0"}, + "south": {"uv": [7.25, 0, 7.5, 0.25], "texture": "#0"}, + "west": {"uv": [7.25, 0, 8, 0.25], "texture": "#0"}, + "up": {"uv": [7.25, 0, 8, 0.25], "rotation": 270, "texture": "#0"}, + "down": {"uv": [7.25, 0, 8, 0.25], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [16, 17, -13], + "to": [16, 30, -3], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "east": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "south": {"uv": [12.5, 0, 10, 3.25], "texture": "#0"}, + "west": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "up": {"uv": [10, 0, 12.5, 3.25], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 12.5, 3.25], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [0, 17, -13], + "to": [0, 30, -3], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "east": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "south": {"uv": [12.5, 0, 10, 3.25], "texture": "#0"}, + "west": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "up": {"uv": [10, 0, 12.5, 3.25], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 12.5, 3.25], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [3, 17, -16], + "to": [13, 30, -16], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "north": {"uv": [10, 3.25, 12.5, 6.5], "texture": "#0"}, + "east": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "south": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#0"}, + "west": {"uv": [10, 0, 12.5, 3.25], "texture": "#0"}, + "up": {"uv": [10, 0, 12.5, 3.25], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 12.5, 3.25], "rotation": 270, "texture": "#0"} + } + } + ], + "groups": [ + { + "name": "group", + "origin": [0, 0, 0], + "color": 0, + "nbt": "{}", + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_sides.json b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_sides.json new file mode 100644 index 0000000..5ea61b2 --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_sides.json @@ -0,0 +1,16 @@ +{ + "credit": "Made by karoter2", + "texture_size": [64, 64], + "textures": { + "particle": "tardim:block/tardim_tt" + }, + "groups": [ + { + "name": "group", + "origin": [0, 0, 0], + "color": 0, + "nbt": "{}", + "children": [] + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_sides_bottom.json b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_sides_bottom.json new file mode 100644 index 0000000..5006320 --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_sides_bottom.json @@ -0,0 +1,97 @@ +{ + "credit": "Made by karoter2", + "texture_size": [64, 64], + "textures": { + "1": "tardim_ic:blocks/tardim_soviet_chronobox", + "particle": "tardim:block/tardim_tt" + }, + "elements": [ + { + "from": [1, 0, 0], + "to": [3, 32, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [12.5, 0, 13, 8], "texture": "#1"}, + "east": {"uv": [12.75, 0, 13, 8], "texture": "#1"}, + "south": {"uv": [12.5, 0, 13, 8], "texture": "#1"}, + "west": {"uv": [12.5, 0, 12.75, 8], "texture": "#1"}, + "up": {"uv": [12.5, 0, 13, 0.25], "rotation": 270, "texture": "#1"}, + "down": {"uv": [12.5, 7.75, 13, 8], "rotation": 90, "texture": "#1"} + } + }, + { + "from": [3, 0, 0], + "to": [13, 2, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [13, 7.5, 15.5, 8], "texture": "#1"}, + "east": {"uv": [15.75, 7.5, 16, 8], "texture": "#1"}, + "south": {"uv": [13, 7.5, 15.5, 8], "texture": "#1"}, + "west": {"uv": [15.25, 7.5, 15.5, 8], "texture": "#1"}, + "up": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 270, "texture": "#1"}, + "down": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 90, "texture": "#1"} + } + }, + { + "from": [3, 15, 0], + "to": [13, 17, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [13, 3.75, 15.5, 4.25], "texture": "#1"}, + "east": {"uv": [15.75, 7.5, 16, 8], "texture": "#1"}, + "south": {"uv": [13, 3.75, 15.5, 4.25], "texture": "#1"}, + "west": {"uv": [15.25, 7.5, 15.5, 8], "texture": "#1"}, + "up": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 270, "texture": "#1"}, + "down": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 90, "texture": "#1"} + } + }, + { + "from": [3, 2, 0], + "to": [13, 15, 0], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [10, 3.25, 12.5, 6.5], "texture": "#1"}, + "east": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#1"}, + "south": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#1"}, + "west": {"uv": [12.5, 3.25, 10, 6.5], "texture": "#1"}, + "up": {"uv": [12.5, 3.25, 10, 6.5], "rotation": 270, "texture": "#1"}, + "down": {"uv": [12.5, 3.25, 10, 6.5], "rotation": 90, "texture": "#1"} + } + }, + { + "from": [3, 30, 0], + "to": [13, 32, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [13, 0, 15.5, 0.5], "texture": "#1"}, + "east": {"uv": [15.75, 7.5, 16, 8], "texture": "#1"}, + "south": {"uv": [13, 0, 15.5, 0.5], "texture": "#1"}, + "west": {"uv": [15.25, 7.5, 15.5, 8], "texture": "#1"}, + "up": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 270, "texture": "#1"}, + "down": {"uv": [15.75, 5.25, 16, 7.75], "rotation": 90, "texture": "#1"} + } + }, + { + "from": [13, 0, 0], + "to": [15, 32, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [15.5, 0, 16, 8], "texture": "#1"}, + "east": {"uv": [15.75, 0, 16, 8], "texture": "#1"}, + "south": {"uv": [15.5, 0, 16, 8], "texture": "#1"}, + "west": {"uv": [15.5, 0, 15.75, 8], "texture": "#1"}, + "up": {"uv": [15.5, 0, 16, 0.25], "rotation": 270, "texture": "#1"}, + "down": {"uv": [15.5, 7.75, 16, 8], "rotation": 90, "texture": "#1"} + } + } + ], + "groups": [ + { + "name": "group", + "origin": [0, 0, 0], + "color": 0, + "nbt": "{}", + "children": [0, 1, 2, 3, 4, 5] + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_sides_top.json b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_sides_top.json new file mode 100644 index 0000000..b9980a8 --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_sides_top.json @@ -0,0 +1,13 @@ +{ + "credit": "Made by karoter2", + "texture_size": [64, 64], + "groups": [ + { + "name": "group", + "origin": [0, 0, 0], + "color": 0, + "nbt": "{}", + "children": [] + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_top_front_closed.json b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_top_front_closed.json new file mode 100644 index 0000000..1ad61f0 --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_top_front_closed.json @@ -0,0 +1,22 @@ +{ + "credit": "Made by karoter2", + "texture_size": [64, 64], + "textures": { + "0": "tardim_ic:blocks/tardim_soviet_chronobox", + "particle": "tardim_ic:blocks/tardim_soviet_chronobox" + }, + "elements": [ + { + "from": [-4, 16, 4.15], + "to": [20, 24, 4.15], + "faces": { + "north": {"uv": [0, 2, 6, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [0, 2, 6, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [0, 0, 6, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 6, 0], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_top_front_open.json b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_top_front_open.json new file mode 100644 index 0000000..1ad61f0 --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_door_top_front_open.json @@ -0,0 +1,22 @@ +{ + "credit": "Made by karoter2", + "texture_size": [64, 64], + "textures": { + "0": "tardim_ic:blocks/tardim_soviet_chronobox", + "particle": "tardim_ic:blocks/tardim_soviet_chronobox" + }, + "elements": [ + { + "from": [-4, 16, 4.15], + "to": [20, 24, 4.15], + "faces": { + "north": {"uv": [0, 2, 6, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [0, 2, 6, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [0, 0, 6, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 6, 0], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_floor.json b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_floor.json new file mode 100644 index 0000000..742139d --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_floor.json @@ -0,0 +1,73 @@ +{ + "credit": "Made by karoter2", + "texture_size": [64, 64], + "textures": { + "1": "tardim_ic:blocks/tardim_soviet_chronobox", + "particle": "tardim_ic:blocks/tardim_soviet_chronobox" + }, + "elements": [ + { + "from": [0, 0.1, 0], + "to": [16, 0.1, 16], + "faces": { + "north": {"uv": [1.5, 15.75, 5.5, 16], "texture": "#1"}, + "east": {"uv": [1.75, 15.75, 5.75, 16], "texture": "#1"}, + "south": {"uv": [1.5, 15.75, 5.5, 16], "texture": "#1"}, + "west": {"uv": [1.75, 15.75, 5.75, 16], "texture": "#1"}, + "up": {"uv": [12, 8, 16, 12], "texture": "#1"}, + "down": {"uv": [12, 8, 16, 12], "texture": "#1"} + } + }, + { + "from": [-2, 0, -2], + "to": [1, 32, 1], + "faces": { + "north": {"uv": [11.25, 16, 12, 8], "texture": "#1"}, + "east": {"uv": [11.25, 16, 12, 8], "texture": "#1"}, + "south": {"uv": [11.25, 16, 12, 8], "texture": "#1"}, + "west": {"uv": [11.25, 16, 12, 8], "texture": "#1"}, + "up": {"uv": [11.25, 8.75, 12, 8], "texture": "#1"}, + "down": {"uv": [11.25, 16, 12, 15.25], "texture": "#1"} + } + }, + { + "from": [-2, 0, 15], + "to": [1, 32, 18], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 16]}, + "faces": { + "north": {"uv": [12, 16, 11.25, 8], "texture": "#1"}, + "east": {"uv": [12, 16, 11.25, 8], "texture": "#1"}, + "south": {"uv": [12, 16, 11.25, 8], "texture": "#1"}, + "west": {"uv": [12, 16, 11.25, 8], "texture": "#1"}, + "up": {"uv": [11.25, 8, 12, 8.75], "texture": "#1"}, + "down": {"uv": [11.25, 15.25, 12, 16], "texture": "#1"} + } + }, + { + "from": [15, 0, -2], + "to": [18, 32, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, + "faces": { + "north": {"uv": [12, 16, 11.25, 8], "texture": "#1"}, + "east": {"uv": [12, 16, 11.25, 8], "texture": "#1"}, + "south": {"uv": [12, 16, 11.25, 8], "texture": "#1"}, + "west": {"uv": [12, 16, 11.25, 8], "texture": "#1"}, + "up": {"uv": [12, 8.75, 11.25, 8], "texture": "#1"}, + "down": {"uv": [12, 16, 11.25, 15.25], "texture": "#1"} + } + }, + { + "from": [15, 0, 15], + "to": [18, 32, 18], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 16]}, + "faces": { + "north": {"uv": [11.25, 16, 12, 8], "texture": "#1"}, + "east": {"uv": [11.25, 16, 12, 8], "texture": "#1"}, + "south": {"uv": [11.25, 16, 12, 8], "texture": "#1"}, + "west": {"uv": [11.25, 16, 12, 8], "texture": "#1"}, + "up": {"uv": [12, 8, 11.25, 8.75], "texture": "#1"}, + "down": {"uv": [12, 15.25, 11.25, 16], "texture": "#1"} + } + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_roof.json b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_roof.json new file mode 100644 index 0000000..2558b8c --- /dev/null +++ b/Common/src/main/resources/assets/tardim_ic/models/block/tardim_soviet_chronobox/tardim_roof.json @@ -0,0 +1,22 @@ +{ + "credit": "Made by karoter2", + "texture_size": [64, 64], + "textures": { + "0": "tardim_ic:blocks/tardim_soviet_chronobox", + "particle": "tardim_ic:blocks/tardim_soviet_chronobox" + }, + "elements": [ + { + "from": [-4, 0, -4], + "to": [20, 8, 20], + "faces": { + "north": {"uv": [0, 0, 6, 2], "texture": "#0"}, + "east": {"uv": [0, 0, 6, 2], "texture": "#0"}, + "south": {"uv": [0, 0, 6, 2], "texture": "#0"}, + "west": {"uv": [0, 0, 6, 2], "texture": "#0"}, + "up": {"uv": [0, 4, 6, 10], "texture": "#0"}, + "down": {"uv": [0, 4, 6, 10], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Common/src/main/resources/assets/tardim_ic/textures/blocks/tardim_soviet_chronobox.png b/Common/src/main/resources/assets/tardim_ic/textures/blocks/tardim_soviet_chronobox.png new file mode 100644 index 0000000..ce23168 Binary files /dev/null and b/Common/src/main/resources/assets/tardim_ic/textures/blocks/tardim_soviet_chronobox.png differ diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java index 0d2bf84..3d9e1a3 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/Registration.java @@ -1,59 +1,54 @@ package su.a71.tardim_ic.tardim_ic; -import com.swdteam.tardim.common.command.*; -import com.swdteam.tardim.common.init.TRDDimensions; -import com.swdteam.tardim.main.Config; -import com.swdteam.tardim.tardim.TardimData; -import com.swdteam.tardim.tardim.TardimIDMap; -import com.swdteam.tardim.tardim.TardimManager; -import com.swdteam.tardim.tardim.TardimSaveHandler; -import com.swdteam.tardim.util.world.SchematicUtils; +import com.swdteam.tardim.common.block.BlockTardimDoors; +import com.swdteam.tardim.common.block.BlockTardimFloor; +import com.swdteam.tardim.common.block.BlockTardimRoof; +import com.swdteam.tardim.common.init.TardimRegistry; +import com.swdteam.tardim.tileentity.TileEntityTardim; + import dan200.computercraft.api.ComputerCraftAPI; -import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; -import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents; -import net.fabricmc.fabric.api.item.v1.FabricItemSettings; - +import com.mojang.datafixers.types.Type; +import net.minecraft.Util; +import net.minecraft.core.BlockPos; import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; +import net.minecraft.util.datafix.fixes.References; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.core.Registry; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Material; import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder; import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; - +import net.fabricmc.fabric.api.item.v1.FabricItemSettings; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import su.a71.tardim_ic.tardim_ic.digital_interface.DigitalInterfaceBlock; import su.a71.tardim_ic.tardim_ic.digital_interface.DigitalInterfacePeripheralProvider; import su.a71.tardim_ic.tardim_ic.digital_interface.DigitalInterfaceTileEntity; - import su.a71.tardim_ic.tardim_ic.redstone_input.RedstoneInputBlock; import su.a71.tardim_ic.tardim_ic.redstone_input.RedstoneInputTileEntity; - import su.a71.tardim_ic.tardim_ic.Constants; import su.a71.tardim_ic.tardim_ic.registration.CommandInit; -import su.a71.tardim_ic.tardim_ic.tardim_dock.DockManager; -import su.a71.tardim_ic.tardim_ic.tardim_dock.TardimDockBlock; -import su.a71.tardim_ic.tardim_ic.tardim_dock.TardimDockBlockEntity; - -import com.swdteam.tardim.tileentity.TileEntityFuelStorage; -import com.swdteam.tardim.common.block.BlockFuelStorage; - -import java.util.Iterator; -import java.util.Map; - +import su.a71.tardim_ic.tardim_ic.soviet_chronobox.SovietChronoboxTileEntity; public class Registration { // Blocks + public static Block DOOR_SOVIET_CHRONOBOX; + public static Block ROOF_SOVIET_CHRONOBOX; + public static Block FLOOR_SOVIET_CHRONOBOX; + public static BlockEntityType TILE_SOVIET_CHRONOBOX; public static final Block DIGITAL_TARDIM_INTERFACE = new DigitalInterfaceBlock(); public static final Block REDSTONE_TARDIM_INPUT = new RedstoneInputBlock(); - public static final Block TARDIM_DOCK = new TardimDockBlock(); // Tile Entities public static final BlockEntityType REDSTONE_TARDIM_INPUT_TILEENTITY = Registry.register( @@ -62,16 +57,10 @@ public class Registration { FabricBlockEntityTypeBuilder.create(RedstoneInputTileEntity::new, REDSTONE_TARDIM_INPUT).build() ); - public static final BlockEntityType DIGITAL_TARDIM_INTERFACE_TILEENTITY = Registry.register( + public static final BlockEntityType DIGITAL_TARDIM_INTERFACE_TILEENTITY = Registry.register( Registry.BLOCK_ENTITY_TYPE, new ResourceLocation("tardim_ic", "digital_tardim_interface"), - FabricBlockEntityTypeBuilder.create(RedstoneInputTileEntity::new, DIGITAL_TARDIM_INTERFACE).build() - ); - - public static final BlockEntityType TARDIM_DOCK_BLOCKENTITY = Registry.register( - Registry.BLOCK_ENTITY_TYPE, - new ResourceLocation("tardim_ic", "tardim_dock"), - FabricBlockEntityTypeBuilder.create(TardimDockBlockEntity::new, TARDIM_DOCK).build() + FabricBlockEntityTypeBuilder.create(DigitalInterfaceTileEntity::new, DIGITAL_TARDIM_INTERFACE).build() ); private static final CreativeModeTab TARDIM_IC_TAB = FabricItemGroupBuilder @@ -83,6 +72,12 @@ public class Registration { public static final ResourceLocation CLOISTER_SOUND = new ResourceLocation("tardim_ic:cloister"); public static SoundEvent CLOISTER_SOUND_EVENT = new SoundEvent(CLOISTER_SOUND); + public static TardimRegistry.TardimBuilder TARDIM_TYPE_SOVIET; + + private static BlockEntityType createTardimTile(String string, FabricBlockEntityTypeBuilder builder) { + Type type = Util.fetchChoiceType(References.BLOCK_ENTITY, string); + return (BlockEntityType)Registry.register(Registry.BLOCK_ENTITY_TYPE, new ResourceLocation(Constants.MOD_ID, string), builder.build(type)); + } // Register our stuff public static void register() { @@ -92,33 +87,25 @@ public class Registration { Registry.register(Registry.BLOCK, new ResourceLocation(Constants.MOD_ID, "digital_tardim_interface"), DIGITAL_TARDIM_INTERFACE); Registry.register(Registry.ITEM, new ResourceLocation(Constants.MOD_ID, "digital_tardim_interface"), new BlockItem(DIGITAL_TARDIM_INTERFACE, new FabricItemSettings().tab(TARDIM_IC_TAB))); - Registry.register(Registry.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_dock"), TARDIM_DOCK); - Registry.register(Registry.ITEM, new ResourceLocation(Constants.MOD_ID, "tardim_dock"), new BlockItem(TARDIM_DOCK, new FabricItemSettings().tab(TARDIM_IC_TAB))); - Registry.register(Registry.SOUND_EVENT, CLOISTER_SOUND, CLOISTER_SOUND_EVENT); + FLOOR_SOVIET_CHRONOBOX = Registry.register(Registry.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_floor_soviet"), new BlockTardimFloor(FabricBlockSettings.of(Material.WOOD).sounds(SoundType.WOOD).strength(-1.0F, 3600000.0F).noLootTable().noOcclusion(), new BlockTardimFloor.TardimTileData() { + public BlockEntityType getType() { + return TILE_SOVIET_CHRONOBOX; + } + public BlockEntityTicker getTicker() { + return TileEntityTardim::serverTick; + } + public BlockEntity createBlockEntity(BlockPos var1, BlockState var2) { + return new SovietChronoboxTileEntity(var1, var2); + } + })); + TILE_SOVIET_CHRONOBOX = createTardimTile("tardim_soviet_chronobox", FabricBlockEntityTypeBuilder.create(SovietChronoboxTileEntity::new, new Block[]{FLOOR_SOVIET_CHRONOBOX})); + DOOR_SOVIET_CHRONOBOX = Registry.register(Registry.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_door_soviet"), new BlockTardimDoors(FabricBlockSettings.of(Material.WOOD).sounds(SoundType.WOOD).strength(-1.0F, 3600000.0F).noLootTable().noOcclusion())); + ROOF_SOVIET_CHRONOBOX = Registry.register(Registry.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_roof_soviet"), new BlockTardimRoof(FabricBlockSettings.of(Material.WOOD).sounds(SoundType.WOOD).strength(-1.0F, 3600000.0F).noLootTable().noOcclusion())); + TARDIM_TYPE_SOVIET = new TardimRegistry.TardimBuilder(new ResourceLocation(Constants.MOD_ID, "tardim_soviet_chronobox"), "TARDIM Soviet Chronobox", ROOF_SOVIET_CHRONOBOX, DOOR_SOVIET_CHRONOBOX, FLOOR_SOVIET_CHRONOBOX); + ComputerCraftAPI.registerPeripheralProvider(new DigitalInterfacePeripheralProvider()); CommandInit.init(); - - ServerLifecycleEvents.SERVER_STARTING.register((server) -> { - DockManager.server = server; - DockManager.clearCahce(); - - try { - DockManager.load(); - } catch (Exception var2) { - var2.printStackTrace(); - } - }); - ServerWorldEvents.UNLOAD.register((server, world) -> { - try { - if (DockManager.server == null) { - return; - } - DockManager.save(); - } catch (Exception var5) { - var5.printStackTrace(); - } - }); } } \ No newline at end of file diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java index f72e511..a093d97 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java @@ -45,7 +45,6 @@ public class DigitalInterfacePeripheral implements IPeripheral { private final List connectedComputers = new ArrayList<>(); // List of computers connected to the peripheral private final IDigitalInterfaceEntity tileEntity; // Peripheral's BlockEntity, used for accessing coordinates - /** * @param tileEntity the tile entity of this peripheral * @hidden @@ -108,10 +107,9 @@ public class DigitalInterfacePeripheral implements IPeripheral { * This is mostly a copy of getIDForXZ function with some added checks * * @return TardimData of the TARDIM that the peripheral is in - * @throws LuaException if the peripheral is not in a TARDIM * @hidden */ - public TardimData getTardimData() throws LuaException { + public TardimData getTardimDataInitial() { int X = getTileEntity().getPos().getX(), Z = getTileEntity().getPos().getZ(); int index = 0; @@ -154,17 +152,26 @@ public class DigitalInterfacePeripheral implements IPeripheral { } // We really don't want to access a ghost TARDIM, do we? + // If we fail checks here are not inside a TARDIM if (!found) { - throw new LuaException("Peripheral is not inside a TARDIM"); + return null; } TardimData T = TardimManager.getTardim(index); if (T.getCurrentLocation() == null || T.getOwnerName() == null) { - throw new LuaException("Peripheral is not inside a TARDIM"); + return null; } return T; } + public TardimData getTardimData() throws LuaException { + TardimData data = this.getTileEntity().getTardim(); + if (data == null || data.getCurrentLocation() == null || data.getOwnerName() == null) { + throw new LuaException("Peripheral is not inside a TARDIM"); + } + return data; + } + // Peripheral methods =============================================================== /** diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheralProvider.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheralProvider.java index c6fea50..4b88e07 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheralProvider.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheralProvider.java @@ -12,6 +12,7 @@ public class DigitalInterfacePeripheralProvider implements IPeripheralProvider { @NotNull @Override public IPeripheral getPeripheral(@NotNull Level level, @NotNull BlockPos blockPos, @NotNull Direction direction) { + if (level.isClientSide()) return null; // Please...? if (level.getBlockState(blockPos).getBlock() instanceof DigitalInterfaceBlock) { return new DigitalInterfacePeripheral(new FakeDigitalInterfaceTileEntity(blockPos, level)); } diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfaceTileEntity.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfaceTileEntity.java index f7d9ca2..2e84bb7 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfaceTileEntity.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfaceTileEntity.java @@ -1,24 +1,96 @@ package su.a71.tardim_ic.tardim_ic.digital_interface; +import com.swdteam.tardim.tardim.TardimData; +import com.swdteam.tardim.tardim.TardimManager; import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import su.a71.tardim_ic.tardim_ic.Registration; -public class DigitalInterfaceTileEntity extends BlockEntity implements IDigitalInterfaceEntity { +public class DigitalInterfaceTileEntity extends BlockEntity {//implements IDigitalInterfaceEntity { + //public TardimData data; // Our TARDIM + public DigitalInterfaceTileEntity(BlockPos pos, BlockState state) { super(Registration.DIGITAL_TARDIM_INTERFACE_TILEENTITY, pos, state); + //this.data = getTardimDataInitial(); } - public BlockPos getPos() { - return this.worldPosition; - } +// public BlockPos getPos() { +// return this.worldPosition; +// } +// +// @Override +// public TardimData getTardim() { +// return null; +// } - /** - * The peripheral - */ - protected DigitalInterfacePeripheral peripheral = new DigitalInterfacePeripheral(this); +// /** +// * The peripheral +// */ +// protected DigitalInterfacePeripheral peripheral = new DigitalInterfacePeripheral(this); + +// public TardimData getTardimDataInitial() { +// int X = this.getPos().getX(), Z = this.getPos().getZ(); +// +// int index = 0; +// int x = 0; +// int y = 0; +// int dx = 0; +// int dy = 1; +// int segment_length = 1; +// int segment_passed = 0; +// boolean found = false; +// long timecheck = System.currentTimeMillis(); +// +// while(true) { +// if (System.currentTimeMillis() - timecheck > 10000L) { +// System.out.println("Finding ID from XZ Coordinates is taking too long!"); +// break; +// } +// +// if (X >= x * TardimManager.INTERIOR_BOUNDS +// && X <= TardimManager.INTERIOR_BOUNDS + x * TardimManager.INTERIOR_BOUNDS +// && Z >= y * TardimManager.INTERIOR_BOUNDS +// && Z <= TardimManager.INTERIOR_BOUNDS + y * TardimManager.INTERIOR_BOUNDS) { +// found = true; +// break; +// } +// +// x += dx; +// y += dy; +// if (++segment_passed == segment_length) { +// segment_passed = 0; +// int buffer = dy; +// dy = -dx; +// dx = buffer; +// if (buffer == 0) { +// ++segment_length; +// } +// } +// +// ++index; +// } +// +// // We really don't want to access a ghost TARDIM, do we? +// // If we fail checks here are not inside a TARDIM +// if (!found) { +// return null; +// } +// TardimData T = TardimManager.getTardim(index); +// if (T.getCurrentLocation() == null || T.getOwnerName() == null) { +// return null; +// } +// +// return T; +// } +// +// @Override +// public void load(CompoundTag tag) { +// super.load(tag); +// this.data = getTardimDataInitial(); +// } } diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/FakeDigitalInterfaceTileEntity.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/FakeDigitalInterfaceTileEntity.java new file mode 100644 index 0000000..f39e937 --- /dev/null +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/FakeDigitalInterfaceTileEntity.java @@ -0,0 +1,89 @@ +package su.a71.tardim_ic.tardim_ic.digital_interface; + +import com.swdteam.tardim.tardim.TardimData; +import com.swdteam.tardim.tardim.TardimManager; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; + +public class FakeDigitalInterfaceTileEntity implements IDigitalInterfaceEntity { + public BlockPos blockPos; + public Level level; + public TardimData data; // Our TARDIM + + + FakeDigitalInterfaceTileEntity(BlockPos in_block, Level in_level) { + this.blockPos = in_block; + this.level = in_level; + this.data = getTardimDataInitial(); + } + + @Override + public BlockPos getPos() { + return this.blockPos; + } + + @Override + public Level getLevel() { + return this.level; + } + + @Override + public TardimData getTardim() { + return this.data; + } + + public TardimData getTardimDataInitial() { + int X = this.getPos().getX(), Z = this.getPos().getZ(); + + int index = 0; + int x = 0; + int y = 0; + int dx = 0; + int dy = 1; + int segment_length = 1; + int segment_passed = 0; + boolean found = false; + long timecheck = System.currentTimeMillis(); + + while(true) { + if (System.currentTimeMillis() - timecheck > 10000L) { + System.out.println("Finding ID from XZ Coordinates is taking too long!"); + break; + } + + if (X >= x * TardimManager.INTERIOR_BOUNDS + && X <= TardimManager.INTERIOR_BOUNDS + x * TardimManager.INTERIOR_BOUNDS + && Z >= y * TardimManager.INTERIOR_BOUNDS + && Z <= TardimManager.INTERIOR_BOUNDS + y * TardimManager.INTERIOR_BOUNDS) { + found = true; + break; + } + + x += dx; + y += dy; + if (++segment_passed == segment_length) { + segment_passed = 0; + int buffer = dy; + dy = -dx; + dx = buffer; + if (buffer == 0) { + ++segment_length; + } + } + + ++index; + } + + // We really don't want to access a ghost TARDIM, do we? + // If we fail checks here are not inside a TARDIM + if (!found) { + return null; + } + TardimData T = TardimManager.getTardim(index); + if (T.getCurrentLocation() == null || T.getOwnerName() == null) { + return null; + } + + return T; + } +} diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/IDigitalInterfaceEntity.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/IDigitalInterfaceEntity.java new file mode 100644 index 0000000..6c94757 --- /dev/null +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/IDigitalInterfaceEntity.java @@ -0,0 +1,12 @@ +package su.a71.tardim_ic.tardim_ic.digital_interface; + +import com.swdteam.tardim.tardim.TardimData; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; + +public interface IDigitalInterfaceEntity { + public BlockPos getPos(); + public Level getLevel(); + + public TardimData getTardim(); +} diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/redstone_input/RedstoneInputBlock.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/redstone_input/RedstoneInputBlock.java index 05ef6cb..5c81fc0 100644 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/redstone_input/RedstoneInputBlock.java +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/redstone_input/RedstoneInputBlock.java @@ -23,7 +23,6 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.ComparatorBlock; import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/soviet_chronobox/SovietChronoboxTileEntity.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/soviet_chronobox/SovietChronoboxTileEntity.java new file mode 100644 index 0000000..4e6e499 --- /dev/null +++ b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/soviet_chronobox/SovietChronoboxTileEntity.java @@ -0,0 +1,13 @@ +package su.a71.tardim_ic.tardim_ic.soviet_chronobox; + +import com.swdteam.tardim.common.init.TRDTiles; +import com.swdteam.tardim.tileentity.TileEntityTardim; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; +import su.a71.tardim_ic.tardim_ic.Registration; + +public class SovietChronoboxTileEntity extends TileEntityTardim { + public SovietChronoboxTileEntity(BlockPos pos, BlockState state) { + super(Registration.TILE_SOVIET_CHRONOBOX, pos, state); + } +} \ No newline at end of file diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/DockData.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/DockData.java deleted file mode 100644 index 3566ba8..0000000 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/DockData.java +++ /dev/null @@ -1,22 +0,0 @@ -package su.a71.tardim_ic.tardim_ic.tardim_dock; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.Level; - -public class DockData { - public String name; - public BlockPos blockPos; - public Level level; - public boolean active = true; - public boolean occupied = false; - - public DockData(BlockPos blockPos) { - this.blockPos = blockPos; - this.name = DockManager.addDock(this); - } - - public void setActive(boolean setting) { - this.active = setting; - DockManager.updateDock(this.name, this); - } -} diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/DockManager.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/DockManager.java deleted file mode 100644 index 84d27f0..0000000 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/DockManager.java +++ /dev/null @@ -1,99 +0,0 @@ -package su.a71.tardim_ic.tardim_ic.tardim_dock; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.swdteam.tardim.main.Config; -import com.swdteam.tardim.main.Tardim; -import com.swdteam.tardim.tardim.TardimData; -import com.swdteam.tardim.tardim.TardimManager; -import com.swdteam.tardim.tardim.TardimSaveHandler; -import com.swdteam.tardim.tardim.TardimIDMap; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.level.storage.LevelResource; - -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.Map; - -public class DockManager { - private static Map DOCK_DATA = new HashMap<>(); - static Gson gson = new Gson(); - public static MinecraftServer server; - - - public DockManager() { - } - - public static DockData getDock(String name) { - return DOCK_DATA.get(name); - } - - public static String addDock(DockData dockData) { - int new_id = DOCK_DATA.size(); - while (DOCK_DATA.containsKey(Integer.toString(new_id))) { - System.out.println(new_id + "Was taken so we try another"); - new_id++; - } - System.out.println("PICKED ID: " + new_id); - - DOCK_DATA.put(Integer.toString(new_id), dockData); - return Integer.toString(new_id); - } - - public static void removeDock(String name) { - DOCK_DATA.remove(name); - } - - public static void updateDock(String name, DockData dockData) { - DOCK_DATA.put(name, dockData); - } - - public static void load() throws Exception { - File file = new File(server.getWorldPath(LevelResource.ROOT) + "/tardim_ic/dock_map.json"); - - // Check if file exists - if (!file.exists()) { - file.getParentFile().mkdirs(); - file.createNewFile(); - FileWriter writer = new FileWriter(file); - writer.write(gson.toJson(new HashMap())); - writer.close(); - return; - } - - Type typeOfDockMap = new TypeToken>() { }.getType(); - - JsonReader reader = new JsonReader(new FileReader(file)); - String json = gson.fromJson(reader, String.class); - DOCK_DATA = gson.fromJson(json, typeOfDockMap); - - System.out.println("Loaded TARDIM: IC docks"); - } - - public static void save() throws Exception { - File file = new File(server.getWorldPath(LevelResource.ROOT) + "/tardim_ic/dock_map.json"); - - // Check if file exists - if (!file.exists()) { - file.getParentFile().mkdirs(); - file.createNewFile(); - } - - Gson gson = new Gson(); - String json = gson.toJson(DOCK_DATA); - JsonWriter writer = new JsonWriter(new FileWriter(file)); - writer.jsonValue(json); - writer.close(); - - System.out.println("Saved TARDIM: IC docks"); - } - - public static void clearCahce() { - DOCK_DATA.clear(); - } -} diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/TardimDockBlock.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/TardimDockBlock.java deleted file mode 100644 index c17695c..0000000 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/TardimDockBlock.java +++ /dev/null @@ -1,108 +0,0 @@ -package su.a71.tardim_ic.tardim_ic.tardim_dock; - -import com.swdteam.tardim.common.init.TRDDimensions; -import com.swdteam.tardim.common.init.TRDSounds; -import com.swdteam.tardim.network.NetworkHandler; -import com.swdteam.tardim.network.PacketOpenEditGui; -import com.swdteam.tardim.tardim.TardimData; -import com.swdteam.tardim.tardim.TardimManager; -import com.swdteam.tardim.tileentity.TileEntityBaseTardimPanel; -import com.swdteam.tardim.tileentity.TileEntityTardim; -import com.swdteam.tardim.tileentity.tardim.TardimType96TileEntity; -import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.ChatFormatting; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.network.chat.Component; -import net.minecraft.network.protocol.game.DebugPackets; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.LevelReader; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.properties.IntegerProperty; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.phys.BlockHitResult; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import su.a71.tardim_ic.tardim_ic.Registration; -import su.a71.tardim_ic.tardim_ic.redstone_input.RedstoneInputTileEntity; -import su.a71.tardim_ic.tardim_ic.utils.FakePlayer; - -import net.minecraft.world.level.block.RedstoneLampBlock; - -public class TardimDockBlock extends Block implements EntityBlock { - public TardimDockBlock() { - super(FabricBlockSettings.of(Material.METAL).strength(2, 4).noOcclusion()); - } - - @Override - public InteractionResult use(BlockState blockState, Level w, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult p_60508_) { - if (!w.isClientSide) { - BlockEntity be = w.getBlockEntity(blockPos); - if (be instanceof TardimDockBlockEntity) { - - player.displayClientMessage( - Component.literal("Dock name: '" + ((TardimDockBlockEntity) be).data.name + "'").withStyle(ChatFormatting.DARK_AQUA).withStyle(ChatFormatting.BOLD), true - ); - } - } - - return InteractionResult.CONSUME; - } - - public boolean canSurvive(BlockState blockState, LevelReader levelReader, BlockPos blockPos) { - return true; - } - - // Un-register the dock when breaking - @Override - public void destroy(LevelAccessor levelAccessor, BlockPos blockPos, BlockState blockState) { - super.destroy(levelAccessor, blockPos, blockState); - BlockEntity be = levelAccessor.getBlockEntity(blockPos); - if (be instanceof TardimDockBlockEntity) { - DockManager.removeDock(((TardimDockBlockEntity) be).data.name); - } - } - - @Nullable - @Override - public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { - return Registration.TARDIM_DOCK_BLOCKENTITY.create(blockPos, blockState); - } - - - public void neighborChanged(BlockState blockState, Level level, BlockPos blockPos, Block block, BlockPos fromPos, boolean isMoving) { - DebugPackets.sendNeighborsUpdatePacket(level, blockPos); - - BlockEntity be = level.getBlockEntity(blockPos); - if (!(be instanceof TardimDockBlockEntity)) { - return; - } - - // get redstone signal - if (level.hasNeighborSignal(blockPos)) { - if (!((TardimDockBlockEntity) be).isPowered) { - ((TardimDockBlockEntity) be).isPowered = true; - } - } - else if (((TardimDockBlockEntity) be).isPowered) { - ((TardimDockBlockEntity) be).isPowered = false; - } - ((TardimDockBlockEntity) be).updateActive(); - - // Check stuff - ((TardimDockBlockEntity) be).data.occupied = (level.getBlockEntity(blockPos.above()) instanceof TileEntityTardim); - if ((level.getBlockEntity(blockPos.above()) instanceof TileEntityTardim)) { - System.out.println("Oooo TARDIM docked!!!!"); - } - } -} diff --git a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/TardimDockBlockEntity.java b/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/TardimDockBlockEntity.java deleted file mode 100644 index 30d3660..0000000 --- a/Fabric/src/main/java/su/a71/tardim_ic/tardim_ic/tardim_dock/TardimDockBlockEntity.java +++ /dev/null @@ -1,41 +0,0 @@ -package su.a71.tardim_ic.tardim_ic.tardim_dock; - -import net.minecraft.core.BlockPos; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.nbt.Tag; -import net.minecraft.world.level.block.ComparatorBlock; -import net.minecraft.world.level.block.EntityBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.entity.ComparatorBlockEntity; -import net.minecraft.world.level.block.state.BlockState; - -import su.a71.tardim_ic.tardim_ic.Registration; - -public class TardimDockBlockEntity extends BlockEntity { - public boolean isPowered = false; - public DockData data; - private BlockPos blockPos; - - public TardimDockBlockEntity(BlockPos blockPos, BlockState blockState) { - super(Registration.TARDIM_DOCK_BLOCKENTITY, blockPos, blockState); - this.blockPos = blockPos; - this.data = new DockData(blockPos); - } - - public void updateActive() { - this.data.setActive(this.isPowered); - } - - @Override - public void saveAdditional(CompoundTag tag) { - tag.putString("data_name", data.name); - tag.putBoolean("data_active", data.active); - super.saveAdditional(tag); - } - - @Override - public void load(CompoundTag tag) { - super.load(tag); - } -} diff --git a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java index 60ea768..9c51db9 100644 --- a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java +++ b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfacePeripheral.java @@ -2,6 +2,21 @@ package su.a71.tardim_ic.tardim_ic.digital_interface; import com.mojang.datafixers.util.Pair; import com.swdteam.common.command.tardim.CommandTardimBase; +import com.swdteam.common.command.tardim.CommandTravel; +import com.swdteam.common.data.DimensionMapReloadListener; +import com.swdteam.common.init.TRDSounds; +import com.swdteam.common.init.TardimRegistry; +import com.swdteam.common.item.ItemTardim; +import com.swdteam.main.Tardim; +import com.swdteam.tardim.TardimData; +import com.swdteam.tardim.TardimData.Location; +import com.swdteam.tardim.TardimManager; + +import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.api.lua.LuaFunction; +import dan200.computercraft.api.lua.ObjectLuaTable; +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Holder; @@ -10,31 +25,14 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.server.players.PlayerList; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundSource; import net.minecraft.world.level.Level; -import net.minecraft.server.players.PlayerList; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.phys.Vec3; - -import dan200.computercraft.api.lua.LuaFunction; -import dan200.computercraft.api.peripheral.IComputerAccess; -import dan200.computercraft.api.peripheral.IPeripheral; -import dan200.computercraft.api.lua.ObjectLuaTable; -import dan200.computercraft.api.lua.LuaException; - -import com.swdteam.tardim.TardimData; -import com.swdteam.tardim.TardimManager; -import com.swdteam.tardim.TardimData.Location; -import com.swdteam.common.init.TardimRegistry; -import com.swdteam.common.command.tardim.CommandTravel; -import com.swdteam.common.data.DimensionMapReloadListener; -import com.swdteam.common.init.TRDSounds; -import com.swdteam.common.item.ItemTardim; -import com.swdteam.main.Tardim; - import su.a71.tardim_ic.tardim_ic.Registration; import su.a71.tardim_ic.tardim_ic.utils.FakePlayer; @@ -46,13 +44,12 @@ import java.util.*; public class DigitalInterfacePeripheral implements IPeripheral { private final List connectedComputers = new ArrayList<>(); // List of computers connected to the peripheral - private final DigitalInterfaceTileEntity tileEntity; // Peripheral's BlockEntity, used for accessing coordinates - + private final IDigitalInterfaceEntity tileEntity; // Peripheral's BlockEntity, used for accessing coordinates /** * @param tileEntity the tile entity of this peripheral * @hidden */ - public DigitalInterfacePeripheral(DigitalInterfaceTileEntity tileEntity) { + public DigitalInterfacePeripheral(IDigitalInterfaceEntity tileEntity) { this.tileEntity = tileEntity; } @@ -92,7 +89,7 @@ public class DigitalInterfacePeripheral implements IPeripheral { * @hidden * @return */ - public DigitalInterfaceTileEntity getTileEntity() { + public IDigitalInterfaceEntity getTileEntity() { return tileEntity; } @@ -110,10 +107,9 @@ public class DigitalInterfacePeripheral implements IPeripheral { * This is mostly a copy of getIDForXZ function with some added checks * * @return TardimData of the TARDIM that the peripheral is in - * @throws LuaException if the peripheral is not in a TARDIM * @hidden */ - public TardimData getTardimData() throws LuaException { + public TardimData getTardimDataInitial() { int X = getTileEntity().getPos().getX(), Z = getTileEntity().getPos().getZ(); int index = 0; @@ -156,15 +152,24 @@ public class DigitalInterfacePeripheral implements IPeripheral { } // We really don't want to access a ghost TARDIM, do we? + // If we fail checks here are not inside a TARDIM if (!found) { - throw new LuaException("Peripheral is not inside a TARDIM"); + return null; } TardimData T = TardimManager.getTardim(index); if (T.getCurrentLocation() == null || T.getOwnerName() == null) { - throw new LuaException("Peripheral is not inside a TARDIM"); + return null; } - return T; + return T; + } + + public TardimData getTardimData() throws LuaException { + TardimData data = this.getTileEntity().getTardim(); + if (data == null || data.getCurrentLocation() == null || data.getOwnerName() == null) { + throw new LuaException("Peripheral is not inside a TARDIM"); + } + return data; } // Peripheral methods =============================================================== @@ -173,7 +178,7 @@ public class DigitalInterfacePeripheral implements IPeripheral { * Return how much fuel is left in the TARDIM * * @return Fuel left (Out of 100) - */ + */ @LuaFunction(mainThread = true) public final double getFuel() throws LuaException { return getTardimData().getFuel(); @@ -182,7 +187,7 @@ public class DigitalInterfacePeripheral implements IPeripheral { /** * Get how much fuel it would take to travel to the destination * @return Amount of fuel needed (Out of 100) - */ + */ @LuaFunction(mainThread = true) public final double calculateFuelForJourney() throws LuaException { TardimData data = getTardimData(); @@ -266,15 +271,15 @@ public class DigitalInterfacePeripheral implements IPeripheral { */ @LuaFunction(mainThread = true) public final ObjectLuaTable getCurrentLocation() throws LuaException { - Location loc = getTardimData().getCurrentLocation(); + Location loc = getTardimData().getCurrentLocation(); return new ObjectLuaTable(Map.of( - "dimension", loc.getLevel().location().toString(), - "pos", new ObjectLuaTable(Map.of( - "x", loc.getPos().getX(), - "y", loc.getPos().getY(), - "z", loc.getPos().getZ() - )), - "facing", loc.getFacing().toString() + "dimension", loc.getLevel().location().toString(), + "pos", new ObjectLuaTable(Map.of( + "x", loc.getPos().getX(), + "y", loc.getPos().getY(), + "z", loc.getPos().getZ() + )), + "facing", loc.getFacing().toString() )); } @@ -291,7 +296,7 @@ public class DigitalInterfacePeripheral implements IPeripheral { */ @LuaFunction(mainThread = true) public final ObjectLuaTable getTravelLocation() throws LuaException { - TardimData data = getTardimData(); + TardimData data = getTardimData(); if (data.getTravelLocation() == null) { data.setTravelLocation(data.getCurrentLocation()); } @@ -299,9 +304,9 @@ public class DigitalInterfacePeripheral implements IPeripheral { return new ObjectLuaTable(Map.of( "dimension", loc.getLevel().location().toString(), "pos", new ObjectLuaTable(Map.of( - "x", loc.getPos().getX(), - "y", loc.getPos().getY(), - "z", loc.getPos().getZ() + "x", loc.getPos().getX(), + "y", loc.getPos().getY(), + "z", loc.getPos().getZ() )), "facing", loc.getFacing().toString() )); @@ -313,14 +318,15 @@ public class DigitalInterfacePeripheral implements IPeripheral { */ @LuaFunction(mainThread = true) public final ObjectLuaTable getCompanions() throws LuaException { - TardimData data = getTardimData(); + TardimData data = getTardimData(); Map companions = new HashMap<>(); - for (int i = 0; i < data.getCompanions().size(); i++) { - companions.put(i + 1, data.getCompanions().get(i).getUsername()); - } - return new ObjectLuaTable(companions); + for (int i = 0; i < data.getCompanions().size(); i++) { + companions.put(i + 1, data.getCompanions().get(i).getUsername()); + } + return new ObjectLuaTable(companions); } + /** * Set dimension for the TARDIM to travel to *

@@ -331,7 +337,7 @@ public class DigitalInterfacePeripheral implements IPeripheral { */ @LuaFunction(mainThread = true) public final void setDimension(String dimension) throws LuaException { - TardimData data = getTardimData(); + TardimData data = getTardimData(); String key = dimension; dimension = DimensionMapReloadListener.toTitleCase(dimension); @@ -378,7 +384,7 @@ public class DigitalInterfacePeripheral implements IPeripheral { if (this.tileEntity.getLevel().isClientSide()) { return; } - TardimData data = getTardimData(); + TardimData data = getTardimData(); UUID uuid = data.getOwner(); String username = data.getOwnerName(); @@ -415,15 +421,15 @@ public class DigitalInterfacePeripheral implements IPeripheral { PlayerList playerList = this.tileEntity.getLevel().getServer().getPlayerList(); ServerPlayer player = playerList.getPlayerByName(username); - if (player == null) { - throw new LuaException("Player not found"); - } + if (player == null) { + throw new LuaException("Player not found"); + } - ResourceKey dim = player.getCommandSenderWorld().dimension(); - BlockPos pos = player.blockPosition(); + ResourceKey dim = player.getCommandSenderWorld().dimension(); + BlockPos pos = player.blockPosition(); - setDimension(dim.location().toString()); - setTravelLocation(pos.getX(), pos.getY(), pos.getZ()); + setDimension(dim.location().toString()); + setTravelLocation(pos.getX(), pos.getY(), pos.getZ()); } /** @@ -437,13 +443,13 @@ public class DigitalInterfacePeripheral implements IPeripheral { return null; } - PlayerList playerList = this.tileEntity.getLevel().getServer().getPlayerList(); + PlayerList playerList = this.tileEntity.getLevel().getServer().getPlayerList(); Map players = new HashMap<>(); for (int i = 0; i < playerList.getPlayers().size(); i++) { players.put(i + 1, playerList.getPlayers().get(i).getGameProfile().getName()); } - return new ObjectLuaTable(players); + return new ObjectLuaTable(players); } /** @@ -452,8 +458,8 @@ public class DigitalInterfacePeripheral implements IPeripheral { */ @LuaFunction(mainThread = true) public final String getDoorRotation() throws LuaException { - TardimData data = getTardimData(); - Direction rotation = data.getTravelLocation().getFacing(); + TardimData data = getTardimData(); + Direction rotation = data.getTravelLocation().getFacing(); switch (rotation) { case NORTH -> { return "north"; @@ -479,7 +485,7 @@ public class DigitalInterfacePeripheral implements IPeripheral { */ @LuaFunction(mainThread = true) public final void setDoorRotation(String rotation) throws LuaException { - TardimData data = getTardimData(); + TardimData data = getTardimData(); switch (rotation) { case "north" -> data.getTravelLocation().setFacing(Direction.NORTH); case "east" -> data.getTravelLocation().setFacing(Direction.EAST); @@ -496,7 +502,7 @@ public class DigitalInterfacePeripheral implements IPeripheral { */ @LuaFunction(mainThread = true) public final void toggleDoorRotation() throws LuaException { - TardimData data = getTardimData(); + TardimData data = getTardimData(); if (data.getTravelLocation() == null) { data.setTravelLocation(new Location(data.getCurrentLocation())); } @@ -523,18 +529,18 @@ public class DigitalInterfacePeripheral implements IPeripheral { */ @LuaFunction(mainThread = true) public final void coordAdd(String axis, int amount) throws LuaException { - TardimData data = getTardimData(); - if (data.getTravelLocation() == null) { - data.setTravelLocation(new Location(data.getCurrentLocation())); - } + TardimData data = getTardimData(); + if (data.getTravelLocation() == null) { + data.setTravelLocation(new Location(data.getCurrentLocation())); + } - Location location = data.getTravelLocation(); - switch (axis) { - case "x" -> location.addPosition(amount, 0, 0); + Location location = data.getTravelLocation(); + switch (axis) { + case "x" -> location.addPosition(amount, 0, 0); case "y" -> location.addPosition(0, amount, 0); case "z" -> location.addPosition(0, 0, amount); default -> throw new LuaException("Invalid axis"); - } + } } /** @@ -546,7 +552,7 @@ public class DigitalInterfacePeripheral implements IPeripheral { return; } - TardimData data = getTardimData(); + TardimData data = getTardimData(); if (data.isInFlight()) { throw new LuaException("TARDIM is already in flight"); @@ -555,7 +561,7 @@ public class DigitalInterfacePeripheral implements IPeripheral { ServerLevel level = this.tileEntity.getLevel().getServer().getLevel(loc.getLevel()); ItemTardim.destroyTardim(level, loc.getPos(), Direction.NORTH); data.setInFlight(true); - if (data.getTravelLocation() == null) { + if (data.getTravelLocation() == null) { data.setTravelLocation(new Location(data.getCurrentLocation())); } diff --git a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfaceTileEntity.java b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfaceTileEntity.java index 6a596fc..d03667d 100644 --- a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfaceTileEntity.java +++ b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/DigitalInterfaceTileEntity.java @@ -1,7 +1,10 @@ package su.a71.tardim_ic.tardim_ic.digital_interface; +import com.swdteam.tardim.TardimData; +import com.swdteam.tardim.TardimManager; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; @@ -15,9 +18,11 @@ import dan200.computercraft.api.peripheral.IPeripheral; import static dan200.computercraft.shared.Capabilities.CAPABILITY_PERIPHERAL; public class DigitalInterfaceTileEntity extends BlockEntity implements IDigitalInterfaceEntity { + public TardimData data; // Our TARDIM public DigitalInterfaceTileEntity(BlockPos pos, BlockState state) { super(Registration.DIGITAL_TARDIM_INTERFACE_TILEENTITY.get(), pos, state); + this.data = getTardimDataInitial(); } /** @@ -29,6 +34,11 @@ public class DigitalInterfaceTileEntity extends BlockEntity implements IDigitalI return this.worldPosition; } + @Override + public TardimData getTardim() { + return this.data; + } + /** * When a computer modem tries to wrap our block, the modem will call getCapability to receive our peripheral. * Then we just simply return a {@link LazyOptional} with our Peripheral @@ -44,4 +54,65 @@ public class DigitalInterfaceTileEntity extends BlockEntity implements IDigitalI } return super.getCapability(cap, direction); } + + public TardimData getTardimDataInitial() { + int X = this.getPos().getX(), Z = this.getPos().getZ(); + + int index = 0; + int x = 0; + int y = 0; + int dx = 0; + int dy = 1; + int segment_length = 1; + int segment_passed = 0; + boolean found = false; + long timecheck = System.currentTimeMillis(); + + while(true) { + if (System.currentTimeMillis() - timecheck > 10000L) { + System.out.println("Finding ID from XZ Coordinates is taking too long!"); + break; + } + + if (X >= x * TardimManager.INTERIOR_BOUNDS + && X <= TardimManager.INTERIOR_BOUNDS + x * TardimManager.INTERIOR_BOUNDS + && Z >= y * TardimManager.INTERIOR_BOUNDS + && Z <= TardimManager.INTERIOR_BOUNDS + y * TardimManager.INTERIOR_BOUNDS) { + found = true; + break; + } + + x += dx; + y += dy; + if (++segment_passed == segment_length) { + segment_passed = 0; + int buffer = dy; + dy = -dx; + dx = buffer; + if (buffer == 0) { + ++segment_length; + } + } + + ++index; + } + + // We really don't want to access a ghost TARDIM, do we? + // If we fail checks here are not inside a TARDIM + if (!found) { + return null; + } + TardimData T = TardimManager.getTardim(index); + if (T.getCurrentLocation() == null || T.getOwnerName() == null) { + return null; + } + + return T; + } + + @Override + public void load(CompoundTag tag) { + super.load(tag); + this.data = getTardimDataInitial(); + } } diff --git a/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/FakeDigitalInterfaceTileEntity.java b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/FakeDigitalInterfaceTileEntity.java new file mode 100644 index 0000000..df5fe94 --- /dev/null +++ b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/FakeDigitalInterfaceTileEntity.java @@ -0,0 +1,89 @@ +package su.a71.tardim_ic.tardim_ic.digital_interface; + +import com.swdteam.tardim.TardimData; +import com.swdteam.tardim.TardimManager; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; + +public class FakeDigitalInterfaceTileEntity implements IDigitalInterfaceEntity { + public BlockPos blockPos; + public Level level; + public TardimData data; // Our TARDIM + + + FakeDigitalInterfaceTileEntity(BlockPos in_block, Level in_level) { + this.blockPos = in_block; + this.level = in_level; + this.data = getTardimDataInitial(); + } + + @Override + public BlockPos getPos() { + return this.blockPos; + } + + @Override + public Level getLevel() { + return this.level; + } + + @Override + public TardimData getTardim() { + return this.data; + } + + public TardimData getTardimDataInitial() { + int X = this.getPos().getX(), Z = this.getPos().getZ(); + + int index = 0; + int x = 0; + int y = 0; + int dx = 0; + int dy = 1; + int segment_length = 1; + int segment_passed = 0; + boolean found = false; + long timecheck = System.currentTimeMillis(); + + while(true) { + if (System.currentTimeMillis() - timecheck > 10000L) { + System.out.println("Finding ID from XZ Coordinates is taking too long!"); + break; + } + + if (X >= x * TardimManager.INTERIOR_BOUNDS + && X <= TardimManager.INTERIOR_BOUNDS + x * TardimManager.INTERIOR_BOUNDS + && Z >= y * TardimManager.INTERIOR_BOUNDS + && Z <= TardimManager.INTERIOR_BOUNDS + y * TardimManager.INTERIOR_BOUNDS) { + found = true; + break; + } + + x += dx; + y += dy; + if (++segment_passed == segment_length) { + segment_passed = 0; + int buffer = dy; + dy = -dx; + dx = buffer; + if (buffer == 0) { + ++segment_length; + } + } + + ++index; + } + + // We really don't want to access a ghost TARDIM, do we? + // If we fail checks here are not inside a TARDIM + if (!found) { + return null; + } + TardimData T = TardimManager.getTardim(index); + if (T.getCurrentLocation() == null || T.getOwnerName() == null) { + return null; + } + + return T; + } +} diff --git a/Common/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/IDigitalInterfaceEntity.java b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/IDigitalInterfaceEntity.java similarity index 76% rename from Common/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/IDigitalInterfaceEntity.java rename to Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/IDigitalInterfaceEntity.java index bdcfbb0..ccbb39c 100644 --- a/Common/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/IDigitalInterfaceEntity.java +++ b/Forge/src/main/java/su/a71/tardim_ic/tardim_ic/digital_interface/IDigitalInterfaceEntity.java @@ -1,9 +1,12 @@ package su.a71.tardim_ic.tardim_ic.digital_interface; +import com.swdteam.tardim.TardimData; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; public interface IDigitalInterfaceEntity { public BlockPos getPos(); public Level getLevel(); + + public TardimData getTardim(); } diff --git a/Forge/src/main/resources/META-INF/mods.toml b/Forge/src/main/resources/META-INF/mods.toml index ddaa3b9..e94d668 100644 --- a/Forge/src/main/resources/META-INF/mods.toml +++ b/Forge/src/main/resources/META-INF/mods.toml @@ -5,7 +5,7 @@ license = "MIT" [[mods]] #mandatory # The modid of the mod modId = "tardim_ic" #mandatory -version = "1.0" #mandatory +version = "1.1" #mandatory # A display name for the mod displayName = "TARDIM: In Control" #mandatory # The description text for the mod (multi line!) (#mandatory) diff --git a/SWD_MOMENT.txt b/SWD_MOMENT.txt new file mode 100644 index 0000000..cb9226a --- /dev/null +++ b/SWD_MOMENT.txt @@ -0,0 +1,4 @@ +=== HOW MANY PROBLEMS TARDIM HAS?! === +1. A few log messages definitely left from testing (e.g. aklfjsjsfw) +2. isValidFlightPath is private of Fabric +3. FABRIC AND FORGE HAVE DIFFERENT JAVA IMPORT PATHS \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index fc9bf37..debfa5c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project -version=1.0 +version=1.1 group=su.a71.tardim_ic # Common