Invalid droptables no longer spams the console to infinity

This commit is contained in:
ASangarin 2020-10-20 19:20:40 +02:00
parent 4564d661e2
commit 34c123309b

View File

@ -50,6 +50,7 @@ public class MMOItemDropItem extends DropItem {
@Override
public ItemStack getItem(PlayerData player, int amount) {
if(!MMOItems.plugin.getTemplates().hasTemplate(type, id)) return null;
ItemStack item = player == null ? MMOItems.plugin.getItem(type, id) : MMOItems.plugin.getItem(type, id, player);
if (item == null || item.getType() == Material.AIR)
return null;