9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-19 14:59:19 +00:00

Fix error with folia scheduler since paper update

This commit is contained in:
SamB440
2025-09-04 16:47:07 +01:00
parent 8012dfd094
commit d2231a1192

View File

@@ -55,6 +55,11 @@ public class FoliaScheduler extends PlatformScheduler<IRPGRegionsAPI> implements
@Override
public RPGRegionsTask executeRepeating(Runnable runnable, long delay, long period) {
// Folia scheduler does not allow this for some reason.
if (delay == 0) {
delay = 1;
}
final ScheduledTask task = Bukkit.getGlobalRegionScheduler().runAtFixedRate((Plugin) api, (s) -> runnable.run(), delay, period);
return task::cancel;
}