If you have an generator inventory opened and any other player upgrades any other generator, the open inventory changes to the inventory of the last updated generator.
Why does this happen
After upgrading a generator, it is stopped and started again. After starting, InventoryController.updateInventories() is called. For all players, the open inventory is updated if the following two conditions are true: First, the arena of the Generator and the player matches, second, the open inventory is of the same type.
How to fix it
Since the Generator itself is stored in the opened inventory with EwInventory.setExtraData(), the Location can be compared to only update open inventories that have the same generator location stored inside the extraData as the updated generator.
Short Description
If you have an generator inventory opened and any other player upgrades any other generator, the open inventory changes to the inventory of the last updated generator.
Why does this happen
After upgrading a generator, it is stopped and started again. After starting,
InventoryController.updateInventories()
is called. For all players, the open inventory is updated if the following two conditions are true: First, the arena of the Generator and the player matches, second, the open inventory is of the same type.How to fix it
Since the Generator itself is stored in the opened inventory with
EwInventory.setExtraData()
, the Location can be compared to only update open inventories that have the same generator location stored inside theextraData
as the updated generator.