bc2745a596
Made progress on overhauling and prettifying our commands. There are still more changes to be done for this to be functional. I need to do an intermediate commit because I want to merge in recent changes by Steven.
49 lines
No EOL
1.5 KiB
Java
49 lines
No EOL
1.5 KiB
Java
package StevenDimDoors.mod_pocketDim.commands;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import StevenDimDoors.mod_pocketDim.LinkData;
|
|
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
|
|
|
public class CommandStartDungeonCreation extends DDCommandBase
|
|
{
|
|
private static CommandStartDungeonCreation instance = null;
|
|
|
|
private CommandStartDungeonCreation()
|
|
{
|
|
super("dd-create", "");
|
|
}
|
|
|
|
public static CommandStartDungeonCreation instance()
|
|
{
|
|
if (instance == null)
|
|
instance = new CommandStartDungeonCreation();
|
|
|
|
return instance;
|
|
}
|
|
|
|
@Override
|
|
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
|
{
|
|
//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)
|
|
{
|
|
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;
|
|
LinkData link = DungeonHelper.instance().createCustomDungeonDoor(sender.worldObj, x, y, z);
|
|
|
|
//Notify the player
|
|
sender.sendChatToPlayer("Created a door to a pocket dimension (Dimension ID = " + link.destDimID + "). Please build your dungeon there.");
|
|
}
|
|
return DDCommandResult.SUCCESS;
|
|
}
|
|
} |