1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Did a requested change.

This commit is contained in:
LinoxGH 2020-06-29 14:45:27 +03:00 committed by GitHub
parent 942bf436bb
commit b6112e2728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,10 +88,12 @@ public class EnchantmentRune extends SimpleSlimefunItem<ItemDropHandler> {
Item entity = (Item) optional.get();
ItemStack target = entity.getItemStack();
List<Enchantment> applicableEnchantmentList = new ArrayList<>(applicableEnchantments.getOrDefault(target.getType(), new ArrayList<>()));
if (applicableEnchantmentList.isEmpty()) {
List<Enchantment> applicableEnchantmentList = applicableEnchantments.get(target.getType());
if (applicableEnchantmentList == null) {
SlimefunPlugin.getLocal().sendMessage(p, "messages.enchantment-rune.fail", true);
return;
} else {
applicableEnchantmentList = new ArrayList<>(applicableEnchantmentList);
}
//Removing the enchantments that the item already has from enchantmentSet