mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-23 08:59:23 +00:00
32 lines
1.2 KiB
Diff
32 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: wangxyper <wangxyper@163.com>
|
|
Date: Sat, 28 Jan 2023 13:05:12 +0800
|
|
Subject: [PATCH] MikuServer: Fix threading issue in event system
|
|
|
|
Original license: MIT
|
|
Original project: https://github.com/MikuMC/MikuServer
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index 96cde1f86ca073e7e9e5799bcb12a10adf9230b2..30509d85391ce2fb170751170f3d4310ef856aea 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -1,5 +1,6 @@
|
|
package org.bukkit.craftbukkit;
|
|
|
|
+import co.mikumc.mikuserver.utils.AnotherTickThread;
|
|
import com.google.common.base.Charsets;
|
|
import com.google.common.base.Function;
|
|
import com.google.common.base.Preconditions;
|
|
@@ -415,6 +416,11 @@ public final class CraftServer implements Server {
|
|
}
|
|
}
|
|
|
|
+ @Override
|
|
+ public boolean isCurrentThreadWorker(){
|
|
+ return Thread.currentThread() instanceof AnotherTickThread;
|
|
+ }
|
|
+
|
|
private void saveCommandsConfig() {
|
|
try {
|
|
this.commandsConfiguration.save(this.getCommandsConfigFile());
|