From 07d6a1f120f66592e0ad0f193b6df68b020057c1 Mon Sep 17 00:00:00 2001 From: Michael Zanga Date: Fri, 29 Jul 2016 09:24:59 -0400 Subject: [PATCH] Finished UnstableDoor, fixed a typo. UnstableDoor's lower texture is the same as an iron door. --- .../zixiken/dimdoors/blocks/UnstableDoor.java | 26 ++++++------- .../dimdoors/blockstates/chaosDoor.json | 36 ++++++++++++++++++ .../models/block/chaosDoor_bottom.json | 7 ++++ .../models/block/chaosDoor_bottom_rh.json | 7 ++++ .../dimdoors/models/block/chaosDoor_top.json | 7 ++++ .../models/block/chaosDoor_top_rh.json | 7 ++++ .../models/block/dimDoor_bottom_rh.json | 2 +- ...haosDoor_upper.png => chaosDoor_upper.png} | Bin .../textures/blocks/tile.chaosDoor_lower.png | Bin 551 -> 0 bytes 9 files changed, 76 insertions(+), 16 deletions(-) create mode 100644 src/main/resources/assets/dimdoors/blockstates/chaosDoor.json create mode 100644 src/main/resources/assets/dimdoors/models/block/chaosDoor_bottom.json create mode 100644 src/main/resources/assets/dimdoors/models/block/chaosDoor_bottom_rh.json create mode 100644 src/main/resources/assets/dimdoors/models/block/chaosDoor_top.json create mode 100644 src/main/resources/assets/dimdoors/models/block/chaosDoor_top_rh.json rename src/main/resources/assets/dimdoors/textures/blocks/{tile.chaosDoor_upper.png => chaosDoor_upper.png} (100%) delete mode 100644 src/main/resources/assets/dimdoors/textures/blocks/tile.chaosDoor_lower.png 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 dbc33ab4758bb844515f5c51a82167ebce91ead2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 551 zcmV+?0@(eDP)&5w#a=LRy%8E*5)Xe%Z1HmgXwgN z^?EJ&ZnqO$uUE`wGs(Bxt;|=e6^_Rv=JPpPtrpb%e#hZ(!0+#`3~slZ;P3BG2=@EE z#Pj)#)9EBc6d8?1s8*{`kHwnU8*b=3yHj!kye=x1_L3Zs#d2X_CG&Ap)Qxp z^Cm9o8#TB@yZwG2y+oiBrEHIf& pFq_TKnz;sNZ*Olf8jS+x{{UWX>N3JF*7g7Z002ovPDHLkV1ik70)PMj