WesJD / AnvilGUI

Capture user input in Minecraft through an anvil GUI in under 20 lines of code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InventoryClickEvent error

PhantomClone opened this issue · comments

In the private class ListenUp

You try to compare a nullable Inventory with a Player.

Player clicker = (Player)event.getWhoClicked();
if (event.getClickedInventory().equals(clicker) && event.getClick().equals(ClickType.DOUBLE_CLICK)) {

So, if you click outside the anvil gui -> and event.getClickedInventory() is null, we get a NullPointerException Cannot invoke "Object.equals(Object)"

Good catch. Fixed!