diff --git a/src/main/java/com/zixiken/dimdoors/blocks/BlockGoldDimDoor.java b/src/main/java/com/zixiken/dimdoors/blocks/BlockGoldDimDoor.java index a33ef729..8689490b 100644 --- a/src/main/java/com/zixiken/dimdoors/blocks/BlockGoldDimDoor.java +++ b/src/main/java/com/zixiken/dimdoors/blocks/BlockGoldDimDoor.java @@ -7,9 +7,11 @@ import com.zixiken.dimdoors.core.NewDimData; import com.zixiken.dimdoors.core.PocketManager; import com.zixiken.dimdoors.tileentities.TileEntityDimDoorGold; +import net.minecraft.block.BlockDoor; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; public class BlockGoldDimDoor extends BaseDimDoor { @@ -22,16 +24,12 @@ public class BlockGoldDimDoor extends BaseDimDoor { } @Override - public void placeLink(World world, int x, int y, int z) - { - if (!world.isRemote && world.getBlock(x, y - 1, z) == this) - { + public void placeLink(World world, BlockPos pos) { + if (!world.isRemote && world.getBlockState(pos.down()).getBlock() == this) { NewDimData dimension = PocketManager.createDimensionData(world); - DimLink link = dimension.getLink(x, y, z); + DimLink link = dimension.getLink(pos); if (link == null) - { - dimension.createLink(x, y, z, LinkType.POCKET,world.getBlockMetadata(x, y - 1, z)); - } + dimension.createLink(pos, LinkType.POCKET, world.getBlockState(pos.down()).getValue(BlockDoor.FACING)); } } diff --git a/src/main/resources/assets/dimdoors/blockstates/dimDoorGold.json b/src/main/resources/assets/dimdoors/blockstates/dimDoorGold.json new file mode 100644 index 00000000..a2451a9e --- /dev/null +++ b/src/main/resources/assets/dimdoors/blockstates/dimDoorGold.json @@ -0,0 +1,36 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { "model": "doorGold_bottom" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "doorGold_bottom", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "doorGold_bottom", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "doorGold_bottom", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "doorGold_bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "doorGold_bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "doorGold_bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "doorGold_bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "doorGold_bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "doorGold_bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "doorGold_bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "doorGold_bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "doorGold_bottom", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "doorGold_bottom" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "doorGold_bottom", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "doorGold_bottom", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "doorGold_top" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "doorGold_top", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "doorGold_top", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "doorGold_top", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "doorGold_top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "doorGold_top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "doorGold_top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "doorGold_top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "doorGold_top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "doorGold_top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "doorGold_top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "doorGold_top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "doorGold_top", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "doorGold_top" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "doorGold_top", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "doorGold_top", "y": 180 } + } +} diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_lower.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_lower.png deleted file mode 100644 index 9e00119f..00000000 Binary files a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_lower.png and /dev/null differ diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_upper.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_upper.png deleted file mode 100644 index af4d1a82..00000000 Binary files a/src/main/resources/assets/dimdoors/textures/blocks/tile.dimDoorGold_upper.png and /dev/null differ