Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folia support for OpenInv? #132

Closed
Agaloth opened this issue Mar 29, 2023 · 2 comments
Closed

Folia support for OpenInv? #132

Agaloth opened this issue Mar 29, 2023 · 2 comments

Comments

@Agaloth
Copy link

Agaloth commented Mar 29, 2023

https://github.com/PaperMC/Folia

Here is a summary of everything made with ChatGPT to save some time:

For plugin developers, there are a few key takeaways from the given text:

  1. Folia introduces regionised multithreading, which means that plugins will require modification to function properly. Plugin developers should expect compatibility with existing plugins to be at zero.

  2. Folia introduces new API additions, such as the RegionisedScheduler and EntityScheduler, which can help plugins run on the correct thread context.

  3. To ensure compatibility with Folia, plugin developers must mark their plugin as compatible by placing "folia-supported: true" in the plugin.yml file. Additionally, plugins must take advantage of the RegionisedScheduler and EntityScheduler API to ensure correct behavior.

  4. Plugins should not assume that they can access or modify data in other regions, as Folia regions tick in parallel and do not share data. Plugin developers should take advantage of the upcoming thread-check API to ensure correct behavior.

  5. There are currently broken API, including the scoreboard API, and planned API changes, such as super aggressive thread checks, which may impact plugin development.

Overall, plugin developers should be prepared for significant changes in their plugins to ensure compatibility with Folia. They should take advantage of the new API additions and mark their plugin as compatible to ensure correct behavior. Additionally, they should be aware of the limitations and rules of Folia's regionised multithreading to avoid bugs and errors in their plugins.

@Jikoo
Copy link
Owner

Jikoo commented Mar 30, 2023

Looks very cool, but also very unstable. OI requires access to the main server thread for player loading currently, and given their per-entity scheduling that sounds like an absolute nightmare.

Going to say no and close this for now. If it stabilizes and becomes feasible, maybe, but frankly I'm not sure why this level of server mod is being slapped on top of Bukkit in the first place.

For future me if this gets bumped, the meat of the information was here https://github.com/PaperMC/Folia/blob/master/PROJECT_DESCRIPTION.md

@Jikoo Jikoo closed this as completed Mar 30, 2023
@Jikoo Jikoo pinned this issue May 1, 2023
@Jikoo
Copy link
Owner

Jikoo commented May 1, 2023

Pinning this to make it clearer that it is relevant but currently not planned.

The main problem is that due to the way it currently works, OI has to load a player who is not currently online. On servers with a main thread, this must be done on the main thread. Folia appears to delegate this entirely to the Mojang player list, which has some new form of concurrency baked in. OI needs to ensure thread safety with whatever mechanisms are introduced for this when constructing its ServerPlayer in addition to not causing memory leaks (which is very easy to do by accident, see #104). Essentially, I need to spend a not-insignificant amount of time reading through Folia's Mojang-mapped source.

Additionally, PaperLib has not updated to include any form of Folia support. This means I would be on the hook for maintaining utilities to bridge Spigot-Paper-Folia if I want to support all three platforms, which I have little to no interest in doing. https://github.com/A248/MorePaperLib exists (and I have a healthy respect for A248's abilities) so this may not be a huge hurdle.

The final major issue is that Folia is still very new. It's cool, it's flashy, but it's still very experimental. It's at a point where server internals (aka what OI deals with) may be subject to rapid and dramatic change. That means a repeat of the time investment reading the source over and over to keep up.

It is currently not worth it to me to support Folia, but I am open to it when Folia stabilizes more. In the event that Folia does stabilize, I would be willing to invest the required work into figuring it out. I would also welcome PRs adding support at that point, but I am not at this time interested in the potential support burden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants