CivClassic / CivModCore

Plugin Core and general purpose API for Civ Plugins - Updated for Paper 1.16.5
BSD 3-Clause "New" or "Revised" License
2 stars 20 forks source link

Fix CME in CivClassic#49 #83

Closed caucow closed 3 years ago

caucow commented 3 years ago

In ClickableInventory.updateInventory(), in the foreach loop through openInventories.entrySet(), it calls showInventory(Player) which modifies openInventories. This makes a list copy of the entrySet so the iterator doesn't get mad. Also made the openInventory call safe according to Paper's InventoryClick/DragEvent docs

So... technically the arraylist copy is redundant with both changes...