Fixes NPE on clicking outside inventory.

Closes #52
This commit is contained in:
t3hk0d3 2012-08-22 23:37:32 +04:00
parent afba9cdbcd
commit 712e4cea66

View File

@ -180,11 +180,9 @@ public class PlayerListener extends ModifyworldListener {
public void onPlayerInventoryClick(InventoryClickEvent event) {
InventoryHolder holder = event.getInventory().getHolder();
if (holder instanceof Player) { // do not track inter-inventory stuff
return;
}
if (event.getRawSlot() >= event.getView().getTopInventory().getSize()) { // top inventory only
if (holder instanceof Player || // do not track inter-inventory stuff
event.getRawSlot() >= event.getView().getTopInventory().getSize() || // top inventory only
event.getSlotType() != InventoryType.SlotType.OUTSIDE) { // do not track drop
return;
}