Conversation
📝 WalkthroughWalkthroughThe 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)
✏️ 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. Comment |
There was a problem hiding this comment.
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 | 🔴 CriticalInitial delay of
0will causeIllegalArgumentExceptionat runtime.
Task.syncRepeatis called withdelay=0andTimeUnit.MILLISECONDS, which yields0 / 50 = 0ticks. The underlyingGlobalRegionScheduler.runAtFixedRaterequiresinitialDelayTicks >= 1and throwsIllegalArgumentException("Initial delay ticks may not be <= 0"). This applies to bothfollowEntity(line 516) andanimateParticles(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 Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Close #87