diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/interaction/weapon/untargeted/UntargetedWeaponType.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/interaction/weapon/untargeted/UntargetedWeaponType.java index 2cd61154..651d0d37 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/interaction/weapon/untargeted/UntargetedWeaponType.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/interaction/weapon/untargeted/UntargetedWeaponType.java @@ -1,6 +1,7 @@ package net.Indyuce.mmoitems.api.interaction.weapon.untargeted; import org.bukkit.event.block.Action; +import org.jetbrains.annotations.NotNull; /** * Used to determine if the item must be left or right clicked in order to @@ -13,8 +14,9 @@ public enum UntargetedWeaponType { RIGHT_CLICK, LEFT_CLICK; - public boolean corresponds(Action action) { - return (this == RIGHT_CLICK && (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK)) - || (this == LEFT_CLICK && (action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK)); + public boolean corresponds(@NotNull Action action) { + return this == RIGHT_CLICK ? + action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK : + action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK; } } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/Enchants.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/Enchants.java index 767753b5..49e47007 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/Enchants.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/Enchants.java @@ -494,6 +494,7 @@ public class Enchants extends ItemStat i * @return Found bukkit enchantment instance */ @SuppressWarnings("deprecation") + @Nullable public static Enchantment getEnchant(String key) { key = key.toLowerCase().replace("-", "_"); Enchantment enchant = Enchantment.getByKey(NamespacedKey.minecraft(key));