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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user