Use new scheduler methods

This commit is contained in:
filoghost 2020-06-06 11:04:58 +02:00
parent e04394f15f
commit 71439303b9
3 changed files with 4 additions and 4 deletions

View File

@ -141,12 +141,12 @@ public class ChestCommands extends JavaPlugin {
lastLoadErrors = errorCollector;
if (errorCollector.hasWarningsOrErrors()) {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, () -> {
Bukkit.getScheduler().runTaskLater(this, () -> {
errorCollector.logToConsole();
}, 10L);
}
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new RefreshMenusTask(), 2L, 2L);
Bukkit.getScheduler().runTaskTimer(this, new RefreshMenusTask(), 2L, 2L);
}

View File

@ -37,7 +37,7 @@ public class OpenMenuAction extends Action {
* Delay the task, since this action is executed in ClickInventoryEvent
* and opening another inventory in the same moment is not a good idea.
*/
Bukkit.getScheduler().scheduleSyncDelayedTask(ChestCommands.getInstance(), () -> {
Bukkit.getScheduler().runTask(ChestCommands.getInstance(), () -> {
if (player.hasPermission(menu.getPermission())) {
menu.open(player);
} else {

View File

@ -81,7 +81,7 @@ public class InventoryListener implements Listener {
}
// Closes the inventory and executes actions AFTER the event
Bukkit.getScheduler().scheduleSyncDelayedTask(ChestCommands.getInstance(), new ExecuteActionsTask(clicker, icon));
Bukkit.getScheduler().runTask(ChestCommands.getInstance(), new ExecuteActionsTask(clicker, icon));
}
}
}