BentoBoxWorld / BentoBox

Expandable Minecraft server plugin for island-type games like SkyBlock or AcidIsland.
https://bentobox.world
Eclipse Public License 2.0
335 stars 140 forks source link

Request - More API methods #2392

Closed rudde0 closed 5 months ago

rudde0 commented 5 months ago

Is your feature request related to a problem?

Hey there,

I'm working on multi-server instance by my own and I need several methods to sync data accross the servers.

Main problem is, specific islands can't be fetched from db and can't uploaded to db whenever I want. I know IslandsManager#saveAll() exists but incremental operations might be more performant. My second problem is syncing cached data of player.

Describe the solution you'd like.

I need some methods to handle: IslandsManager#saveIsland(Island island); IslandsManager#loadIsland(Island island); PlayersManager#save(UUID playeruuid); PlayersManager#load(UUID playeruuid);

Describe alternatives you've considered.

Also listed versions of island management would be nice: IslandsManager#saveIslands(Set<Island> islands); IslandsManager#loadIslands(Set<Island> islands);

Agreements

Other

Please consider to expanding the API with those methods.

tastybento commented 5 months ago

Have you had a look at 2.4.0? It's written to support multipaper so it logs everything in the database continuously to ensure that multiple servers can pull from the database. It does use inter-server communication via MultiLib to keep servers in sync when things like a new island is made on one of them.

rudde0 commented 5 months ago

Am I need to use MultiPaper?

I'm using BentoBox 2.4.0-SNAPSHOT-b2624 on my Purpur server and there aren't any synchronization unless the things I do IslandsManager#saveAll() and IslandsManager#load() in certain places. Also I can't load/save players via API.

tastybento commented 5 months ago

Adding the following. I recommend you read the JavaDocs for them.

PlayersManager#loadPlayer(UUID uuid)
PlayersManager#savePlayer(UUID uuid)

IslandsManager: