DimDoors/StevenDimDoors/mod_pocketDim/commands/CommandCreatePocket.java

49 lines
1.4 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;
import StevenDimDoors.mod_pocketDim.core.NewLinkData;
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
2013-06-02 03:43:56 +02:00
public class CommandCreatePocket extends DDCommandBase
2013-06-02 03:43:56 +02:00
{
private static CommandCreatePocket instance = null;
private CommandCreatePocket()
{
super("dd-create", "");
}
public static CommandCreatePocket instance()
2013-06-02 03:43:56 +02:00
{
if (instance == null)
instance = new CommandCreatePocket();
return instance;
2013-06-02 03:43:56 +02:00
}
@Override
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
2013-06-02 03:43:56 +02:00
{
//TODO: Some commands have isRemote checks, some do not. Why? Can commands even run locally anyway?
//What does it mean when you run a command locally? ~SenseiKiwi
if (!sender.worldObj.isRemote)
2013-06-10 06:16:49 +02:00
{
if (command.length > 0)
{
return DDCommandResult.TOO_MANY_ARGUMENTS;
}
//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;
NewLinkData 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 (Dimension ID = " + link.destDimID + "). Please build your dungeon there.");
2013-06-10 06:16:49 +02:00
}
return DDCommandResult.SUCCESS;
2013-06-02 03:43:56 +02:00
}
}