Page cover

Welcome

This library contains useful tools such as simplified logging, test helpers, a good universal configuration library and an interesting abstract database library.

This library is used in many of my (Smudgge's) projects, one specifically leaf currently being used on 72 servers (2024).


Intro to Configuration

Create and load a config file
Configuration config = new YamlConfiguration(new File("file.yml"));
config.setResourcePath("file.yml"); // The name of the file in the resource folder.
config.load();
Read and write
String hello = config.getString("hello", "hello world");
config.set("hello", "hello again");
Save changes to the file
config.save();

This is quite similar to the spigot configuration classes but designed to be simpler.


Intro to Databases

Below is a step-by-step guide to creating a simple database and querying.

database.yml
# Database Library Author: Smudge
# File: database.yml

should_reconnect_every_cycle: true
reconnect_cooldown_millis: 2000
will_reconnect: true
time_between_requests_millis: 100
max_requests_pending: 40

sqlite:
  enabled: true
  path: "plugins/CozyJoinLeave/database.sqlite3"

Last updated