I'm currently in the process of designing a complex YAML data storage system for my hugs plugin and would appreciate some thoughts and feedback on this system.
Some Prerequisite Information
- I'm aware that other database solutions would work far better and I plan on adding support for them at a later time. That being said, I want to create a system that works out of the box with yaml and can be converted back and forth to whatever storage solution the end user wants.
- I'm willing to write this from scratch.
Current Setup
Currently, I have a per-player data system. Each player has their own file with the format <UUIID>.yml and this is how the file is structured.
uuid: 03687ca0-30cf-4c3c-8c1d-3b2dd75c3ff0
name: Nothixal
settings:
language: "en"
huggable: true
# There are two types of particles.
# HEART & DAMAGE_INDICATOR
# There will be several different animations.
# The animations will only show up when extreme quality is enabled.
particles:
type: "HEART"
quality: "high"
animation: "default"
sounds:
menu: true
commands: true
indicators:
chat: true
actionbar: true
bossbar: true
titles: true
toast: true
data:
self_hugs: 2147483647
normal_hugs:
given: 2147483647
received: 2147483647
mass_hugs:
given: 2147483647
received: 2147483647
last_hug:
given:
to: 03687ca0-30cf-4c3c-8c1d-3b2dd75c3ff0
timestamp: 1642302107
received:
from: 03687ca0-30cf-4c3c-8c1d-3b2dd75c3ff0
timestamp: 1642302107
first_hug:
given:
to: 03687ca0-30cf-4c3c-8c1d-3b2dd75c3ff0
timestamp: 1642302107
received:
from: 03687ca0-30cf-4c3c-8c1d-3b2dd75c3ff0
timestamp: 1642302107
These files are only loaded into memory when the player is online.
By itself, the file is 1.1kB in size. (1.0kB without spacing)