Finished DimensionalDoor

This commit is contained in:
zangamj 2016-07-20 14:32:03 -04:00
parent 863f5644e0
commit 6480fb386c
8 changed files with 72 additions and 8 deletions

View file

@ -3,8 +3,11 @@ package com.zixiken.dimdoors.blocks;
import com.zixiken.dimdoors.core.DimLink;
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;
import com.zixiken.dimdoors.core.LinkType;
import com.zixiken.dimdoors.core.NewDimData;
@ -20,16 +23,13 @@ public class DimensionalDoor 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.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, state.getValue(BlockDoor.FACING));
}
}

View file

@ -0,0 +1,36 @@
{
"variants": {
"facing=east,half=lower,hinge=left,open=false": { "model": "dimDoor_bottom" },
"facing=south,half=lower,hinge=left,open=false": { "model": "dimDoor_bottom", "y": 90 },
"facing=west,half=lower,hinge=left,open=false": { "model": "dimDoor_bottom", "y": 180 },
"facing=north,half=lower,hinge=left,open=false": { "model": "dimDoor_bottom", "y": 270 },
"facing=east,half=lower,hinge=right,open=false": { "model": "dimDoor_bottom_rh" },
"facing=south,half=lower,hinge=right,open=false": { "model": "dimDoor_bottom_rh", "y": 90 },
"facing=west,half=lower,hinge=right,open=false": { "model": "dimDoor_bottom_rh", "y": 180 },
"facing=north,half=lower,hinge=right,open=false": { "model": "dimDoor_bottom_rh", "y": 270 },
"facing=east,half=lower,hinge=left,open=true": { "model": "dimDoor_bottom_rh", "y": 90 },
"facing=south,half=lower,hinge=left,open=true": { "model": "dimDoor_bottom_rh", "y": 180 },
"facing=west,half=lower,hinge=left,open=true": { "model": "dimDoor_bottom_rh", "y": 270 },
"facing=north,half=lower,hinge=left,open=true": { "model": "dimDoor_bottom_rh" },
"facing=east,half=lower,hinge=right,open=true": { "model": "dimDoor_bottom", "y": 270 },
"facing=south,half=lower,hinge=right,open=true": { "model": "dimDoor_bottom" },
"facing=west,half=lower,hinge=right,open=true": { "model": "dimDoor_bottom", "y": 90 },
"facing=north,half=lower,hinge=right,open=true": { "model": "dimDoor_bottom", "y": 180 },
"facing=east,half=upper,hinge=left,open=false": { "model": "dimDoor_top" },
"facing=south,half=upper,hinge=left,open=false": { "model": "dimDoor_top", "y": 90 },
"facing=west,half=upper,hinge=left,open=false": { "model": "dimDoor_top", "y": 180 },
"facing=north,half=upper,hinge=left,open=false": { "model": "dimDoor_top", "y": 270 },
"facing=east,half=upper,hinge=right,open=false": { "model": "dimDoor_top_rh" },
"facing=south,half=upper,hinge=right,open=false": { "model": "dimDoor_top_rh", "y": 90 },
"facing=west,half=upper,hinge=right,open=false": { "model": "dimDoor_top_rh", "y": 180 },
"facing=north,half=upper,hinge=right,open=false": { "model": "dimDoor_top_rh", "y": 270 },
"facing=east,half=upper,hinge=left,open=true": { "model": "dimDoor_top_rh", "y": 90 },
"facing=south,half=upper,hinge=left,open=true": { "model": "dimDoor_top_rh", "y": 180 },
"facing=west,half=upper,hinge=left,open=true": { "model": "dimDoor_top_rh", "y": 270 },
"facing=north,half=upper,hinge=left,open=true": { "model": "dimDoor_top_rh" },
"facing=east,half=upper,hinge=right,open=true": { "model": "dimDoor_top", "y": 270 },
"facing=south,half=upper,hinge=right,open=true": { "model": "dimDoor_top" },
"facing=west,half=upper,hinge=right,open=true": { "model": "dimDoor_top", "y": 90 },
"facing=north,half=upper,hinge=right,open=true": { "model": "dimDoor_top", "y": 180 }
}
}

View file

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

View file

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

View file

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

View file

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