diff --git a/src/main/java/com/zixiken/dimdoors/blocks/UnstableDoor.java b/src/main/java/com/zixiken/dimdoors/blocks/UnstableDoor.java index adc445b7..4a41fd8b 100644 --- a/src/main/java/com/zixiken/dimdoors/blocks/UnstableDoor.java +++ b/src/main/java/com/zixiken/dimdoors/blocks/UnstableDoor.java @@ -4,9 +4,12 @@ import com.zixiken.dimdoors.DimDoors; import com.zixiken.dimdoors.core.LinkType; import com.zixiken.dimdoors.core.NewDimData; import com.zixiken.dimdoors.core.PocketManager; +import net.minecraft.block.BlockDoor; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import java.util.Random; @@ -22,24 +25,17 @@ public class UnstableDoor 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) { + IBlockState state = world.getBlockState(pos.down()); + if (!world.isRemote && state.getBlock() == this) { NewDimData dimension = PocketManager.getDimensionData(world); - dimension.createLink(x, y, z, LinkType.RANDOM,world.getBlockMetadata(x, y - 1, z)); + dimension.createLink(pos, LinkType.RANDOM, state.getValue(BlockDoor.FACING)); } } @Override - public Item getDoorItem() - { - return DimDoors.itemUnstableDoor; - } - - @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) - { - return Items.iron_door; - } + public Item getDoorItem() {return DimDoors.itemUnstableDoor;} + + @Override + public Item getItemDropped(IBlockState state, Random random, int fortune) {return Items.iron_door;} } \ No newline at end of file diff --git a/src/main/resources/assets/dimdoors/blockstates/chaosDoor.json b/src/main/resources/assets/dimdoors/blockstates/chaosDoor.json new file mode 100644 index 00000000..372c602c --- /dev/null +++ b/src/main/resources/assets/dimdoors/blockstates/chaosDoor.json @@ -0,0 +1,36 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { "model": "chaosDoor_bottom" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "chaosDoor_bottom", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "chaosDoor_bottom", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "chaosDoor_bottom", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "chaosDoor_bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "chaosDoor_bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "chaosDoor_bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "chaosDoor_bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "chaosDoor_bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "chaosDoor_bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "chaosDoor_bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "chaosDoor_bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "chaosDoor_bottom", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "chaosDoor_bottom" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "chaosDoor_bottom", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "chaosDoor_bottom", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "chaosDoor_top" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "chaosDoor_top", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "chaosDoor_top", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "chaosDoor_top", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "chaosDoor_top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "chaosDoor_top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "chaosDoor_top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "chaosDoor_top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "chaosDoor_top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "chaosDoor_top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "chaosDoor_top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "chaosDoor_top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "chaosDoor_top", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "chaosDoor_top" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "chaosDoor_top", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "chaosDoor_top", "y": 180 } + } +} diff --git a/src/main/resources/assets/dimdoors/models/block/chaosDoor_bottom.json b/src/main/resources/assets/dimdoors/models/block/chaosDoor_bottom.json new file mode 100644 index 00000000..96d0c2c0 --- /dev/null +++ b/src/main/resources/assets/dimdoors/models/block/chaosDoor_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom", + "textures": { + "bottom": "blocks/door_iron_lower", + "top": "blocks/chaosDoor_upper" + } +} diff --git a/src/main/resources/assets/dimdoors/models/block/chaosDoor_bottom_rh.json b/src/main/resources/assets/dimdoors/models/block/chaosDoor_bottom_rh.json new file mode 100644 index 00000000..19fe9eda --- /dev/null +++ b/src/main/resources/assets/dimdoors/models/block/chaosDoor_bottom_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom_rh", + "textures": { + "bottom": "blocks/door_iron_lower", + "top": "blocks/chaosDoor_upper" + } +} diff --git a/src/main/resources/assets/dimdoors/models/block/chaosDoor_top.json b/src/main/resources/assets/dimdoors/models/block/chaosDoor_top.json new file mode 100644 index 00000000..fb7edc8d --- /dev/null +++ b/src/main/resources/assets/dimdoors/models/block/chaosDoor_top.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top", + "textures": { + "bottom": "blocks/door_iron_lower", + "top": "blocks/chaosDoor_upper" + } +} diff --git a/src/main/resources/assets/dimdoors/models/block/chaosDoor_top_rh.json b/src/main/resources/assets/dimdoors/models/block/chaosDoor_top_rh.json new file mode 100644 index 00000000..3a675485 --- /dev/null +++ b/src/main/resources/assets/dimdoors/models/block/chaosDoor_top_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top_rh", + "textures": { + "bottom": "blocks/door_iron_lower", + "top": "blocks/chaosDoor_upper" + } +} diff --git a/src/main/resources/assets/dimdoors/models/block/dimDoor_bottom_rh.json b/src/main/resources/assets/dimdoors/models/block/dimDoor_bottom_rh.json index 14b767be..ca9dfc02 100644 --- a/src/main/resources/assets/dimdoors/models/block/dimDoor_bottom_rh.json +++ b/src/main/resources/assets/dimdoors/models/block/dimDoor_bottom_rh.json @@ -2,6 +2,6 @@ "parent": "block/door_bottom_rh", "textures": { "bottom": "blocks/dimDoor_lower", - "top": "blocks/DimDoor_upper" + "top": "blocks/dimDoor_upper" } } diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_upper.png b/src/main/resources/assets/dimdoors/textures/blocks/chaosDoor_upper.png similarity index 100% rename from src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_upper.png rename to src/main/resources/assets/dimdoors/textures/blocks/chaosDoor_upper.png diff --git a/src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_lower.png b/src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_lower.png deleted file mode 100644 index dbc33ab4..00000000 Binary files a/src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_lower.png and /dev/null differ