Working on project

This commit is contained in:
Barazok
2020-10-10 18:07:02 +02:00
parent 896106222d
commit fc3d2298fa
8 changed files with 120 additions and 147 deletions

View File

@@ -100,12 +100,6 @@ public class NagaClass {
}
public static void enchantItem(ItemStack itemStack) {
if (itemStack.getItemMeta() != null) {
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.setUnbreakable(true);
itemMeta.setLore(Collections.singletonList("Soulbound"));
itemStack.setItemMeta(itemMeta);
}
classEnchantments
.getOrDefault(itemStack.getType(), new ArrayList<>())
.forEach(
@@ -114,20 +108,4 @@ public class NagaClass {
.addUnsafeEnchantment(
enchantmentIntegerPair.getFirst(), enchantmentIntegerPair.getSecond()));
}
public static void giveClassItem(Player player) {
List<Boolean> itemStackList =
Arrays.stream(player.getInventory().getContents())
.filter(Objects::nonNull)
.map(ClassWrapper::isSoulBound)
.collect(Collectors.toList());
if (itemStackList.contains(true)) {
return;
}
for (Material material : classEnchantments.keySet()) {
ItemStack itemStack = new ItemStack(material);
enchantItem(itemStack);
player.getInventory().addItem(itemStack);
}
}
}