From a79b2cbe0f2412430cb928dbb997cb54b441a54a Mon Sep 17 00:00:00 2001 From: Video Date: Thu, 29 Jul 2021 05:45:21 -0600 Subject: [PATCH] FS-338 --- .../command/Command_enchant.java | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_enchant.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_enchant.java index b6d154b6..6b8b253a 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_enchant.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_enchant.java @@ -251,21 +251,18 @@ public class Command_enchant extends FreedomCommand return getEnchantments(item); } } - else if (args.length == 3) + else if (args.length == 3 && args[0].equalsIgnoreCase("add")) { - if (args[0].equals("add")) + Enchantment enchantment = Enchantment.getByName(args[1].toUpperCase()); + if (enchantment != null) { - Enchantment enchantment = Enchantment.getByName(args[1].toUpperCase()); - if (enchantment != null) + if (!unsafe) { - if (!unsafe) - { - return stringNumberRange(1, enchantment.getMaxLevel()); - } - else - { - return Collections.singletonList("[level]"); - } + return stringNumberRange(1, enchantment.getMaxLevel()); + } + else + { + return Collections.singletonList("[level]"); } } }