Working on

This commit is contained in:
2021-12-11 21:56:49 +01:00
parent 2e9f397155
commit f89bf5a010

View File

@@ -34,8 +34,11 @@ public class MineClassFactory {
public static boolean isSoulBound(ItemStack itemStack, Player player) { public static boolean isSoulBound(ItemStack itemStack, Player player) {
if (itemStack.getItemMeta() != null && itemStack.getItemMeta().getLore() != null) { if (itemStack.getItemMeta() != null && itemStack.getItemMeta().getLore() != null) {
Optional<MineClass> mineClass = MineClassFactory.getInstance().getRightClass(player);
return itemStack.getItemMeta().getLore().contains("Soulbound") return itemStack.getItemMeta().getLore().contains("Soulbound")
&& itemStack.getItemMeta().getLore().contains(player.getName()); && itemStack.getItemMeta().getLore().contains(player.getName())
&& mineClass.isPresent()
&& itemStack.getItemMeta().getLore().contains(mineClass.get().getName());
} }
return false; return false;
} }