Class PlayerVaultsXReader
ItemStack arrays, ready to be re-encoded into EnhancedEchest's own storage.
Unlike AxVaults, PlayerVaultsX keeps no database: every player's vaults live in a single
YAML file plugins/PlayerVaults/newvaults/<uuid>.yml (the plugin's plugin.yml name is
"PlayerVaults", so that is its data folder even though the jar is "PlayerVaultsX"), one key per vault named
vault1, vault2, … Each value is a MIME-Base64 string of PlayerVaultsX's
CardboardBoxSerialization framing: a big-endian int slot count, then per slot a
big-endian int byte length followed by that many bytes.
On a modern Paper server PlayerVaultsX's CardboardBox serializes each item with Paper's
ItemStack.serializeAsBytes() (gzip-compressed NBT with a DataVersion), and encodes
an empty/air slot as the single byte 0x0. So a non-empty slot decodes via
ItemStack.deserializeBytes(byte[]) (which runs the DataFixerUpper across versions), and a
one-byte 0x0 payload is an empty slot. This matches the data the test/target server itself
produces; vault files written by an old non-Paper (Spigot) server use a different CardboardBox
framing and are not handled here.
This reader is stateless and holds no resources — there is nothing to close. YAML parsing and item deserialization are read-only against the frozen server registries and safe off the main thread (the migration runs on the shared DB executor).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA single PlayerVaultsX vault as decoded for migration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the owner UUIDs of every readable vault file innewvaults, skipping bad names.Reads and decodes a single player's vaults, ordered by vault number.booleanTrue if PlayerVaultsX vault data is present (thenewvaultsfolder holds at least one file).
-
Constructor Details
-
PlayerVaultsXReader
-
-
Method Details
-
sourceAvailable
public boolean sourceAvailable()True if PlayerVaultsX vault data is present (thenewvaultsfolder holds at least one file). -
listOwners
Returns the owner UUIDs of every readable vault file innewvaults, skipping bad names.- Throws:
Exception
-
read
Reads and decodes a single player's vaults, ordered by vault number. Empty if they have none.- Throws:
Exception
-