Class AxVaultsReader
- All Implemented Interfaces:
AutoCloseable
ItemStack arrays, ready to be re-encoded into EnhancedEchest's own storage.
AxVaults stores one row per (player, vault) in axvaults_data(id, uuid, storage, icon).
The storage blob is the AxAPI Serializers.ITEM_ARRAY framing — a big-endian
int slot count, then per slot a unsigned short byte length (0 = empty) followed by
that many bytes. Each item's bytes are gzip-compressed NBT with a DataVersion tag, exactly
what Paper's ItemStack.serializeAsBytes() produces, so each one decodes via
ItemStack.deserializeBytes(byte[]) (which also runs the DataFixerUpper across versions).
Reads the SQLite backend (data.db) only, opened read-only so it can be read while the
source server still holds the file. Installs running AxVaults' default H2 backend
(data.mv.db) must switch AxVaults to database.type: sqlite before migrating.
Not thread-safe; create, use and close() on a single thread (the migration runs on the
shared DB executor). Item (de)serialization is read-only against the frozen server registries and
is safe off the main thread.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA single AxVaults vault as decoded for migration. -
Method Summary
Modifier and TypeMethodDescriptionbackend()The backend name ("SQLite"), for logging.voidclose()static AxVaultsReaderOpens the AxVaults SQLite database (data.db) found inaxVaultsFolder(typicallyplugins/AxVaults).Reads and decodes a single player's vaults, ordered by vault id.readAll()Reads and decodes every player's vaults, keyed by owner UUID and ordered by vault id.
-
Method Details
-
backend
The backend name ("SQLite"), for logging. -
open
Opens the AxVaults SQLite database (data.db) found inaxVaultsFolder(typicallyplugins/AxVaults).- Throws:
IllegalStateException- if no readable AxVaults SQLite database is found in the folderException- if the driver is missing or the connection fails
-
readAll
Reads and decodes every player's vaults, keyed by owner UUID and ordered by vault id.- Throws:
Exception
-
read
Reads and decodes a single player's vaults, ordered by vault id. Empty if the player has none.- Throws:
Exception
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-