Fixed class-cast

This commit is contained in:
Auxilor 2021-07-13 11:52:07 +02:00
parent c6fc8f61c3
commit 6781dbde5b

View File

@ -165,8 +165,7 @@ public class AnvilMerge {
AtomicBoolean doesConflict = new AtomicBoolean(false); AtomicBoolean doesConflict = new AtomicBoolean(false);
EnchantmentType.values().forEach(enchantmentType -> { EnchantmentType.values().forEach(enchantmentType -> {
EcoEnchant enchant = (EcoEnchant) enchantment; if (!(enchantment instanceof EcoEnchant enchant)) {
if (enchant == null) {
return; return;
} }
if (enchant.getType().equals(enchantmentType) && EcoEnchants.hasAnyOfType(left, enchantmentType) && enchantmentType.isSingular()) { if (enchant.getType().equals(enchantmentType) && EcoEnchants.hasAnyOfType(left, enchantmentType) && enchantmentType.isSingular()) {