Before trying this out, let me just say that this is a BACKWARDS INCOMPATIBLE commit. Your old PerWorldInventory data will still be safe, but won't be read.NOTE: This is a backwards-incompatible update. If you have old inventory files in plugins/PerWorldInventory/inventories folder, you can run /pwi updateoldfiles command to convert the old (.yml) files to the new (.dat) format. After that, you can optionally get rid of all the .yml files in the directory as they aren't going to be read by the plugin anymore. Sample output of the command:
Drop support for ALPHA < 10 due to breaking changes to PocketMine's NBT library and PlayerInventory-ArmorInventory split.
File reading/writing is now asynchronous.
The plugin caches players' inventories into a [levelname] => Item[] map during PlayerLoginEvent, the plugin will no longer parse the file every time the player switches levels.
Switch from YAML to PocketMine-styled NBT .dat format. This will no longer require base64_encoding/decoding file contents and will save on hard disk space.
The inventory is saved asynchronously to file only during PlayerQuitEvent and when the plugin disables. Previously, inventories were saved synchronously and every time the player switches levels.
I'm assuming items were not saved along with their slots previously, well now they are.
Added /pwi updateoldfiles command to convert backwards-incompatible files to the new file format.
FAQs
Q. Since the inventories are read asynchronously, what happens if the player completely logs in while the inventory contents are still being read?
A. The plugin will cancel ALL InventoryTransactionEvent calls received from the player.
Before trying this out, let me just say that this is a BACKWARDS INCOMPATIBLE commit. Your old PerWorldInventory data will still be safe, but won't be read.NOTE: This is a backwards-incompatible update. If you have old inventory files inplugins/PerWorldInventory/inventories
folder, you can run/pwi updateoldfiles
command to convert the old (.yml
) files to the new (.dat
) format. After that, you can optionally get rid of all the.yml
files in the directory as they aren't going to be read by the plugin anymore. Sample output of the command:What does this pull request add?
[levelname] => Item[]
map duringPlayerLoginEvent
, the plugin will no longer parse the file every time the player switches levels..dat
format. This will no longer require base64_encoding/decoding file contents and will save on hard disk space.PlayerQuitEvent
and when the plugin disables. Previously, inventories were saved synchronously and every time the player switches levels./pwi updateoldfiles
command to convert backwards-incompatible files to the new file format.FAQs Q. Since the inventories are read asynchronously, what happens if the player completely logs in while the inventory contents are still being read? A. The plugin will cancel ALL
InventoryTransactionEvent
calls received from the player.