[BUILDTOOLS-255] InventoryCloseEvent firing when item in hand Created: 07/Jul/16 Updated: 11/Dec/17 Resolved: 08/Jul/16 |
|
| Status: | Resolved |
| Project: | BuildTools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Laura Green | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | Bug, Inventory, InventoryCloseEvent, ItemInHand, Menu | ||
| Plugin: | Custom plugin |
| Description |
|
I just found that for some reason when opening a Bukkit inventory on the new update (1.10), latest Spigot with an item in hand, it fires the "InventoryCloseEvent", even though the menu wasn't closed. Example 1:
Example 2: (Bug)
In my plugin I used the "InventoryCloseEvent" as a way to remove an inventory I've created and placed on a HashMap. Removing it was done for memory reasons. So whats happening for some reason is the InventoryCloseEvent is triggering without me even closing the menu, which leads it to be deleted upon the HashMap, which then leads to the null when InventoryClickEvent is fired. |
| Comments |
| Comment by Laura Green [ 08/Jul/16 ] |
|
As stated above, I've found what I was doing wrong, completely forgot about the 2nd hand. I've been making plugins for so long without having to factor that in, just gotta get use to it. Sorry my bad ;p |
| Comment by Laura Green [ 07/Jul/16 ] |
|
This might actually be due to the new offhand feature, so it might be just my mistake |
| Comment by Laura Green [ 07/Jul/16 ] |
|
Looked into it a bit more, and it seems that the "PlayerInteractEvent" is triggering twice. |