Update WorldListener.java
This commit is contained in:
parent
bb2bba9a30
commit
8cb6f1d901
@ -215,9 +215,16 @@ public class WorldListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack itemStack = event.getItemDrop().getItemStack();
|
||||
Item item = event.getItemDrop();
|
||||
ItemStack itemStack = item.getItemStack();
|
||||
String name = itemStack.getType().name();
|
||||
if (name.endsWith("_SWORD") || name.endsWith("_AXE") || name.endsWith("_PICKAXE") || name.contains("SHEARS")) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
game.getDroppedItems().add(itemStack);
|
||||
game.addEntityToRemove(event.getItemDrop());
|
||||
game.addEntityToRemove(item);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
Loading…
Reference in New Issue
Block a user