Finished WarpDoor.
This commit is contained in:
parent
07d6a1f120
commit
cecdc7c12c
8 changed files with 69 additions and 6 deletions
|
@ -6,6 +6,7 @@ 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;
|
||||
|
@ -22,18 +23,16 @@ public class WarpDoor extends BaseDimDoor {
|
|||
|
||||
@Override
|
||||
public void placeLink(World world, BlockPos pos) {
|
||||
if (!world.isRemote && world.getBlockState(pos.down()) == this) {
|
||||
IBlockState state = world.getBlockState(pos.down());
|
||||
if (!world.isRemote && state.getBlock() == this) {
|
||||
NewDimData dimension = PocketManager.createDimensionData(world);
|
||||
DimLink link = dimension.getLink(pos);
|
||||
if (link == null && dimension.isPocketDimension()) {
|
||||
dimension.createLink(pos, LinkType.SAFE_EXIT,world. getBlockState(pos.down()).getValue(BlockDoor.FACING));
|
||||
dimension.createLink(pos, LinkType.SAFE_EXIT, state.getValue(BlockDoor.FACING));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getDoorItem()
|
||||
{
|
||||
return DimDoors.itemWarpDoor;
|
||||
}
|
||||
public Item getDoorItem() {return DimDoors.itemWarpDoor;}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=east,half=lower,hinge=left,open=false": { "model": "dimDoorWarp_bottom" },
|
||||
"facing=south,half=lower,hinge=left,open=false": { "model": "dimDoorWarp_bottom", "y": 90 },
|
||||
"facing=west,half=lower,hinge=left,open=false": { "model": "dimDoorWarp_bottom", "y": 180 },
|
||||
"facing=north,half=lower,hinge=left,open=false": { "model": "dimDoorWarp_bottom", "y": 270 },
|
||||
"facing=east,half=lower,hinge=right,open=false": { "model": "dimDoorWarp_bottom_rh" },
|
||||
"facing=south,half=lower,hinge=right,open=false": { "model": "dimDoorWarp_bottom_rh", "y": 90 },
|
||||
"facing=west,half=lower,hinge=right,open=false": { "model": "dimDoorWarp_bottom_rh", "y": 180 },
|
||||
"facing=north,half=lower,hinge=right,open=false": { "model": "dimDoorWarp_bottom_rh", "y": 270 },
|
||||
"facing=east,half=lower,hinge=left,open=true": { "model": "dimDoorWarp_bottom_rh", "y": 90 },
|
||||
"facing=south,half=lower,hinge=left,open=true": { "model": "dimDoorWarp_bottom_rh", "y": 180 },
|
||||
"facing=west,half=lower,hinge=left,open=true": { "model": "dimDoorWarp_bottom_rh", "y": 270 },
|
||||
"facing=north,half=lower,hinge=left,open=true": { "model": "dimDoorWarp_bottom_rh" },
|
||||
"facing=east,half=lower,hinge=right,open=true": { "model": "dimDoorWarp_bottom", "y": 270 },
|
||||
"facing=south,half=lower,hinge=right,open=true": { "model": "dimDoorWarp_bottom" },
|
||||
"facing=west,half=lower,hinge=right,open=true": { "model": "dimDoorWarp_bottom", "y": 90 },
|
||||
"facing=north,half=lower,hinge=right,open=true": { "model": "dimDoorWarp_bottom", "y": 180 },
|
||||
"facing=east,half=upper,hinge=left,open=false": { "model": "dimDoorWarp_top" },
|
||||
"facing=south,half=upper,hinge=left,open=false": { "model": "dimDoorWarp_top", "y": 90 },
|
||||
"facing=west,half=upper,hinge=left,open=false": { "model": "dimDoorWarp_top", "y": 180 },
|
||||
"facing=north,half=upper,hinge=left,open=false": { "model": "dimDoorWarp_top", "y": 270 },
|
||||
"facing=east,half=upper,hinge=right,open=false": { "model": "dimDoorWarp_top_rh" },
|
||||
"facing=south,half=upper,hinge=right,open=false": { "model": "dimDoorWarp_top_rh", "y": 90 },
|
||||
"facing=west,half=upper,hinge=right,open=false": { "model": "dimDoorWarp_top_rh", "y": 180 },
|
||||
"facing=north,half=upper,hinge=right,open=false": { "model": "dimDoorWarp_top_rh", "y": 270 },
|
||||
"facing=east,half=upper,hinge=left,open=true": { "model": "dimDoorWarp_top_rh", "y": 90 },
|
||||
"facing=south,half=upper,hinge=left,open=true": { "model": "dimDoorWarp_top_rh", "y": 180 },
|
||||
"facing=west,half=upper,hinge=left,open=true": { "model": "dimDoorWarp_top_rh", "y": 270 },
|
||||
"facing=north,half=upper,hinge=left,open=true": { "model": "dimDoorWarp_top_rh" },
|
||||
"facing=east,half=upper,hinge=right,open=true": { "model": "dimDoorWarp_top", "y": 270 },
|
||||
"facing=south,half=upper,hinge=right,open=true": { "model": "dimDoorWarp_top" },
|
||||
"facing=west,half=upper,hinge=right,open=true": { "model": "dimDoorWarp_top", "y": 90 },
|
||||
"facing=north,half=upper,hinge=right,open=true": { "model": "dimDoorWarp_top", "y": 180 }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"parent": "block/door_bottom",
|
||||
"textures": {
|
||||
"bottom": "blocks/dimDoorWarp_lower",
|
||||
"top": "blocks/dimDoorWarp_upper"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"parent": "block/door_bottom_rh",
|
||||
"textures": {
|
||||
"bottom": "blocks/dimDoorWarp_lower",
|
||||
"top": "blocks/dimDoorWarp_upper"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"parent": "block/door_top",
|
||||
"textures": {
|
||||
"bottom": "blocks/dimDoorWarp_lower",
|
||||
"top": "blocks/dimDoorWarp_upper"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"parent": "block/door_top_rh",
|
||||
"textures": {
|
||||
"bottom": "blocks/dimDoorWarp_lower",
|
||||
"top": "blocks/dimDoorWarp_upper"
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 778 B |
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 698 B |
Loading…
Reference in a new issue