From dbde346afb005bbadb104d9c0b4961979307c197 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 16 Feb 2019 21:10:44 -0800 Subject: [PATCH] Adds admin trash commands. --- src/main/java/world/bentobox/bskyblock/BSkyBlock.java | 5 +---- .../world/bentobox/bskyblock/commands/AdminCommand.java | 7 +++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/world/bentobox/bskyblock/BSkyBlock.java b/src/main/java/world/bentobox/bskyblock/BSkyBlock.java index 0de4d57..ea63a8a 100644 --- a/src/main/java/world/bentobox/bskyblock/BSkyBlock.java +++ b/src/main/java/world/bentobox/bskyblock/BSkyBlock.java @@ -42,6 +42,7 @@ public class BSkyBlock extends GameModeAddon { logError("BSkyBlock settings could not load! Addon disabled."); setState(State.DISABLED); } + new Config<>(this, Settings.class).saveConfigObject(settings); } @Override @@ -53,10 +54,6 @@ public class BSkyBlock extends GameModeAddon { @Override public void onDisable() { - // Save settings - if (settings != null) { - new Config<>(this, Settings.class).saveConfigObject(settings); - } } @Override diff --git a/src/main/java/world/bentobox/bskyblock/commands/AdminCommand.java b/src/main/java/world/bentobox/bskyblock/commands/AdminCommand.java index 3782cb1..6a5ddac 100644 --- a/src/main/java/world/bentobox/bskyblock/commands/AdminCommand.java +++ b/src/main/java/world/bentobox/bskyblock/commands/AdminCommand.java @@ -4,13 +4,16 @@ import java.util.List; import world.bentobox.bentobox.api.commands.CompositeCommand; import world.bentobox.bentobox.api.commands.admin.AdminDeleteCommand; +import world.bentobox.bentobox.api.commands.admin.AdminEmptyTrashCommand; import world.bentobox.bentobox.api.commands.admin.AdminGetrankCommand; import world.bentobox.bentobox.api.commands.admin.AdminInfoCommand; +import world.bentobox.bentobox.api.commands.admin.AdminSwitchtoCommand; import world.bentobox.bentobox.api.commands.admin.AdminRegisterCommand; import world.bentobox.bentobox.api.commands.admin.AdminReloadCommand; import world.bentobox.bentobox.api.commands.admin.AdminSetrankCommand; import world.bentobox.bentobox.api.commands.admin.AdminSetspawnCommand; import world.bentobox.bentobox.api.commands.admin.AdminTeleportCommand; +import world.bentobox.bentobox.api.commands.admin.AdminTrashCommand; import world.bentobox.bentobox.api.commands.admin.AdminUnregisterCommand; import world.bentobox.bentobox.api.commands.admin.AdminVersionCommand; import world.bentobox.bentobox.api.commands.admin.AdminWhyCommand; @@ -70,6 +73,10 @@ public class AdminCommand extends CompositeCommand { new AdminReloadCommand(this); // Spawn new AdminSetspawnCommand(this); + // Trash + new AdminTrashCommand(this); + new AdminEmptyTrashCommand(this); + new AdminSwitchtoCommand(this); } @Override