Improve forbidden items management

This commit is contained in:
Barazok
2020-10-25 01:17:59 +02:00
parent c572b97fc7
commit 6d3f811283
6 changed files with 33 additions and 26 deletions

View File

@@ -51,4 +51,14 @@ public abstract class MineClassImpl implements MineClass {
MineClassFactory.setUnbreakableAndSoulbound(itemStack);
}
}
@Override
public void dropForbiddenItems(Player player) {
for (ItemStack content : player.getInventory().getContents()) {
if (content != null && getForbiddenItems().contains(content.getType())) {
player.getInventory().remove(content);
player.getWorld().dropItemNaturally(player.getLocation(), content);
}
}
}
}