EverNife / EverNifeCore

A Minecraft Framework to help the creation of Bukkit/Spigot Minecraft plugins, with several utilities to interact with Forge as well.
11 stars 4 forks source link

Adding Mysql Components #4

Open ailanlana opened 4 months ago

ailanlana commented 4 months ago

Right now it looks like the only storage method is YAML, will you consider adding Mysql support?

EverNife commented 4 months ago

Until today i have had no comission that required the PlayerData to be on a MySQL database.

Adding support for other types of storage is possible, but is not something easy to be done, mainly because most of my plugins does not have a relational-only strucutre.

If i had to create a support for mysql it would be necessary to store the PlayerData (mainly its PDSections) on a table as JSON.


More important, what are you trying to do? Why do you need another type of storage here?

ailanlana commented 4 months ago

Since Minecraft can't be multithreaded and my server has a lot of mods, I had to resort to multiple zones to host more players. Doing this requires me to synchronize data between zones, which requires a database such as mysql.

EverNifeCore is a great plugin, I rely on it for some of my current plugins, and it would be great to have database support.

EverNife commented 2 months ago

I have started the implementation of this feature. To be honest it's not easy and will take some time.

The PDSections must allow a few customizations, with scenarios like:

This will require PDSections to be registered individually with custom configurations to make them hotloaded as soon as EverNifeCore loads/reloads.

PlayerController.registerAutoLoadPDSection(
    instance,
    FEPlayerData.class
);

Also keep PDSections being able to store their data still using YamlSyntax, so, if we end up with a MySQL database it will be in tables of json values and with other NoSQL databases would still be easy to implement.


The idea is still abstract in my mind on how to implement that, but it will eventually arrive.