mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-25 08:51:33 +01:00
Optimized admin upgrades commands
This commit is contained in:
parent
ebee135ce2
commit
66ae360412
@ -58,16 +58,14 @@ public class AddUpgradeCommand extends SubCommand {
|
||||
targetPlayerName = targetPlayer.getName();
|
||||
}
|
||||
|
||||
Upgrade.Type upgrade = null;
|
||||
|
||||
for (Upgrade.Type upgradeList : Upgrade.Type.values()) {
|
||||
if (upgradeList != Upgrade.Type.Size) {
|
||||
if (args[1].toUpperCase().equals(upgradeList.name().toUpperCase())) {
|
||||
upgrade = upgradeList;
|
||||
|
||||
break;
|
||||
}
|
||||
Upgrade.Type upgrade;
|
||||
try {
|
||||
upgrade = Upgrade.Type.valueOf(args[1].toUpperCase());
|
||||
if(upgrade.equals(Upgrade.Type.Size) || upgrade.equals(Upgrade.Type.Members)){
|
||||
upgrade = null;
|
||||
}
|
||||
} catch(IllegalArgumentException e) {
|
||||
upgrade = null;
|
||||
}
|
||||
|
||||
if (islandOwnerUUID == null) {
|
||||
|
@ -57,17 +57,15 @@ public class RemoveUpgradeCommand extends SubCommand {
|
||||
islandOwnerUUID = playerDataManager.getPlayerData(targetPlayer).getOwner();
|
||||
targetPlayerName = targetPlayer.getName();
|
||||
}
|
||||
|
||||
Upgrade.Type upgrade = null;
|
||||
|
||||
for (Upgrade.Type upgradeList : Upgrade.Type.values()) {
|
||||
if (upgradeList != Upgrade.Type.Size) {
|
||||
if (args[1].toUpperCase().equals(upgradeList.name().toUpperCase())) {
|
||||
upgrade = upgradeList;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Upgrade.Type upgrade;
|
||||
try {
|
||||
upgrade = Upgrade.Type.valueOf(args[1].toUpperCase());
|
||||
if(upgrade.equals(Upgrade.Type.Size) || upgrade.equals(Upgrade.Type.Members)){
|
||||
upgrade = null;
|
||||
}
|
||||
} catch(IllegalArgumentException e) {
|
||||
upgrade = null;
|
||||
}
|
||||
|
||||
if (islandOwnerUUID == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user