HomeJavaModsFlatFileStorageAPI | [1.14 - 1.21.x] ⚡ Java API [DISCONTINUED]
FlatFileStorageAPI | [1.14 - 1.21.x] ⚡ Java API [DISCONTINUED]
ModsJava

FlatFileStorageAPI | [1.14 - 1.21.x] ⚡ Java API [DISCONTINUED]

⬇ Download on Spigot
FlatFileStorageAPI is a lightweight and easy-to-use plugin designed for Bukkit/Spigot/Paper Minecraft servers. It allows you to store persistent data in a flatfile storage system.

The plugin supports Java 14 to 21 and higher, as well as Minecraft server versions from 1.14 to 1.21+.

Currently, the plugin supports many data types and is constantly evolving, with new advanced types being implemented, such as Bukkit classes ( ItemStack, Location).

All loaded data is stored in RAM with O(1) access speed because Java efficiently manages memory, such as in the case of a HashMap holding 10,000,000 UUIDs, which typically requires around 160MB of memory (though overhead may increase total usage to approximately 300MB).

You should organize your data into multiple files, each containing specific data types (e.g., PlayerData, Islands, etc.) to maximize loading and saving speed.

Time(1M UUIDs):
The plugin is in beta stage(!) and continuously evolving. If you have any suggestions or improvements, feel free to let me know!

Supported Data Types:
Documentation

Using Var for Data Management

Installation & Setup
1. Download the API
Before using Var, you need to download the API and include it in your project.

2. Add it to Your Project
Code (Java):
<dependency >
    <groupId >your. group. id </groupId >
    <artifactId >FlatFileStorageAPI </artifactId >
    <version > 1.0 </version >
    <scope >system </scope >
    <systemPath >$ {project. basedir } /libs /FlatFileStorageAPI. jar </systemPath >
</dependency >
Creating a Var Instance
To create a new Var instance, use the following code:
Code (Java):
 getOrLoadVarAsync (instance, filePath ). thenAccept (var ->...         ;
This initializes a Var linked to the current instance (instance, where the file will be stored) and the specified path ("filePath"). Once created, this Var can store and manage data with supported variable types.

Methods & Usage
1. Setting a Value
Use setValue to store a value under a specific key with its associated type.

Example:
Code (Java):
var. setValue (VarTypes. UUID, "key", UUID. randomUUID ( ) ) ;
This assigns a UUID value to the key "key".

2. Retrieving a Value
Use getValue to retrieve a stored value based on its key and type.

Example:
Code (Java):
UUID value = var. getValue (VarTypes. UUID, "key" ) ;
You can also specify a default value in case the key is missing:
Code (Java):
UUID value = var. getValue (VarTypes. UUID, "key", defaultValue ) ;
3. Saving Data
To save the current state of the Var, use saveSync() or saveAsync().

Example:
Code (Java):
var. saveSync ( ) ;
This persists the stored data to disk or storage.

Saving Asynchronously
For better server performance, use saveAsync() to save data in the background.

Example:
Code (Java):
var. saveAsync ( ) ;
This prevents lag by handling the save operation off the main thread.

4. Unloading Data from Memory
No strong reference will hold your Var except yourself; to unload it, simply remove your strong references. The GC(Garbage Collector) will remove it by itself.

This ensures that the Var’s data is removed from RAM, optimizing performance.

5. Retrieving All Stored Keys
Use getKeys() to get a list of all stored keys inside a Var.

Example:
Code (Java):
Set <String > keys = var. getKeys ( ) ;
This allows you to check all available data stored in the Var.


If you have any issues or suggestions, join our Discord: https://discord.gg/veZJqU5wkT

[​IMG]

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

FlatFileStorageAPI | [1.14 - 1.21.x] ⚡ Java API [DISCONTINUED] is a free Minecraft Java mod. Compatible with Minecraft 1.14, 1.15, 1.16, 1.17 and newer. Downloaded 272 times (via Spigot). Download it and open it directly in the game.

Explore more