From 875c0a015b7fbfc9526d23dbb9b07d1b190c7b5d Mon Sep 17 00:00:00 2001 From: Spencer Date: Thu, 23 Nov 2017 15:35:08 -0500 Subject: [PATCH] add debug command to end build time to BLD --- .../game/arcade/game/games/build/Build.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java index 0d4f24488..f11e409c0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java @@ -9,6 +9,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.UUID; +import mineplex.core.account.permissions.Permission; +import mineplex.core.account.permissions.PermissionGroup; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Effect; @@ -113,6 +115,11 @@ import nautilus.game.arcade.stats.BlockPlaceStatTracker; public class Build extends Game { + public enum Perm implements Permission + { + DEBUG_BUILD_END_COMMAND + } + protected Map _data = new HashMap<>(); protected Map> _votes = new HashMap<>(); @@ -289,6 +296,17 @@ public class Build extends Game _mobShop = new MobShop(getArcadeManager(), getArcadeManager().GetClients(), getArcadeManager().GetDonation()); _optionsShop = new OptionsShop(this, getArcadeManager(), getArcadeManager().GetClients(), getArcadeManager().GetDonation()); _shopItem = ItemStackFactory.Instance.CreateStack(Material.DIAMOND, (byte) 0, 1, C.cGreen + "Options"); + + registerDebugCommand("endbuildtime", Perm.DEBUG_BUILD_END_COMMAND, PermissionGroup.ADMIN, (caller, args) -> + { + if (_buildGameState != 0) { + caller.sendMessage(F.main("Debug", "You can't use that right now.")); + return; + } + + _buildTime = 0; + caller.sendMessage(F.main("Debug", "Ending build time...")); + }); } @EventHandler