DimDoors/StevenDimDoors/mod_pocketDim/commands/CommandEndDungeonCreation.java

78 lines
2.3 KiB
Java
Raw Normal View History

2013-06-02 03:43:56 +02:00
package StevenDimDoors.mod_pocketDim.commands;
import StevenDimDoors.mod_pocketDim.DDProperties;
2013-06-11 20:42:11 +02:00
import StevenDimDoors.mod_pocketDim.DungeonGenerator;
2013-06-02 03:43:56 +02:00
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
2013-06-02 03:43:56 +02:00
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
2013-06-02 03:43:56 +02:00
public class CommandEndDungeonCreation extends CommandBase
{
private static DDProperties properties = null;
public CommandEndDungeonCreation()
{
if (properties == null)
properties = DDProperties.instance();
}
2013-06-02 03:43:56 +02:00
public String getCommandName()//the name of our command
{
return "dimdoors-endDungeonCreation";
2013-06-02 03:43:56 +02:00
}
@Override
public void processCommand(ICommandSender var1, String[] var2)
{
EntityPlayer player =this.getCommandSenderAsPlayer(var1);
if(!mod_pocketDim.dungeonHelper.customDungeonStatus.containsKey(player.worldObj.provider.dimensionId))
{
2013-06-09 23:44:23 +02:00
if(var2.length<2)
{
player.sendChatToPlayer("Must have started dungeon creation, use argument OVERRIDE to export anyway");
return;
}
2013-06-09 23:44:23 +02:00
else if(!var2[1].contains("OVERRIDE"))
{
player.sendChatToPlayer("Must have started dungeon creation, use argument OVERRIDE to export anyway");
return;
}
}
int x = (int) player.posX;
int y = (int) player.posY;
int z = (int) player.posZ;
2013-06-02 03:43:56 +02:00
2013-06-04 14:52:06 +02:00
if(var2.length==0)
{
player.sendChatToPlayer("Must name file");
2013-06-04 14:52:06 +02:00
}
2013-06-11 06:41:40 +02:00
else if(!player.worldObj.isRemote)
2013-06-04 14:52:06 +02:00
{
DungeonGenerator newDungeon = mod_pocketDim.dungeonHelper.exportDungeon(player.worldObj, x, y, z, properties.CustomSchematicDirectory + "/" + var2[0] + ".schematic");
player.sendChatToPlayer("created dungeon schematic in " + properties.CustomSchematicDirectory +"/"+var2[0]+".schematic");
mod_pocketDim.dungeonHelper.customDungeons.add(newDungeon);
if(mod_pocketDim.dungeonHelper.customDungeonStatus.containsKey(player.worldObj.provider.dimensionId)&&!player.worldObj.isRemote)
2013-06-09 23:44:23 +02:00
{
2013-06-11 06:41:40 +02:00
// mod_pocketDim.dungeonHelper.customDungeonStatus.remove(player.worldObj.provider.dimensionId);
// dimHelper.instance.teleportToPocket(player.worldObj, mod_pocketDim.dungeonHelper.customDungeonStatus.get(player.worldObj.provider.dimensionId), player);
2013-06-04 14:52:06 +02:00
2013-06-09 23:44:23 +02:00
}
2013-06-04 14:52:06 +02:00
}
2013-06-02 03:43:56 +02:00
// TODO Auto-generated method stub
}
}