Open RoboMWM opened 7 years ago
Does this always happen or only sometimes (when the server lags for example)?
For me this happened when the inventory was closed due to the server sending me a resource pack (I set it to prompt). I had opened it via /cp play before it sent it, and then I reopened it afterwards - and was able to take items out at my leisure.
Very possible that either an inventorycloseevent doesn't fire(?) and/or that I'm somehow viewing a different inventory than the one you're currently watching for (if my guess is correct) and thus your plugin doesn't believe I'm interacting with your UI.
Ok, I will search how to fix this. Thanks !
re custom inventoryholder:
Since I've now made a couple things that interact with inventories, this is simple. Just create a new class that implements InventoryHolder, and then when creating the inventory, pass it in as the holder. Then do instanceof
on the inventoryholder in the inventory events.
Since I haven't actually made a pure inventory UI, I'm not sure about all the inventory events you have to watch for (I know at least the obvious click, but there's also drag, and a couple others?). I personally prefer Book GUIs though, using this BookUtil to open the book gui.
I've heard that using a custom InventoryHolder prevents issues like these.
https://i.imgur.com/5CJLqmK.gifv
I think this happened due to the inventory being closed on the client, but it didn't send an inventorycloseevent(?) Other than that guess, I don't really know.