d15f372c59
Renamed CommandRegenPocket to CommandResetDungeons. Changed command name accordingly. Added a message for the user listing the number of dungeons that were reset. Modified DimHelper slightly to add support for this. Added error condition if user specifies arguments for the command.
51 lines
No EOL
1.1 KiB
Java
51 lines
No EOL
1.1 KiB
Java
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;
|
|
}
|
|
} |