Repository navigation
Add Folia support - #150
Open
CuukyOfficial wants to merge 10 commits into
Open
CuukyOfficial wants to merge 10 commits into
CuukyOfficial wants to merge 10 commits into
Conversation
Migrate all scheduler usage to the CFW TaskScheduler, make player, entity, block and world access region-aware and mark the plugin as Folia-supported. Scoreboards/nametags and the AutoSetup are not available on Folia. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APs98rPwpPZxMpjv4TcLiF
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APs98rPwpPZxMpjv4TcLiF
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APs98rPwpPZxMpjv4TcLiF
…ts on errors Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APs98rPwpPZxMpjv4TcLiF
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APs98rPwpPZxMpjv4TcLiF
Sidebar and nametags use CFW's packet based scoreboards on Folia. AutoSetup scans and edits terrain per chunk via the owning region thread (BlockEditor, ColumnScan). Removes the Folia startup warning. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APs98rPwpPZxMpjv4TcLiF
paper-plugin.yml list format, VaroBootstrap overload for 1.19.x, XGameRule fallback, null guards for players leaving during start sequences. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APs98rPwpPZxMpjv4TcLiF
…volatile Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APs98rPwpPZxMpjv4TcLiF
…ronizedArrayList, add platform helpers and tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APs98rPwpPZxMpjv4TcLiF
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APs98rPwpPZxMpjv4TcLiF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Folia support
The plugin now loads and runs on Folia (
folia-supported: trueinplugin.ymlandpaper-plugin.yml) with unchanged behavior on Bukkit/Spigot/Paper.Depends on CuukyOfficial/CFW#37. It has to be merged and released first, then
cfwingradle/libs.versions.tomlhas to be bumped. Until then the project does not compile against the published CFW.Changes
BukkitScheduler/BukkitRunnable/BukkitTaskusage was migrated to CFW'sTaskScheduler/TaskRunnable/Task, accessed via the newMain.scheduler().executeFor/executeAt/execute). On non-Folia servers this runs inline on the main thread as before.SafeTeleport, which is asynchronous on Folia.SpawnGeneratorexposes a future; the game start continues once all spawns exist.VaroPlayer,VaroTeam,Spawn, backups, alerts, ...) uses thread-safe lists;SynchronizedArrayListiterates on a snapshot.Scoreboards and AutoSetup on Folia
getNewScoreboard/setScoreboard, so CFW sends the scoreboard as packets (Mojang mapped servers, 1.20.5+)./varo autosetup runworks: terrain is scanned and edited per chunk by the owning region thread (ColumnScan,BlockEditor); spawn, portal and lobby generators expose futures. WorldEdit schematic lobbies depend on WorldEdit's own Folia support.Testing
Automated with a mineflayer bot (join,
/varo spawns,/varo startincl. spawn generation, admin commands, death/kick, shutdown with a player online):/varo start, sidebar toggle, nametag teams with two players), Paper 1.21.11 (with forced packet scoreboards) and 1.12.2 on Java 8 (full flow incl. AutoSetup)Pre-existing problems that are unchanged by this PR: Paper 1.16.5/1.21.8 fail at startup in XSeries (
GameRule.getKey()), andsetNormalAttackSpeedthrows an NPE on respawn after a death kick (seen on 1.12.2).Several independent review passes (thread-safety, migration, Folia API conformance, design) were run; their findings are incorporated.
Stand
Scoreboards, nametags and AutoSetup work on every supported platform; full flow (AutoSetup,
/varo start, sidebar toggle, nametag team, two bots) was tested on:No JVM arguments needed. Folia 1.20.6 and 26.3 start fine (the test bot cannot join those versions).
Reviews (architecture, thread safety) done and their findings implemented:
ScoreboardInstanceis platform neutral (registerSideBar()is void,newInstancethrows instead of returning null); Bukkit specifics (getSideBar,getScoreboard) moved toBukkitScoreboardInstance. Lost scoreboard packets (player without connection) are resent, unit tests with a fakePacketFactory, fail fast if the Folia scheduler API is unusable.SynchronizedArrayListcovers the remaining mutators (subList/listIteratorare snapshots), platform forks moved toVaroUtilshelpers, unit tests forSynchronizedArrayList.Also: the Folia scheduler is compiled against
folia-apiin its own source set (no reflection; onlyFoliaPlatformis instantiated reflectively so other servers never load Folia classes); packet factories share their reflection helper (NMS access stays reflective, there is no API for scoreboard packets). Varo has a CI workflow (scripts/smoke-test.sh) that starts Folia 1.19.4-26.1 and Paper and checks that the plugin enables cleanly. Verified that game data surviveskill -9(autosave) and a regular stop: a started game with a team was restored after restart on Folia 26.1, Paper 1.21.11 and Spigot 1.8.8.🤖 Generated with Claude Code