PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugAllowUnsafe.java

34 lines
1.1 KiB
Java
Raw Normal View History

package com.intellectualcrafters.plot.commands;
2015-07-18 14:21:36 +02:00
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil;
2015-07-26 21:33:54 +02:00
import com.intellectualsites.commands.callers.CommandCaller;
public class DebugAllowUnsafe extends SubCommand {
public static final List<UUID> unsafeAllowed = new ArrayList<>();
public DebugAllowUnsafe() {
super(Command.ALLOWUNSAFE, "Allow unsafe actions until toggled off", "allowunsafe", CommandCategory.DEBUG, true);
}
@Override
2015-07-26 21:33:54 +02:00
public boolean onCommand(final CommandCaller caller, final String ... args) {
final PlotPlayer plr = (PlotPlayer) caller.getSuperCaller();
if (unsafeAllowed.contains(plr.getUUID())) {
unsafeAllowed.remove(plr.getUUID());
sendMessage(plr, C.DEBUGALLOWUNSAFE_OFF);
} else {
unsafeAllowed.add(plr.getUUID());
sendMessage(plr, C.DEBUGALLOWUNSAFE_ON);
}
return true;
}
}