Finished DimensionalDoor
This commit is contained in:
parent
863f5644e0
commit
6480fb386c
8 changed files with 72 additions and 8 deletions
|
@ -3,8 +3,11 @@ package com.zixiken.dimdoors.blocks;
|
||||||
import com.zixiken.dimdoors.core.DimLink;
|
import com.zixiken.dimdoors.core.DimLink;
|
||||||
import com.zixiken.dimdoors.core.PocketManager;
|
import com.zixiken.dimdoors.core.PocketManager;
|
||||||
import com.zixiken.dimdoors.DimDoors;
|
import com.zixiken.dimdoors.DimDoors;
|
||||||
|
import net.minecraft.block.BlockDoor;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import com.zixiken.dimdoors.core.LinkType;
|
import com.zixiken.dimdoors.core.LinkType;
|
||||||
import com.zixiken.dimdoors.core.NewDimData;
|
import com.zixiken.dimdoors.core.NewDimData;
|
||||||
|
@ -20,16 +23,13 @@ public class DimensionalDoor extends BaseDimDoor {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void placeLink(World world, int x, int y, int z)
|
public void placeLink(World world, BlockPos pos) {
|
||||||
{
|
IBlockState state = world.getBlockState(pos.down());
|
||||||
if (!world.isRemote && world.getBlock(x, y - 1, z) == this)
|
if (!world.isRemote && state.getBlock() == this) {
|
||||||
{
|
|
||||||
NewDimData dimension = PocketManager.createDimensionData(world);
|
NewDimData dimension = PocketManager.createDimensionData(world);
|
||||||
DimLink link = dimension.getLink(x, y, z);
|
DimLink link = dimension.getLink(pos);
|
||||||
if (link == null)
|
if (link == null)
|
||||||
{
|
dimension.createLink(pos, LinkType.POCKET, state.getValue(BlockDoor.FACING));
|
||||||
dimension.createLink(x, y, z, LinkType.POCKET,world.getBlockMetadata(x, y - 1, z));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
36
src/main/resources/assets/dimdoors/blockstates/dimDoor.json
Normal file
36
src/main/resources/assets/dimdoors/blockstates/dimDoor.json
Normal 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 }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"parent": "block/door_bottom",
|
||||||
|
"textures": {
|
||||||
|
"bottom": "blocks/dimDoor_lower",
|
||||||
|
"top": "blocks/dimDoor_upper"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"parent": "block/door_bottom_rh",
|
||||||
|
"textures": {
|
||||||
|
"bottom": "blocks/dimDoor_lower",
|
||||||
|
"top": "blocks/DimDoor_upper"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"parent": "block/door_top",
|
||||||
|
"textures": {
|
||||||
|
"bottom": "blocks/dimDoor_lower",
|
||||||
|
"top": "blocks/dimDoor_upper"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"parent": "block/door_top_rh",
|
||||||
|
"textures": {
|
||||||
|
"bottom": "blocks/dimDoor_lower",
|
||||||
|
"top": "blocks/dimDoor_upper"
|
||||||
|
}
|
||||||
|
}
|
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 625 B |
Before Width: | Height: | Size: 540 B After Width: | Height: | Size: 540 B |
Loading…
Reference in a new issue