From 352eab6f1d68e94038b1a7af43117c94509ee1d5 Mon Sep 17 00:00:00 2001 From: APickledWalrus Date: Sat, 15 Jun 2024 16:39:23 -0400 Subject: [PATCH] Don't delay command syncing if Skript is disabled --- src/main/java/ch/njol/skript/structures/StructCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/njol/skript/structures/StructCommand.java b/src/main/java/ch/njol/skript/structures/StructCommand.java index e50476e5a8e..fc69c26aae0 100644 --- a/src/main/java/ch/njol/skript/structures/StructCommand.java +++ b/src/main/java/ch/njol/skript/structures/StructCommand.java @@ -338,7 +338,9 @@ private void scheduleCommandSync() { if (SYNC_COMMANDS.get()) { SYNC_COMMANDS.set(false); if (DELAY_COMMAND_SYNCING) { - Bukkit.getScheduler().runTask(Skript.getInstance(), this::forceCommandSync); + // if the plugin is disabled, the server is likely closing and delaying will cause an error. + if (Bukkit.getPluginManager().isPluginEnabled(Skript.getInstance())) + Bukkit.getScheduler().runTask(Skript.getInstance(), this::forceCommandSync); } else { forceCommandSync(); }