Cleaned up soulbound

Signed-off-by: BuildTools <unconfigured@null.spigotmc.org>
This commit is contained in:
Auxilor
2020-10-15 14:06:20 +01:00
committed by BuildTools
parent 7a58185a86
commit ea9063754d

View File

@@ -1,7 +1,9 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.special;
import com.willfp.ecoenchants.EcoEnchantsPlugin;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchantBuilder;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
@@ -46,6 +48,7 @@ public final class Soulbound extends EcoEnchant {
event.getDrops().removeAll(soulboundItems);
soulboundItemsMap.remove(player);
soulboundItemsMap.put(player, soulboundItems);
}
@@ -60,6 +63,9 @@ public final class Soulbound extends EcoEnchant {
event.getPlayer().getInventory().addItem(itemStack);
}));
soulboundItemsMap.remove(event.getPlayer());
Bukkit.getScheduler().runTaskLater(EcoEnchantsPlugin.getInstance(), () -> {
soulboundItemsMap.remove(event.getPlayer());
}, 1);
}
}