Closed Paulomart closed 8 years ago
Hotbar updates instand because of a plugin. Items that you put into you player inventory, are gone when reopening the inventory (self or container)
Could I see the plugin's code?
Sure, I created a Test plugin: https://github.com/Mystalion/GlowTest/tree/inventory-sync
Not sure if we use events correctly for the click handler, then. Or, we aren't telling the client that they can't take that item.
Handler seems to be fine, the server is not accepting the transaction. Maybe a client side bug that is worked around in craftbukkit?
When clicken outsite it now gives a exception:
2016/02/11 17:57:53 [SCHWERWIEGEND] Error while handling WindowClickMessage(id=4, slot=-999, button=0, transaction=50, mode=0, item=null) (handler: WindowClickHandler)
java.lang.ArrayIndexOutOfBoundsException: -999
at java.util.Arrays$ArrayList.get(Unknown Source)
at net.glowstone.inventory.GlowInventory.getItem(GlowInventory.java:320)
at net.glowstone.net.handler.play.inv.WindowClickHandler.process(WindowClickHandler.java:234)
at net.glowstone.net.handler.play.inv.WindowClickHandler.handle(WindowClickHandler.java:31)
at net.glowstone.net.handler.play.inv.WindowClickHandler.handle(WindowClickHandler.java:26)
at net.glowstone.libs.com.flowpowered.networking.session.BasicSession.handleMessage(BasicSession.java:80)
at net.glowstone.libs.com.flowpowered.networking.session.BasicSession.messageReceived(BasicSession.java:139)
at net.glowstone.net.GlowSession.pulse(GlowSession.java:428)
at net.glowstone.net.SessionRegistry.pulse(SessionRegistry.java:23)
at net.glowstone.scheduler.GlowScheduler.pulse(GlowScheduler.java:173)
at net.glowstone.scheduler.GlowScheduler.access$100(GlowScheduler.java:24)
at net.glowstone.scheduler.GlowScheduler$2.run(GlowScheduler.java:110)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Also the items can get in the bottom inventory if you shift click.
As of this commit: https://github.com/GlowstonePlusPlus/GlowstonePlusPlus/commit/930a3c8156ad7e200fee959d5ceb9dc5fc1e2e53, the outside slot should work, but I'm not sure if or how the cursor item should be reset.
Also, the shift click issue seems to be client side only - is there another hack bukkit did to resolve it?
The bug also happens with the number keys.
Not sure, what CraftBukkit did there, maybe updating the whole inventory would be faster and better?
maybe we could guess where the item went for the client and then tell it to revert the change?
Would have to mess with the DragTracker to do that
Also happing when open a new inventory on click, the item is still there then.
What do you mean?
Maybe adapt this change Mystalion/MysticStone@db6895debe9ce25af7feaf714dbea58ca9238ce5
Cannot provide a test case now, ask @summsi if he has time
Is there a GIF of the issue that you could show me?
EDIT: ok, @summsi could you please provide a video, or gif of the issue?
Are you sure the inventory is cancelling events for the bottom inventory as well?
No, because we care only about the top one
Could I see the code for this plugin?
Really big lib, will try to extract the bug and put in Mystalion/GlowTest
The class plane shuld not be there.
Note: I fixed this in my patch: https://github.com/Mystalion/MysticStone/blob/master/patches/0003-Fix-inventory-sync-issues.patch
And all window click logic works? If you want, send it as a PR.
It only calls updateInventory so I guess it should not break anything. Will PR tomorrow
Because images say more then words. I dobble click on in the inventory, http://i.imgur.com/EkdKMbW.gif
Console claims that it was rejected:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.