From f2c0f725b7b4859383250822c2b3ad4f3e54d9e6 Mon Sep 17 00:00:00 2001 From: Driftay Date: Mon, 8 Jun 2020 05:46:25 -0400 Subject: [PATCH] Carib unregistered the command --- .../massivecraft/factions/cmd/FCmdRoot.java | 3 +++ .../zcore/fperms/PermissableAction.java | 22 +++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/FCmdRoot.java b/src/main/java/com/massivecraft/factions/cmd/FCmdRoot.java index 3df6087f..705db1ff 100644 --- a/src/main/java/com/massivecraft/factions/cmd/FCmdRoot.java +++ b/src/main/java/com/massivecraft/factions/cmd/FCmdRoot.java @@ -19,6 +19,7 @@ import com.massivecraft.factions.cmd.relational.CmdRelationTruce; import com.massivecraft.factions.cmd.reserve.CmdReserve; import com.massivecraft.factions.cmd.roles.CmdDemote; import com.massivecraft.factions.cmd.roles.CmdPromote; +import com.massivecraft.factions.cmd.shields.CmdShield; import com.massivecraft.factions.cmd.tnt.CmdTnt; import com.massivecraft.factions.cmd.tnt.CmdTntFill; import com.massivecraft.factions.cmd.wild.CmdWild; @@ -171,6 +172,7 @@ public class FCmdRoot extends FCommand implements CommandExecutor { public CmdClaimFill cmdClaimFill = new CmdClaimFill(); public CmdNotifications cmdNotifications = new CmdNotifications(); public CmdFriendlyFire cmdFriendlyFire = new CmdFriendlyFire(); + public CmdShield cmdShield = new CmdShield(); //Variables to know if we already setup certain sub commands public Boolean discordEnabled = false; @@ -306,6 +308,7 @@ public class FCmdRoot extends FCommand implements CommandExecutor { this.addSubCommand(this.cmdLookup); this.addSubCommand(this.cmdNotifications); this.addSubCommand(this.cmdFriendlyFire); + this.addSubCommand(this.cmdShield); addVariableCommands(); if (CommodoreProvider.isSupported()) brigadierManager.build(); } diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java b/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java index 2af0d1f7..874e7384 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java @@ -72,10 +72,6 @@ public enum PermissableAction { return null; } - public int getSlot() { - return FactionsPlugin.getInstance().getConfig().getInt("fperm-gui.action.slots." + this.name.toLowerCase()); - } - public static Map fromDefaults(DefaultPermissions defaultPermissions) { Map defaultMap = new HashMap<>(); for (PermissableAction permissableAction : PermissableAction.values()) { @@ -84,6 +80,17 @@ public enum PermissableAction { return defaultMap; } + public static PermissableAction fromSlot(int slot) { + for (PermissableAction action : PermissableAction.values()) { + if (action.getSlot() == slot) return action; + } + return null; + } + + public int getSlot() { + return FactionsPlugin.getInstance().getConfig().getInt("fperm-gui.action.slots." + this.name.toLowerCase()); + } + /** * Get the friendly name of this action. Used for editing in commands. * @@ -128,11 +135,4 @@ public enum PermissableAction { return item; } - public static PermissableAction fromSlot(int slot) { - for (PermissableAction action : PermissableAction.values()) { - if (action.getSlot() == slot) return action; - } - return null; - } - } \ No newline at end of file