This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Same problem here:
https://github.com/Multiverse/Multiverse-Inventories/issues/161
Suggested solution:
Close any open inventories when the inventory contents are modified (swapped), to force the item in the InventoryView cursor to be dropped.
I'm guessing the bug is caused by holding an item in the InventoryView's cursor, and then placing it in the new inventory after the swap has happened in the short moment before the user changes worlds.
I tried this in a plugin:
private void closeInventory( Player player ) { ItemStack item = player.getItemOnCursor(); if( item != null ) { Bukkit.broadcastMessage( "DELETE ITEM" ); player.setItemOnCursor( null ); } InventoryView view = player.getOpenInventory(); if( view != null ) { Bukkit.broadcastMessage( "CLOSED INV" ); view.close(); } } @EventHandler( priority = EventPriority.MONITOR ) public void onTeleport( PlayerTeleportEvent event ) { Bukkit.broadcastMessage( "ON TELEPORT " ); closeInventory( event.getPlayer() ); } @EventHandler( priority = EventPriority.MONITOR ) public void onChangeWorld( PlayerChangedWorldEvent event ) { Bukkit.broadcastMessage( "ON CHGWORLD " ); closeInventory( event.getPlayer() ); }
but it does not fix the exploit, so it may be a bit harder to fix than i thought..
Maybe having a tiny (5 ticks), configurable time where players are unable to use anything in their inventory (drop it, move it, etc.) and then refreshing their inventory would probably solve this problem. I'll see about getting a version out which does this.
To post a comment, please login or register a new account.