Fixed Rotation in Schematic Loader and Partially Overhauled Commands #32
@@ -1,43 +0,0 @@
|
|||||||
package StevenDimDoors.mod_pocketDim.commands;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
|
||||||
import StevenDimDoors.mod_pocketDim.DimData;
|
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
|
||||||
|
|
||||||
public class CommandRegenPocket extends DDCommandBase
|
|
||||||
{
|
|
||||||
private static CommandRegenPocket instance = null;
|
|
||||||
|
|
||||||
private CommandRegenPocket()
|
|
||||||
{
|
|
||||||
super("dd-regenDungeons");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CommandRegenPocket instance()
|
|
||||||
{
|
|
||||||
if (instance == null)
|
|
||||||
instance = new CommandRegenPocket();
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
|
||||||
{
|
|
||||||
DungeonHelper dungeonHelper = DungeonHelper.instance();
|
|
||||||
DDProperties properties = DDProperties.instance();
|
|
||||||
|
|
||||||
for(DimData data : dimHelper.dimList.values())
|
|
||||||
{
|
|
||||||
if(data.isDimRandomRift)
|
|
||||||
{
|
|
||||||
dimHelper.instance.regenPocket(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package StevenDimDoors.mod_pocketDim.commands;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import StevenDimDoors.mod_pocketDim.DimData;
|
||||||
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||||
|
|
||||||
|
public class CommandResetDungeons extends DDCommandBase
|
||||||
|
{
|
||||||
|
private static CommandResetDungeons instance = null;
|
||||||
|
|
||||||
|
private CommandResetDungeons()
|
||||||
|
{
|
||||||
|
super("dd-resetdungeons", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CommandResetDungeons instance()
|
||||||
|
{
|
||||||
|
if (instance == null)
|
||||||
|
instance = new CommandResetDungeons();
|
||||||
|
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected DDCommandResult processCommand(EntityPlayer sender, String[] command)
|
||||||
|
{
|
||||||
|
if (command.length > 0)
|
||||||
|
{
|
||||||
|
return DDCommandResult.TOO_FEW_ARGUMENTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dungeonCount = 0;
|
||||||
|
int resetCount = 0;
|
||||||
|
|
||||||
|
for (DimData data : dimHelper.dimList.values())
|
||||||
|
{
|
||||||
|
if (data.isDimRandomRift)
|
||||||
|
{
|
||||||
|
dungeonCount++;
|
||||||
|
if (dimHelper.instance.resetPocket(data))
|
||||||
|
{
|
||||||
|
resetCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Notify the user of the results
|
||||||
|
sender.sendChatToPlayer("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset.");
|
||||||
|
return DDCommandResult.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,6 +38,7 @@ import StevenDimDoors.mod_pocketDim.DimData;
|
|||||||
import StevenDimDoors.mod_pocketDim.LinkData;
|
import StevenDimDoors.mod_pocketDim.LinkData;
|
||||||
import StevenDimDoors.mod_pocketDim.ObjectSaveInputStream;
|
import StevenDimDoors.mod_pocketDim.ObjectSaveInputStream;
|
||||||
import StevenDimDoors.mod_pocketDim.PacketHandler;
|
import StevenDimDoors.mod_pocketDim.PacketHandler;
|
||||||
|
import StevenDimDoors.mod_pocketDim.Point3D;
|
||||||
import StevenDimDoors.mod_pocketDim.TileEntityRift;
|
import StevenDimDoors.mod_pocketDim.TileEntityRift;
|
||||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||||
import StevenDimDoors.mod_pocketDim.world.LimboProvider;
|
import StevenDimDoors.mod_pocketDim.world.LimboProvider;
|
||||||
@@ -64,7 +65,7 @@ public class dimHelper extends DimensionManager
|
|||||||
* ArrayList containing any blocks in limbo that have been placed by the player. Cycled through in the common tick manager
|
* ArrayList containing any blocks in limbo that have been placed by the player. Cycled through in the common tick manager
|
||||||
* @Return
|
* @Return
|
||||||
*/
|
*/
|
||||||
public static ArrayList blocksToDecay= new ArrayList();
|
public static ArrayList<Point3D> blocksToDecay = new ArrayList<Point3D>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* instance of the dimHelper
|
* instance of the dimHelper
|
||||||
@@ -812,33 +813,31 @@ public class dimHelper extends DimensionManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void regenPocket(DimData dimData)
|
public boolean resetPocket(DimData dimData)
|
||||||
{
|
{
|
||||||
if(this.getWorld(dimData.dimID)!=null ||!dimData.isPocket)
|
//TODO: Should we add a check to see if the dimension is currently loaded? How could we check that? ~SenseiKiwi
|
||||||
|
if (getWorld(dimData.dimID) != null || !dimData.isPocket)
|
||||||
{
|
{
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
File save = new File( this.getCurrentSaveRootDirectory()+"/DimensionalDoors/pocketDimID" + dimData.dimID);
|
File save = new File(getCurrentSaveRootDirectory() + "/DimensionalDoors/pocketDimID" + dimData.dimID);
|
||||||
DeleteFolder.deleteFolder(save);
|
DeleteFolder.deleteFolder(save);
|
||||||
dimData.hasBeenFilled=false;
|
dimData.hasBeenFilled = false;
|
||||||
dimData.hasDoor=false;
|
dimData.hasDoor = false;
|
||||||
for(LinkData link : dimData.printAllLinkData())
|
for(LinkData link : dimData.printAllLinkData())
|
||||||
{
|
{
|
||||||
link.hasGennedDoor=false;
|
link.hasGennedDoor = false;
|
||||||
LinkData linkOut =this.getLinkDataFromCoords(link.destXCoord, link.destYCoord, link.destZCoord, link.destDimID);
|
LinkData linkOut = this.getLinkDataFromCoords(link.destXCoord, link.destYCoord, link.destZCoord, link.destDimID);
|
||||||
if(linkOut!=null)
|
if (linkOut != null)
|
||||||
{
|
{
|
||||||
linkOut.hasGennedDoor=false;
|
linkOut.hasGennedDoor = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* method called when the client disconects/server stops to unregister dims.
|
* method called when the client disconnects/server stops to unregister dims.
|
||||||
* @Return
|
* @Return
|
||||||
*/
|
*/
|
||||||
public void unregsisterDims()
|
public void unregsisterDims()
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import StevenDimDoors.mod_pocketDim.commands.CommandDeleteRifts;
|
|||||||
import StevenDimDoors.mod_pocketDim.commands.CommandEndDungeonCreation;
|
import StevenDimDoors.mod_pocketDim.commands.CommandEndDungeonCreation;
|
||||||
import StevenDimDoors.mod_pocketDim.commands.CommandPrintDimensionData;
|
import StevenDimDoors.mod_pocketDim.commands.CommandPrintDimensionData;
|
||||||
import StevenDimDoors.mod_pocketDim.commands.CommandPruneDimensions;
|
import StevenDimDoors.mod_pocketDim.commands.CommandPruneDimensions;
|
||||||
import StevenDimDoors.mod_pocketDim.commands.CommandRegenPocket;
|
import StevenDimDoors.mod_pocketDim.commands.CommandResetDungeons;
|
||||||
import StevenDimDoors.mod_pocketDim.commands.CommandStartDungeonCreation;
|
import StevenDimDoors.mod_pocketDim.commands.CommandStartDungeonCreation;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.DungeonHelper;
|
||||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||||
|
|||||||
Reference in New Issue
Block a user