HiveJSON - Store data easily with JSON. icon

HiveJSON - Store data easily with JSON. -----

A very easy to use library that makes it easy to store player data, and much more.



Installation
hive-json can be added to your project using the JitPack repository, here's an example of how that can be done.

Code (Text):
repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.xLevitate:hive-json:1.1.0'
}
Example Usage
Here's an example of how hive-json can be used in your code, in this example I'll be showcasing a simple example of how to store Minecraft player levels using the Spigot API.

Code (Java):
public class LevelStorage extends JSONStorage <UUID, Long > {
    public LevelStorage (Plugin plugin ) {
        super (plugin. getDataFolder ( ), "levels.json", UUID. class, Long. class ) ;

        // Load data from file
        load ( ) ;
    }

    public long getLevel (UUID uuid ) {
        return getStorage ( ). getOrDefault (uuid, 1L ) ;
    }
}
You can now initialize this class and it will automatically create a HashMap of UUID & Long, load data from file if found to that HashMap, and you can run the save() function to save the data to file.

By using the getStorage() function you can access the HashMap and make any changes or get information from there.
Resource Information
Author:
----------
Total Downloads: 23
First Release: Sep 11, 2024
Last Update: Sep 11, 2024
Category: ---------------
All-Time Rating:
0 ratings
Find more info at github.com...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings