Game breaking creative item transfer glitch #213


  • Defect
  • Accepted
Open
Assigned to tux2
  • mukunda_ created this issue Aug 22, 2014

    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.

  • mukunda_ added the tags New Defect Aug 22, 2014
  • mukunda_ posted a comment Aug 23, 2014

    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..

  • Tux2 posted a comment Sep 4, 2014

    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.

  • Tux2 removed a tag New Sep 4, 2014
  • Tux2 added a tag Accepted Sep 4, 2014

To post a comment, please login or register a new account.