drtshock / PlayerVaults

Player vaults for player players.
GNU General Public License v3.0
87 stars 118 forks source link

Folia support for PlayerVaults #448

Open Agaloth opened 1 year ago

Agaloth commented 1 year ago

Idea

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.

Details

Folia will be a game changer for most servers and we need to make sure all plugins supports it, I know that this can take a while to implement.

Atticuss26 commented 1 year ago

I would like this.

mbax commented 1 year ago

I am working on Folia support in the rewrite.

iLemon commented 12 months ago

This might be of interest: https://github.com/TechnicallyCoded/FoliaLib

Here's the error on startup with the latest PlayerVaults from github on Folia 1.20.1:

[13:11:00] [Server thread/INFO]: [PlayerVaults] Enabling PlayerVaults v4.2.14
[13:11:01] [Server thread/INFO]: [PlayerVaults] config took 107ms
[13:11:01] [Server thread/INFO]: [PlayerVaults] conversion took 1ms
[13:11:01] [Server thread/INFO]: [PlayerVaults] uuidvaultmanager took 0ms
[13:11:01] [Server thread/INFO]: [PlayerVaults] registering listeners took 3ms
[13:11:01] [Server thread/INFO]: [PlayerVaults] loaded signs took 0ms
[13:11:01] [Server thread/INFO]: [PlayerVaults] registered commands took 2ms
[13:11:01] [Server thread/INFO]: [PlayerVaults] setup economy took 0ms
[13:11:01] [Server thread/ERROR]: Error occurred while enabling PlayerVaults v4.2.14 (Is it up to date?)
java.lang.UnsupportedOperationException: null
    at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.handle(CraftScheduler.java:533) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:233) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:209) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at org.bukkit.scheduler.BukkitRunnable.runTaskTimer(BukkitRunnable.java:117) ~[folia-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at com.drtshock.playervaults.PlayerVaults.onEnable(PlayerVaults.java:184) ~[PlayerVaultsX.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[folia-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[folia-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:642) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:553) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:679) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:463) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1188) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:346) ~[folia-1.20.1.jar:git-Folia-"6b978f2"]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
[13:11:01] [Server thread/INFO]: [PlayerVaults] Disabling PlayerVaults v4.2.14
mbax commented 12 months ago

Sorry, but no interest there. Forcibly shoving folia support into 4.x will fail or risk data corruption or duplication.

Rewrite, which is making good progress, is the way to go here.

iLemon commented 12 months ago

Sounds good. Happy to help test when it's ready.

mbax commented 12 months ago

I'll have updates and testing information available first on Discord, prior to full release.