rebuilt how rifts get dungeon data assigned to them
This commit is contained in:
@@ -5,12 +5,14 @@ import java.util.ArrayList;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.DimData;
|
||||
import StevenDimDoors.mod_pocketDim.DungeonGenerator;
|
||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||
import StevenDimDoors.mod_pocketDim.dimHelper;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.MinecraftException;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CommandAddDungeonRift extends CommandBase
|
||||
@@ -27,7 +29,10 @@ public class CommandAddDungeonRift extends CommandBase
|
||||
public void processCommand(ICommandSender var1, String[] var2)
|
||||
|
||||
{
|
||||
|
||||
if(var2==null||this.getCommandSenderAsPlayer(var1).worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LinkData link = new LinkData(this.getCommandSenderAsPlayer(var1).worldObj.provider.dimensionId, 0,
|
||||
MathHelper.floor_double(this.getCommandSenderAsPlayer(var1).posX),
|
||||
@@ -37,13 +42,78 @@ public class CommandAddDungeonRift extends CommandBase
|
||||
MathHelper.floor_double(this.getCommandSenderAsPlayer(var1).posY)+1,
|
||||
MathHelper.floor_double(this.getCommandSenderAsPlayer(var1).posZ),true,3);
|
||||
|
||||
link = dimHelper.instance.createPocket(link,true, true);
|
||||
|
||||
|
||||
|
||||
if(var2.length!=0&&var2[0].equals("random"))
|
||||
{
|
||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Created dungeon rift");
|
||||
dimHelper.instance.createLink(link);
|
||||
link = dimHelper.instance.createPocket(link,true, true);
|
||||
|
||||
}
|
||||
else if(var2.length!=0&&var2[0].equals("list"))
|
||||
{
|
||||
for(DungeonGenerator dungeonGen : mod_pocketDim.registeredDungeons)
|
||||
{
|
||||
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)
|
||||
|
||||
{
|
||||
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");
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("invalid arguments- 'random' for random dungeon, or 'list' for dungeon names");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.getCommandSenderAsPlayer(var1).sendChatToPlayer("Created dungeon rift");
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user