PluginBugs / Issues-ItemsAdder

Repository used to keep track of issues of my plugin ItemsAdder
https://itemsadder.devs.beer
53 stars 21 forks source link

AdvancedSlimePaper compatibility limitation - can't save custom blocks region files into external locations (SQL, S3 server, etc.) #3154

Open emmanuelvlad opened 10 months ago

emmanuelvlad commented 10 months ago

Terms

Discord tag (optional)

No response

Describe the solution you'd like

Allow for ItemsAdder to consider noteblock's instrument on events such as interact... to check if it could be a custom block.

The same goes for the chorus_plant and its direction

Is your feature request related to a problem?

When using ItemsAdder on worlds which aren't saved on the file system (ex. SlimeWorld...)

Describe alternatives you've considered

none

Additional context

No response

github-actions[bot] commented 10 months ago

Hello, your report will be looked into as soon as possible. Please do not bump this thread and don't post it on multiple platforms.

Thanks a lot for your patience.

LoneDev6 commented 10 months ago

ItemsAdder is already compatible with AdvancedSlimePaper. https://github.com/PluginBugs/Issues-ItemsAdder/issues/1589

You don't really have to do anything to make it compatible. Please if you have any issue clearly report what is broken, last time I tested it worked correctly.

emmanuelvlad commented 10 months ago

@LoneDev6 It is compatible only if the server keeps the ItemsAdder's region files on the system, which isn't the case of worlds loaded from outside the file system such as from a S3 server, SQL, Redis...

The reason most (all?) of the people using SlimeWorld is for its scalability, being able to load the world from any server, not being tied to a specific installation...

LoneDev6 commented 10 months ago

Relying on vanilla blocks data is not reliable because it can lead to various issues. An example are other plugins (or vanilla behaviours) changing block data of a block causing unintended custom blocks to be obtainable. ItemsAdder region files were introduced to save blocks data fast and avoid these situations.

Anyway you could set this

  convert-vanilla-blocks:
    enabled: true
    only-new-chunks: false

but it's probably not really ideal for how Slime worlds works in your setup.

emmanuelvlad commented 10 months ago

Anyway you could set this

  convert-vanilla-blocks:
    enabled: true
    only-new-chunks: false

but it's probably not really ideal for how Slime worlds works in your setup.

Indeed, it didn't help

Relying on vanilla blocks data is not reliable because it can lead to various issues. An example are other plugins (or vanilla behaviours) changing block data of a block causing unintended custom blocks to be obtainable. ItemsAdder region files were introduced to save blocks data fast and avoid these situations.

Understandable, to tackle this issue could we have an API implementation of the region files persistence?

By default it uses the local file system implementation (maybe world based?), else we could provide a custom implementation for getting (important since SlimeWorld holds the data in memory), saving, loading chunks data.

I could develop a SlimeWorld compatibility plugin which will serialize ItemsAdder's region files in an extra field, and for loading the world it would deserialize the data after WorldLoad. What do you think @LoneDev6?

LoneDev6 commented 10 months ago

could develop a SlimeWorld compatibility plugin which will serialize ItemsAdder's region files in an extra field, and for loading the world it would deserialize the data after WorldLoad

Is AdvancedSlimePaper providing a way to register custom data? If yes, well I can do that on my own and save the custom region data also on AdvancedSlimePaper internal data. But last time I checked there wasn't any API for that.

emmanuelvlad commented 10 months ago

I think there are two solutions:

  1. AdvancedSlimePaper supports chunk PDC (which I've heard is being worked on by @kyngs) This means ItemsAdder would have to save block datas into PDC (maybe as an optional "unstable" feature for slimeworld uses only?)
  2. External devs working on "bridges" between their own SlimeWorld persistence method (sql, custom API...). Devs would need an API from ItemsAdder to serialize chunks data

I would prefer the first one since its using well known feature that is PDC and directly writing extra data in the world's file

kyngs commented 10 months ago

AdvancedSlimePaper supports chunk PDC (which I've heard is being worked on by @kyngs) This means ItemsAdder would have to save block datas into PDC (maybe as an optional "unstable" feature for slimeworld uses only?)

Tbh, I haven't even started to work on that. Currently, only PDC on the World object is supported. No ETA for this.

Considering the whole slimeworld is loaded at once, IA could store the block data in the extra NBT tag, or the PDC in the Bukkit World object.

LoneDev6 commented 10 months ago

Considering the whole slimeworld is loaded at once, IA could store the block data in the extra NBT tag, or the PDC in the Bukkit World object.

This would require me to rewrite most part of the blocks saving which I'd avoid. The main reason why I have a custom region files format is for performance.

In the past I benchmarked the Bukkit extra NBT tag and was extremely slow, so I had to code my own lightweight solution.