diff --git a/src/main/java/com/zixiken/dimdoors/blocks/WarpDoor.java b/src/main/java/com/zixiken/dimdoors/blocks/WarpDoor.java index 1c60a3df..91688bc1 100644 --- a/src/main/java/com/zixiken/dimdoors/blocks/WarpDoor.java +++ b/src/main/java/com/zixiken/dimdoors/blocks/WarpDoor.java @@ -6,6 +6,7 @@ import com.zixiken.dimdoors.core.PocketManager; import com.zixiken.dimdoors.DimDoors; import net.minecraft.block.BlockDoor; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -22,18 +23,16 @@ public class WarpDoor extends BaseDimDoor { @Override public void placeLink(World world, BlockPos pos) { - if (!world.isRemote && world.getBlockState(pos.down()) == this) { + IBlockState state = world.getBlockState(pos.down()); + if (!world.isRemote && state.getBlock() == this) { NewDimData dimension = PocketManager.createDimensionData(world); DimLink link = dimension.getLink(pos); if (link == null && dimension.isPocketDimension()) { - dimension.createLink(pos, LinkType.SAFE_EXIT,world. getBlockState(pos.down()).getValue(BlockDoor.FACING)); + dimension.createLink(pos, LinkType.SAFE_EXIT, state.getValue(BlockDoor.FACING)); } } } @Override - public Item getDoorItem() - { - return DimDoors.itemWarpDoor; - } + public Item getDoorItem() {return DimDoors.itemWarpDoor;} } \ No newline at end of file diff --git a/src/main/resources/assets/dimdoors/blockstates/dimDoorWarp.json b/src/main/resources/assets/dimdoors/blockstates/dimDoorWarp.json new file mode 100644 index 00000000..b42251ad --- /dev/null +++ b/src/main/resources/assets/dimdoors/blockstates/dimDoorWarp.json @@ -0,0 +1,36 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { "model": "dimDoorWarp_bottom" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "dimDoorWarp_bottom", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "dimDoorWarp_bottom", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "dimDoorWarp_bottom", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "dimDoorWarp_bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "dimDoorWarp_bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "dimDoorWarp_bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "dimDoorWarp_bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "dimDoorWarp_bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "dimDoorWarp_bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "dimDoorWarp_bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "dimDoorWarp_bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "dimDoorWarp_bottom", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "dimDoorWarp_bottom" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "dimDoorWarp_bottom", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "dimDoorWarp_bottom", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "dimDoorWarp_top" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "dimDoorWarp_top", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "dimDoorWarp_top", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "dimDoorWarp_top", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "dimDoorWarp_top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "dimDoorWarp_top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "dimDoorWarp_top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "dimDoorWarp_top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "dimDoorWarp_top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "dimDoorWarp_top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "dimDoorWarp_top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "dimDoorWarp_top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "dimDoorWarp_top", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "dimDoorWarp_top" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "dimDoorWarp_top", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "dimDoorWarp_top", "y": 180 } + } +} diff --git a/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_bottom.json b/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_bottom.json new file mode 100644 index 00000000..320cbc80 --- /dev/null +++ b/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom", + "textures": { + "bottom": "blocks/dimDoorWarp_lower", + "top": "blocks/dimDoorWarp_upper" + } +} diff --git a/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_bottom_rh.json b/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_bottom_rh.json new file mode 100644 index 00000000..d4936004 --- /dev/null +++ b/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_bottom_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom_rh", + "textures": { + "bottom": "blocks/dimDoorWarp_lower", + "top": "blocks/dimDoorWarp_upper" + } +} diff --git a/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_top.json b/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_top.json new file mode 100644 index 00000000..ca88fd88 --- /dev/null +++ b/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_top.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top", + "textures": { + "bottom": "blocks/dimDoorWarp_lower", + "top": "blocks/dimDoorWarp_upper" + } +} diff --git a/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_top_rh.json b/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_top_rh.json new file mode 100644 index 00000000..633ba459 --- /dev/null +++ b/src/main/resources/assets/dimdoors/models/block/dimDoorWarp_top_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top_rh", + "textures": { + "bottom": "blocks/dimDoorWarp_lower", + "top": "blocks/dimDoorWarp_upper" + } +} diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_lower.png b/src/main/resources/assets/dimdoors/textures/blocks/dimDoorWarp_lower.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_lower.png rename to src/main/resources/assets/dimdoors/textures/blocks/dimDoorWarp_lower.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_upper.png b/src/main/resources/assets/dimdoors/textures/blocks/dimDoorWarp_upper.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorWarp_upper.png rename to src/main/resources/assets/dimdoors/textures/blocks/dimDoorWarp_upper.png