From 20f341ea45c166f0ea3d72ee2c0380cfd92fbefd Mon Sep 17 00:00:00 2001 From: Video Date: Sun, 13 Nov 2022 06:40:36 -0700 Subject: [PATCH] Resolves 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..eb47681d 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].equals("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]"); } } }