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

[Feature] Folia support #8

Open
Potothingi opened this issue Jun 12, 2023 · 4 comments
Open

[Feature] Folia support #8

Potothingi opened this issue Jun 12, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@Potothingi
Copy link

I hope someday this plugin will support Folia.
Folia isn't a stable release yet, so don't rush.

Currently, 'ProtocolLib, Vault, LuckPerms, PlaceholderAPI, EssentialsX, ViaVersion, ViaBackwards, CoreProtect, DiscordSRV, Chunky, Spark' plugins already support Folia, or Folia support is ready in pull requests.

https://docs.papermc.io/folia

@Potothingi Potothingi added the enhancement New feature or request label Jun 12, 2023
@Rapha149
Copy link
Owner

The problem is that I really don't know anything about Folia. But it's a fork of Paper so it could work without adapting it.

@Potothingi
Copy link
Author

The problem is that I really don't know anything about Folia. But it's a fork of Paper so it could work without adapting it.

https://github.com/PaperMC/Folia#plugin-compatibility

First, Folia breaks many plugins. To aid users in figuring out which plugins work, only plugins that have been explicitly marked by the author(s) to work with Folia will be loaded. By placing "folia-supported: true" into the plugin's plugin.yml, plugin authors can mark their plugin as compatible with regionised multithreading.

The other important rule is that the regions tick in parallel, and not concurrently. They do not share data, they do not expect to share data, and sharing of data will cause data corruption. Code that is running in one region under no circumstance can be accessing or modifying data that is in another region. Just because multithreading is in the name, it doesn't mean that everything is now thread-safe. In fact, there are only a few things that were made thread-safe to make this happen. As time goes on, the number of thread context checks will only grow, even if it comes at a performance penalty - nobody is going to use or develop for a server platform that is buggy as hell, and the only way to prevent and find these bugs is to make bad accesses fail hard at the source of the bad access.

This means that Folia compatible plugins need to take advantage of API like the RegionScheduler and the EntityScheduler to ensure their code is running on the correct thread context.

Add folia-supported: true to plugin.yml. And use RegionScheduler and EntityScheduler instead of Bukkit Scheduler.

@Rapha149
Copy link
Owner

Okay, I'll check when I have time to implement that.

@Rapha149 Rapha149 changed the title Feature request: Folia support [Feature] Folia support Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants