mirror of
https://github.com/filoghost/ChestCommands.git
synced 2025-02-16 19:41:47 +01:00
Use new scheduler methods
This commit is contained in:
parent
e04394f15f
commit
71439303b9
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user