Skip to content

Add Folia support#104

Merged
PuppyTransGirl merged 4 commits intomasterfrom
feat/folia-compatibility
Feb 20, 2026
Merged

Add Folia support#104
PuppyTransGirl merged 4 commits intomasterfrom
feat/folia-compatibility

Conversation

@PuppyTransGirl
Copy link
Copy Markdown
Owner

Close #87

@PuppyTransGirl PuppyTransGirl added this to the 3.4.0 milestone Feb 20, 2026
@PuppyTransGirl PuppyTransGirl self-assigned this Feb 20, 2026
@PuppyTransGirl PuppyTransGirl added the feature New feature request or implementation label Feb 20, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 20, 2026

📝 Walkthrough

Walkthrough

The pull request replaces BukkitTask with io.papermc.paper.threadedregions.scheduler.ScheduledTask across the codebase, updating Button, DoubleDropButton, ParticleUtils, and other usages. The Task utility now exposes region-aware scheduling APIs that accept Consumer, convert timing to tick-based delays, and route through Paper/Folia schedulers. plugin.yml and test manifest add folia-supported: true, and the root build.gradle.kts invokes runPaper.folia.registerTask().

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective of the pull request, which is to add Folia support across the codebase.
Description check ✅ Passed The description references issue #87, which is directly related to the Folia support feature being implemented in this pull request.
Linked Issues check ✅ Passed The pull request implements Folia support by converting from Bukkit scheduler to Paper region schedulers, updating task types, and adding Folia compatibility flags [#87].
Out of Scope Changes check ✅ Passed All changes directly relate to implementing Folia support: Folia integration in build configuration, migration from BukkitTask to ScheduledTask, scheduler backend updates, and compatibility flags.
Docstring Coverage ✅ Passed Docstring coverage is 89.47% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/toutouchien/niveriaapi/utils/ParticleUtils.java (1)

515-521: ⚠️ Potential issue | 🔴 Critical

Initial delay of 0 will cause IllegalArgumentException at runtime.

Task.syncRepeat is called with delay=0 and TimeUnit.MILLISECONDS, which yields 0 / 50 = 0 ticks. The underlying GlobalRegionScheduler.runAtFixedRate requires initialDelayTicks >= 1 and throws IllegalArgumentException("Initial delay ticks may not be <= 0"). This applies to both followEntity (line 516) and animateParticles (line 571).

🐛 Proposed fix
-        ScheduledTask task = Task.syncRepeat(ignored -> {
+        ScheduledTask task = Task.syncRepeat(ignored -> {
             if (!entity.isValid())
                 return;
 
             spawnParticle(entity.getLocation().add(0, 1, 0), particle, count, offsetX, offsetY, offsetZ, speed, null, false);
-        }, plugin, 0, interval * 50L, TimeUnit.MILLISECONDS);
+        }, plugin, 50L, interval * 50L, TimeUnit.MILLISECONDS);

And for animateParticles:

-        ScheduledTask task = Task.syncRepeat(ignored -> {
+        ScheduledTask task = Task.syncRepeat(ignored -> {
             ...
-        }, plugin, 0, ticksPerFrame * 50L, TimeUnit.MILLISECONDS);
+        }, plugin, 50L, ticksPerFrame * 50L, TimeUnit.MILLISECONDS);

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 8.69565% with 63 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...c/main/java/toutouchien/niveriaapi/utils/Task.java 10.16% 53 Missing ⚠️
...va/toutouchien/niveriaapi/utils/ParticleUtils.java 0.00% 7 Missing ⚠️
.../niveriaapi/menu/component/interactive/Button.java 0.00% 2 Missing ⚠️
...i/menu/component/interactive/DoubleDropButton.java 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

@PuppyTransGirl PuppyTransGirl merged commit ffdb9b3 into master Feb 20, 2026
5 checks passed
@PuppyTransGirl PuppyTransGirl deleted the feat/folia-compatibility branch February 21, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature request or implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Folia

2 participants