Adds Admin switch command for bypassing protections.

This commit is contained in:
tastybento 2019-05-25 20:08:08 -07:00 committed by tastybento
parent c1d0071248
commit fc76f9c27a
3 changed files with 8 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import world.bentobox.bentobox.api.commands.admin.AdminReloadCommand;
import world.bentobox.bentobox.api.commands.admin.AdminResetFlagsCommand;
import world.bentobox.bentobox.api.commands.admin.AdminSetrankCommand;
import world.bentobox.bentobox.api.commands.admin.AdminSetspawnCommand;
import world.bentobox.bentobox.api.commands.admin.AdminSwitchCommand;
import world.bentobox.bentobox.api.commands.admin.AdminSwitchtoCommand;
import world.bentobox.bentobox.api.commands.admin.AdminTeleportCommand;
import world.bentobox.bentobox.api.commands.admin.AdminTrashCommand;
@ -81,6 +82,8 @@ public class AdminCommand extends CompositeCommand {
new AdminTrashCommand(this);
new AdminEmptyTrashCommand(this);
new AdminSwitchtoCommand(this);
// Switch
new AdminSwitchCommand(this);
}
@Override

View File

@ -80,6 +80,9 @@ permissions:
bskyblock.mod.bypassexpel:
description: Allow moderator to bypass island expulsion
default: op
bskyblock.mod.switch:
description: Allows moderator to switch bypass protection on and off
default: op
bskyblock.mod.lock:
description: Locks or unlocks an island
default: op

View File

@ -38,6 +38,7 @@ import world.bentobox.bskyblock.Settings;
@PrepareForTest({Bukkit.class, BentoBox.class, User.class })
public class AdminCommandTest {
private static final int NUM_COMMANDS = 27;
private User user;
private BSkyBlock addon;
@ -96,7 +97,7 @@ public class AdminCommandTest {
assertEquals("commands.admin.help.parameters", cmd.getParameters());
assertEquals("commands.admin.help.description", cmd.getDescription());
// Number of commands = sub commands + help
assertEquals("Number of sub commands registered", 26, cmd.getSubCommands().values().size());
assertEquals("Number of sub commands registered", NUM_COMMANDS, cmd.getSubCommands().values().size());
}
/**