mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-12-25 20:17:38 +01:00
Fixed severe anvil bug
This commit is contained in:
parent
ecda560a56
commit
61a913b178
@ -1,13 +1,11 @@
|
|||||||
package com.willfp.ecoenchants.enchantments.support.merging.anvil;
|
package com.willfp.ecoenchants.enchantments.support.merging.anvil;
|
||||||
|
|
||||||
import com.willfp.eco.util.ProxyUtils;
|
|
||||||
import com.willfp.eco.util.config.Configs;
|
import com.willfp.eco.util.config.Configs;
|
||||||
import com.willfp.eco.util.tuplets.Pair;
|
import com.willfp.eco.util.tuplets.Pair;
|
||||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||||
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentTarget;
|
import com.willfp.ecoenchants.enchantments.meta.EnchantmentTarget;
|
||||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||||
import com.willfp.ecoenchants.proxy.proxies.FastGetEnchantsProxy;
|
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -111,13 +109,13 @@ public class AnvilMerge {
|
|||||||
if (left.getItemMeta() instanceof EnchantmentStorageMeta) {
|
if (left.getItemMeta() instanceof EnchantmentStorageMeta) {
|
||||||
leftEnchants.putAll(((EnchantmentStorageMeta) left.getItemMeta()).getStoredEnchants());
|
leftEnchants.putAll(((EnchantmentStorageMeta) left.getItemMeta()).getStoredEnchants());
|
||||||
} else {
|
} else {
|
||||||
rightEnchants.putAll(ProxyUtils.getProxy(FastGetEnchantsProxy.class).getEnchantmentsOnItem(left));
|
leftEnchants.putAll(left.getItemMeta().getEnchants());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (right.getItemMeta() instanceof EnchantmentStorageMeta) {
|
if (right.getItemMeta() instanceof EnchantmentStorageMeta) {
|
||||||
rightEnchants.putAll(((EnchantmentStorageMeta) right.getItemMeta()).getStoredEnchants());
|
rightEnchants.putAll(((EnchantmentStorageMeta) right.getItemMeta()).getStoredEnchants());
|
||||||
} else {
|
} else {
|
||||||
rightEnchants.putAll(ProxyUtils.getProxy(FastGetEnchantsProxy.class).getEnchantmentsOnItem(right));
|
rightEnchants.putAll(right.getItemMeta().getEnchants());
|
||||||
}
|
}
|
||||||
|
|
||||||
leftEnchants.forEach(((enchantment, integer) -> {
|
leftEnchants.forEach(((enchantment, integer) -> {
|
||||||
@ -151,14 +149,14 @@ public class AnvilMerge {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
leftEnchants.forEach(((enchantment1, integer1) -> {
|
leftEnchants.forEach((enchantment1, integer1) -> {
|
||||||
if (enchantment.conflictsWith(enchantment1)) {
|
if (enchantment.conflictsWith(enchantment1)) {
|
||||||
doesConflict.set(true);
|
doesConflict.set(true);
|
||||||
}
|
}
|
||||||
if (enchantment1.conflictsWith(enchantment)) {
|
if (enchantment1.conflictsWith(enchantment)) {
|
||||||
doesConflict.set(true);
|
doesConflict.set(true);
|
||||||
}
|
}
|
||||||
}));
|
});
|
||||||
|
|
||||||
boolean canEnchantItem = enchantment.canEnchantItem(left);
|
boolean canEnchantItem = enchantment.canEnchantItem(left);
|
||||||
if (left.getItemMeta() instanceof EnchantmentStorageMeta) {
|
if (left.getItemMeta() instanceof EnchantmentStorageMeta) {
|
||||||
|
Loading…
Reference in New Issue
Block a user