Finished UnstableDoor, fixed a typo.

UnstableDoor's lower texture is the same as an iron door.
This commit is contained in:
Michael Zanga 2016-07-29 09:24:59 -04:00
parent 8e26caa13f
commit 07d6a1f120
9 changed files with 76 additions and 16 deletions

View file

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

View file

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

View file

@ -0,0 +1,7 @@
{
"parent": "block/door_bottom",
"textures": {
"bottom": "blocks/door_iron_lower",
"top": "blocks/chaosDoor_upper"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "block/door_bottom_rh",
"textures": {
"bottom": "blocks/door_iron_lower",
"top": "blocks/chaosDoor_upper"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "block/door_top",
"textures": {
"bottom": "blocks/door_iron_lower",
"top": "blocks/chaosDoor_upper"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "block/door_top_rh",
"textures": {
"bottom": "blocks/door_iron_lower",
"top": "blocks/chaosDoor_upper"
}
}

View file

@ -2,6 +2,6 @@
"parent": "block/door_bottom_rh",
"textures": {
"bottom": "blocks/dimDoor_lower",
"top": "blocks/DimDoor_upper"
"top": "blocks/dimDoor_upper"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B