finished dungeon export basic implementation
This commit is contained in:
@@ -68,12 +68,28 @@ public class CommandAddDungeonRift extends CommandBase
|
||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer(dungeonName);
|
||||
|
||||
}
|
||||
|
||||
for(DungeonGenerator dungeonGen : mod_pocketDim.customDungeons)
|
||||
{
|
||||
String dungeonName =dungeonGen.schematicPath;
|
||||
if(dungeonName.contains("DimDoors_Custom_schematics"))
|
||||
{
|
||||
dungeonName= dungeonName.substring(dungeonName.indexOf("DimDoors_Custom_schematics")+26);
|
||||
}
|
||||
|
||||
dungeonName =dungeonName.replace("/", "").replace(".", "").replace("schematics", "").replace("schematic", "");
|
||||
|
||||
|
||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer(dungeonName);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if(var2.length!=0)
|
||||
{
|
||||
for(DungeonGenerator dungeonGen : mod_pocketDim.registeredDungeons)
|
||||
|
||||
for(DungeonGenerator dungeonGen : mod_pocketDim.registeredDungeons)
|
||||
{
|
||||
String dungeonName =dungeonGen.schematicPath.toLowerCase();
|
||||
|
||||
@@ -93,7 +109,37 @@ public class CommandAddDungeonRift extends CommandBase
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
for(DungeonGenerator dungeonGen : mod_pocketDim.customDungeons)
|
||||
{
|
||||
String dungeonName =dungeonGen.schematicPath.toLowerCase();
|
||||
|
||||
|
||||
|
||||
if(dungeonName.contains(var2[0].toLowerCase()))
|
||||
{
|
||||
|
||||
link = dimHelper.instance.createPocket(link,true, true);
|
||||
|
||||
dimHelper.dimList.get(link.destDimID).dungeonGenerator=dungeonGen;
|
||||
|
||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Genned dungeon " +dungeonName);
|
||||
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(var2!=null&&!var2[0].equals("random"))
|
||||
{
|
||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("could not find dungeon, 'list' for list of dungeons");
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.DungeonGenerator;
|
||||
import StevenDimDoors.mod_pocketDim.customDungeonImporter;
|
||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class CommandEndDungeonCreation extends CommandBase
|
||||
{
|
||||
@@ -19,18 +22,41 @@ public class CommandEndDungeonCreation extends CommandBase
|
||||
public void processCommand(ICommandSender var1, String[] var2)
|
||||
|
||||
{
|
||||
int x = (int) this.getCommandSenderAsPlayer(var1).posX;
|
||||
int y = (int) this.getCommandSenderAsPlayer(var1).posY;
|
||||
int z = (int) this.getCommandSenderAsPlayer(var1).posZ;
|
||||
|
||||
EntityPlayer player =this.getCommandSenderAsPlayer(var1);
|
||||
|
||||
if(!customDungeonImporter.customDungeonStatus.containsKey(player.worldObj.provider.dimensionId))
|
||||
{
|
||||
if(var2.length==0)
|
||||
{
|
||||
player.sendChatToPlayer("Must have started dungeon creation, use argument OVERRIDE to export anyway");
|
||||
return;
|
||||
|
||||
}
|
||||
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;
|
||||
|
||||
if(var2.length==0)
|
||||
{
|
||||
System.out.println("Must name file");
|
||||
player.sendChatToPlayer("Must name file");
|
||||
}
|
||||
else
|
||||
{
|
||||
customDungeonImporter.exportDungeon(this.getCommandSenderAsPlayer(var1).worldObj, x, y, z, mod_pocketDim.schematicContainer+"/"+var2[0]);
|
||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("created dungeon schematic in " +mod_pocketDim.schematicContainer+"/"+var2[0]);
|
||||
DungeonGenerator newDungeon = customDungeonImporter.exportDungeon(player.worldObj, x, y, z, mod_pocketDim.schematicContainer+"/"+var2[0]+".schematic");
|
||||
player.sendChatToPlayer("created dungeon schematic in " +mod_pocketDim.schematicContainer+"/"+var2[0]+".schematic");
|
||||
mod_pocketDim.customDungeons.add(newDungeon);
|
||||
|
||||
dimHelper.instance.teleportToPocket(player.worldObj, customDungeonImporter.customDungeonStatus.get(player.worldObj.provider.dimensionId), player);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package StevenDimDoors.mod_pocketDim.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.DimData;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.customDungeonImporter;
|
||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CommandPrintDungeonData extends CommandBase
|
||||
{
|
||||
public String getCommandName()//the name of our command
|
||||
{
|
||||
return "print_dungeon_data";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender var1, String[] var2)
|
||||
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.DimData;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.customDungeonImporter;
|
||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import net.minecraft.command.CommandBase;
|
||||
@@ -37,6 +38,7 @@ public class CommandStartDungeonCreation extends CommandBase
|
||||
link = dimHelper.instance.createPocket(link,true, false);
|
||||
|
||||
dimHelper.instance.teleportToPocket(player.worldObj, link, player);
|
||||
customDungeonImporter.customDungeonStatus.put(player.worldObj.provider.dimensionId, dimHelper.instance.getLinkDataFromCoords(link.destXCoord, link.destYCoord, link.destZCoord, link.destDimID));
|
||||
|
||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("DimID = "+ link.destDimID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user