2013-04-17 02:48:49 +02:00
|
|
|
package StevenDimDoors.mod_pocketDim.blocks;
|
2013-02-18 03:46:16 +01:00
|
|
|
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.world.World;
|
2013-09-07 02:57:00 +02:00
|
|
|
import StevenDimDoors.mod_pocketDim.DDProperties;
|
2013-09-02 17:47:12 +02:00
|
|
|
import StevenDimDoors.mod_pocketDim.core.DimLink;
|
|
|
|
import StevenDimDoors.mod_pocketDim.core.LinkTypes;
|
2013-08-29 08:14:24 +02:00
|
|
|
import StevenDimDoors.mod_pocketDim.core.NewDimData;
|
|
|
|
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
2013-02-18 03:46:16 +01:00
|
|
|
|
2013-09-07 02:57:00 +02:00
|
|
|
public class WarpDoor extends BaseDimDoor
|
2013-02-18 03:46:16 +01:00
|
|
|
{
|
2013-09-07 02:57:00 +02:00
|
|
|
public WarpDoor(int blockID, Material material, DDProperties properties)
|
2013-08-29 08:14:24 +02:00
|
|
|
{
|
2013-09-07 02:57:00 +02:00
|
|
|
super(blockID, material, properties);
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|
2013-03-29 23:19:27 +01:00
|
|
|
|
2013-08-29 08:14:24 +02:00
|
|
|
@Override
|
2013-09-06 08:07:47 +02:00
|
|
|
public void placeDimDoor(World world, int x, int y, int z)
|
2013-08-29 08:14:24 +02:00
|
|
|
{
|
|
|
|
if (!world.isRemote && world.getBlockId(x, y - 1, z) == this.blockID)
|
|
|
|
{
|
|
|
|
NewDimData dimension = PocketManager.getDimensionData(world);
|
2013-09-02 17:47:12 +02:00
|
|
|
DimLink link = dimension.getLink(x, y, z);
|
2013-09-07 02:57:00 +02:00
|
|
|
if (link == null && dimension.isPocketDimension())
|
2013-02-18 03:46:16 +01:00
|
|
|
{
|
2013-09-02 17:47:12 +02:00
|
|
|
dimension.createLink(x, y, z, LinkTypes.SAFE_EXIT);
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-09-06 08:07:47 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getDrops()
|
2013-08-29 08:14:24 +02:00
|
|
|
{
|
|
|
|
return Item.doorWood.itemID;
|
|
|
|
}
|
2013-02-18 03:46:16 +01:00
|
|
|
}
|