FlatFileStorageAPI icon

FlatFileStorageAPI -----

FlatFileStorageAPI is a lightweight, efficient storage solution for Minecraft plugins, allowing seam



FlatFileStorageAPI supports the following variable types, ensuring compatibility with a wide range of data structures and types:

Basic Types:
  • STRING
  • UUID
  • INTEGER
  • DOUBLE
  • FLOAT
  • SHORT
  • LONG
  • BOOLEAN
  • MATERIAL
Advanced Types:
  • ITEMSTACK
  • LOCATION


Collections:

  • List
  • Set
  • Array

How to create a Var:
To create a new Var instance, use the following code:

final Var var = Var.getVar(instance, "path/path2");

This initializes a Var that is linked to the current instance ((instance) where the file will be) and the specified path ("path/path2"). Once created, this Var can be used to store and manage data with the supported variable types.



Methods Explanation:

setValue
This method is used to set the value of a specific variable, associating it with a given key and its corresponding type.

Example:

var.setValue(VarTypes.UUID,"key",UUID.randomUUID());

This sets a new UUID value for the key "key".

getValue
This method retrieves the value associated with the given key and type.

Example:

UUID value = var.getValue(VarTypes.UUID,"key");
note: u can also put an default value: var.getValue(VarTypes.UUID,"key",defaultValue);

This fetches the UUID value stored under the key "key".

save
This method saves the current state of the variable.

Example:

var.save();
This persists the variable’s value to disk or storage.

unload
This method unloads the variable, removing it from memory.

Example:

var.unload();

This ensures that the variable’s data is no longer in memory.

getKeys
This method retrieves all keys currently stored in the variable.

Example:

Set<String> keys = var.getKeys();
This fetches all keys from the variable.

saveAsync
This method saves the variable asynchronously, preventing server lag.

Example:

var.saveAsync();

This allows the save operation to happen in the background, improving server performance.
Resource Information
Author:
----------
Total Downloads: 48
First Release: Feb 14, 2025
Last Update: Yesterday at 2:58 AM
Category: ---------------
All-Time Rating:
1 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings