Carib unregistered the command

This commit is contained in:
Driftay 2020-06-08 05:46:25 -04:00
parent 0b677cb4de
commit f2c0f725b7
2 changed files with 14 additions and 11 deletions

View File

@ -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();
}

View File

@ -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<PermissableAction, Access> fromDefaults(DefaultPermissions defaultPermissions) {
Map<PermissableAction, Access> 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;
}
}