Skip to content

Commit

Permalink
Fix StructCommand Illegal Task Scheduling (#6788)
Browse files Browse the repository at this point in the history
  • Loading branch information
APickledWalrus authored Jun 20, 2024
1 parent 7fc699e commit 2e0d1cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/ch/njol/skript/structures/StructCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 2e0d1cf

Please sign in to comment.