Say it with me, not even close

This commit is contained in:
Andrew-71 2023-05-08 23:22:33 +03:00
parent eecac8ac7c
commit 024d00049e
29 changed files with 1451 additions and 433 deletions

View file

@ -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;
}
}

View file

@ -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
}
}
}

View file

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_floor" }
}
}

View file

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "tardim_ic:block/tardim_soviet_chronobox/tardim_roof" }
}
}

View file

@ -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": [15, 17, -13],
"to": [15, 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]
}
]
}

View file

@ -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": [15, 17, -13],
"to": [15, 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]
}
]
}

View file

@ -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": []
}
]
}

View file

@ -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]
}
]
}

View file

@ -0,0 +1,13 @@
{
"credit": "Made by karoter2",
"texture_size": [64, 64],
"groups": [
{
"name": "group",
"origin": [0, 0, 0],
"color": 0,
"nbt": "{}",
"children": []
}
]
}

View file

@ -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"}
}
}
]
}

View file

@ -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"}
}
}
]
}

View file

@ -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"}
}
}
]
}

View file

@ -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"}
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -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<TileEntityTardim> 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<RedstoneInputTileEntity> REDSTONE_TARDIM_INPUT_TILEENTITY = Registry.register(
@ -68,12 +63,6 @@ public class Registration {
FabricBlockEntityTypeBuilder.create(RedstoneInputTileEntity::new, DIGITAL_TARDIM_INTERFACE).build()
);
public static final BlockEntityType<TardimDockBlockEntity> TARDIM_DOCK_BLOCKENTITY = Registry.register(
Registry.BLOCK_ENTITY_TYPE,
new ResourceLocation("tardim_ic", "tardim_dock"),
FabricBlockEntityTypeBuilder.create(TardimDockBlockEntity::new, TARDIM_DOCK).build()
);
private static final CreativeModeTab TARDIM_IC_TAB = FabricItemGroupBuilder
.create(new ResourceLocation("tardim_ic"))
.icon(() -> new ItemStack(DIGITAL_TARDIM_INTERFACE))
@ -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 <T extends BlockEntity> BlockEntityType<T> createTardimTile(String string, FabricBlockEntityTypeBuilder<T> 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<TileEntityTardim> getType() {
return TILE_SOVIET_CHRONOBOX;
}
public BlockEntityTicker<? super TileEntityTardim> 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();
}
});
}
}

View file

@ -45,7 +45,6 @@ public class DigitalInterfacePeripheral implements IPeripheral {
private final List<IComputerAccess> 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
@ -111,7 +110,7 @@ public class DigitalInterfacePeripheral implements IPeripheral {
* @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 +153,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 ===============================================================
/**

View file

@ -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();
// }
}

View file

@ -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;
}
}

View file

@ -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();
}

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -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<String, DockData> 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<Integer, DockData>()));
writer.close();
return;
}
Type typeOfDockMap = new TypeToken<Map<Integer, DockData>>() { }.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();
}
}

View file

@ -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!!!!");
}
}
}

View file

@ -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);
}
}

View file

@ -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<IComputerAccess> 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;
}
@ -113,7 +110,7 @@ public class DigitalInterfacePeripheral implements IPeripheral {
* @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,17 +153,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 ===============================================================
/**
@ -321,6 +327,7 @@ public class DigitalInterfacePeripheral implements IPeripheral {
return new ObjectLuaTable(companions);
}
/**
* Set dimension for the TARDIM to travel to
* <p>

View file

@ -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();
}
}

View file

@ -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;
}
}

View file

@ -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();
}

4
SWD_MOMENT.txt Normal file
View file

@ -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