lishid / OpenInv

Open anyone's inventory as a chest, real-time!
GNU General Public License v3.0
119 stars 94 forks source link

Inventory#getLocation causes NPE when called on silent ender chest #143

Closed Jikoo closed 4 years ago

Jikoo commented 4 years ago

Specifically a 1.16 problem, may be Spigot's problem and not ours - last I recall silent ender chest is purely API-based.

RoboMWM commented 4 years ago

I think I've encountered this when attempting getLocation on an ender chest (or fake ender chest inventory?) as well a couple years ago. Let me see what I did about this...

RoboMWM commented 4 years ago

This isn't what I recall, but search results gave me this: https://github.com/MLG-Fortress/PrettySimpleShop/pull/7

Jikoo commented 4 years ago

Silent ender chest is API-only like I thought. Going to leave this open until I make time to double check it but it should be simple to reproduce.

InventoryView view = player.openInventory(bukkitPlayer.getEnderChest())
if (view != null) {
    view.getTopInventory().getLocation();
}
Jikoo commented 4 years ago

Looks like this was fixed, kinda forgot about reporting it. Whoops.