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);
EnchantmentType.values().forEach(enchantmentType -> {
EcoEnchant enchant = (EcoEnchant) enchantment;
if (enchant == null) {
if (!(enchantment instanceof EcoEnchant enchant)) {
return;
}
if (enchant.getType().equals(enchantmentType) && EcoEnchants.hasAnyOfType(left, enchantmentType) && enchantmentType.isSingular()) {