diff --git a/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java b/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java index d0e51c1a..a4777413 100644 --- a/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java +++ b/Plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java @@ -299,8 +299,10 @@ public class EcoEnchants { * @return The matching {@link EcoEnchant}, or null if not found. */ public static EcoEnchant getByKey(NamespacedKey key) { - Optional matching = getAll().stream().filter(enchant -> enchant.getKey().equals(key)).findFirst(); - return matching.orElse(null); + for (EcoEnchant ecoEnchant : getAll()) { + if(ecoEnchant.getKey().equals(key)) return ecoEnchant; + } + return null; } /**