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-15 21:57:11 +02:00
|
|
|
import com.intellectualcrafters.plot.config.C;
|
2015-07-27 00:26:19 +02:00
|
|
|
import com.intellectualcrafters.plot.object.Plot;
|
2015-07-15 21:57:11 +02:00
|
|
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
|
|
|
import com.intellectualcrafters.plot.util.MainUtil;
|
2015-07-27 00:26:19 +02:00
|
|
|
import com.intellectualsites.commands.CommandDeclaration;
|
2015-07-27 15:10:14 +02:00
|
|
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
2015-07-15 21:57:11 +02:00
|
|
|
|
2015-07-27 00:26:19 +02:00
|
|
|
@CommandDeclaration(
|
|
|
|
command = "debugallowunsafe",
|
|
|
|
description = "Allow unsafe actions until toggled off",
|
|
|
|
usage = "/plot debugallowunsafe",
|
|
|
|
category = CommandCategory.DEBUG,
|
2015-07-27 15:10:14 +02:00
|
|
|
requiredType = RequiredType.PLAYER,
|
2015-07-27 00:26:19 +02:00
|
|
|
permission = "plots.debugallowunsafe"
|
|
|
|
)
|
2015-07-15 21:57:11 +02:00
|
|
|
public class DebugAllowUnsafe extends SubCommand {
|
|
|
|
|
|
|
|
public static final List<UUID> unsafeAllowed = new ArrayList<>();
|
|
|
|
|
|
|
|
@Override
|
2015-07-27 15:10:14 +02:00
|
|
|
public boolean onCommand(final PlotPlayer plr, final String ... args) {
|
|
|
|
|
2015-07-15 21:57:11 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|