DimDoors/StevenDimDoors/mod_pocketDim/commands/CommandStartDungeonCreation.java

40 lines
1.2 KiB
Java
Raw Normal View History

2013-06-02 03:43:56 +02:00
package StevenDimDoors.mod_pocketDim.commands;
import net.minecraft.entity.player.EntityPlayer;
2013-06-02 03:43:56 +02:00
import StevenDimDoors.mod_pocketDim.LinkData;
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
2013-06-02 03:43:56 +02:00
public class CommandStartDungeonCreation extends DDCommandBase
2013-06-02 03:43:56 +02:00
{
private static CommandStartDungeonCreation instance = null;
private CommandStartDungeonCreation()
{
super("dd-create");
}
public static CommandStartDungeonCreation instance()
2013-06-02 03:43:56 +02:00
{
if (instance == null)
instance = new CommandStartDungeonCreation();
return instance;
2013-06-02 03:43:56 +02:00
}
@Override
protected void processCommand(EntityPlayer sender, String[] command)
2013-06-02 03:43:56 +02:00
{
if (!sender.worldObj.isRemote)
2013-06-10 06:16:49 +02:00
{
//Place a door leading to a pocket dimension where the player is standing.
//The pocket dimension will be serve as a room for the player to build a dungeon.
int x = (int) sender.posX;
int y = (int) sender.posY;
int z = (int) sender.posZ;
LinkData link = DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z);
2013-06-11 06:41:40 +02:00
//Notify the player
sender.sendChatToPlayer("Created a door to a pocket dimension (ID = " + link.destDimID + "). Please build your dungeon there.");
2013-06-10 06:16:49 +02:00
}
2013-06-02 03:43:56 +02:00
}
}