This is a rare case. The Player loaded by the PlayerDataManager is a new object for SpecialEnderChest and SpecialPlayerInventory.
To replicate dupe/overwrite issues:
Open an offline player's inventory to cache it
Open the offline player's ender chest to cache it
Edit both inventories
Restart server to clear cached inventories (cached inventories only clear when players go offline - some retention policy would be good, the current state is bad)
Reopen inventories to see whichever was closed first reverted to previous state
The root cause is that the ISpecialEnderChest and ISpecialPlayerInventory implementations do not use the same Player object. That means that whichever saves last causes the other inventory to revert to its previous state, provided the actual Player does not log in before the server is restarted.
Jikoo#10
> This is a rare case. The Player loaded by the PlayerDataManager is a new object for SpecialEnderChest and SpecialPlayerInventory.
>
> To replicate dupe/overwrite issues:
> 1. Open an offline player's inventory to cache it
> 2. Open the offline player's ender chest to cache it
> 3. Edit both inventories
> 4. Restart server to clear cached inventories (cached inventories only clear when players go offline - some retention policy would be good, the current state is bad)
> 5. Reopen inventories to see whichever was closed first reverted to previous state
The root cause is that the ISpecialEnderChest and ISpecialPlayerInventory implementations do not use the same Player object. That means that whichever saves last causes the other inventory to revert to its previous state, provided the actual Player does not log in before the server is restarted.
For fixes, Phoenix616 has an elegantly simple fix in 0665dec.
My fix (23bda96) also works, but uses a much more beefy system mainly aimed around not caching players who haven't logged in forever.
For fixes, Phoenix616 has an elegantly simple fix in 0665dec.
My fix (23bda96) also works, but uses a much more beefy system mainly aimed around not caching players who haven't logged in forever.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Jikoo#10
The root cause is that the ISpecialEnderChest and ISpecialPlayerInventory implementations do not use the same Player object. That means that whichever saves last causes the other inventory to revert to its previous state, provided the actual Player does not log in before the server is restarted.
For fixes, Phoenix616 has an elegantly simple fix in 0665dec.
My fix (
23bda96) also works, but uses a much more beefy system mainly aimed around not caching players who haven't logged in forever.Fixed in 3.0.0