2015-07-15 21:57:11 +02:00
|
|
|
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;
|
|
|
|
|
2015-07-30 16:25:16 +02:00
|
|
|
import com.intellectualcrafters.plot.config.C;
|
|
|
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
|
|
|
import com.plotsquared.general.commands.CommandDeclaration;
|
|
|
|
|
2015-07-27 00:26:19 +02:00
|
|
|
@CommandDeclaration(
|
2015-09-11 12:09:22 +02:00
|
|
|
command = "debugallowunsafe",
|
|
|
|
description = "Allow unsafe actions until toggled off",
|
|
|
|
usage = "/plot debugallowunsafe",
|
|
|
|
category = CommandCategory.DEBUG,
|
|
|
|
requiredType = RequiredType.NONE,
|
|
|
|
permission = "plots.debugallowunsafe")
|
2015-09-13 06:04:31 +02:00
|
|
|
public class DebugAllowUnsafe extends SubCommand {
|
|
|
|
|
2015-07-15 21:57:11 +02:00
|
|
|
public static final List<UUID> unsafeAllowed = new ArrayList<>();
|
2015-09-13 06:04:31 +02:00
|
|
|
|
2015-07-15 21:57:11 +02:00
|
|
|
@Override
|
2015-09-13 06:04:31 +02:00
|
|
|
public boolean onCommand(final PlotPlayer plr, final String... args) {
|
|
|
|
|
|
|
|
if (unsafeAllowed.contains(plr.getUUID())) {
|
2015-07-15 21:57:11 +02:00
|
|
|
unsafeAllowed.remove(plr.getUUID());
|
|
|
|
sendMessage(plr, C.DEBUGALLOWUNSAFE_OFF);
|
2015-09-13 06:04:31 +02:00
|
|
|
} else {
|
2015-07-15 21:57:11 +02:00
|
|
|
unsafeAllowed.add(plr.getUUID());
|
|
|
|
sendMessage(plr, C.DEBUGALLOWUNSAFE_ON);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2015-09-13 06:04:31 +02:00
|
|
|
|
2015-07-15 21:57:11 +02:00
|
|
|
}
|