From 35d53ece4e5e085a1aad1aa02e42e9174f3693d7 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]"); } } }