DimDoors/StevenDimDoors/mod_pocketDim/commands/CommandResetDungeons.java
SenseiKiwi 934dcfde3d Flipped a Table
Replaced several core classes from DD with new classes to enforce
integrity checks. Rewriting everything that depended on those classes is
a massive undertaking but it should simplify our code and prevent the
many bugs we've seen lately. The rewrite isn't done yet, just committing
my progress so far.
2013-08-29 02:14:24 -04:00

51 lines
No EOL
1.1 KiB
Java

package StevenDimDoors.mod_pocketDim.commands;
import net.minecraft.entity.player.EntityPlayer;
import StevenDimDoors.mod_pocketDim.core.NewDimData;
import StevenDimDoors.mod_pocketDim.core.PocketManager;
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 (NewDimData data : PocketManager.dimList.values())
{
if (data.isDimRandomRift)
{
dungeonCount++;
if (PocketManager.instance.resetPocket(data))
{
resetCount++;
}
}
}
//Notify the user of the results
sender.sendChatToPlayer("Reset complete. " + resetCount + " out of " + dungeonCount + " dungeons were reset.");
return DDCommandResult.SUCCESS;
}
}