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

41 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;
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;
@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")
public class DebugAllowUnsafe extends SubCommand
{
public static final List<UUID> unsafeAllowed = new ArrayList<>();
@Override
2015-09-11 12:09:22 +02:00
public boolean onCommand(final PlotPlayer plr, final String... args)
{
if (unsafeAllowed.contains(plr.getUUID()))
{
unsafeAllowed.remove(plr.getUUID());
sendMessage(plr, C.DEBUGALLOWUNSAFE_OFF);
2015-09-11 12:09:22 +02:00
}
else
{
unsafeAllowed.add(plr.getUUID());
sendMessage(plr, C.DEBUGALLOWUNSAFE_ON);
}
return true;
}
}