Skip to content

Commit

Permalink
Fix issues related to MythicMobs (#153 )
Browse files Browse the repository at this point in the history
Fix issues related to MythicMobs
  • Loading branch information
HaHaWTH authored Nov 7, 2024
2 parents 859a1cc + cff7d95 commit 2de96fc
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions patches/server/0119-Multithreaded-Tracker.patch
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ But it is still recommending to use those packet based, virtual entity
based NPC plugins, e.g. ZNPC Plus, Adyeshach, Fancy NPC, etc.

diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
index e42677bb004201efe1702779a78cc8d0ca05e80f..3fa04bad6f5263c626c22ef0a795947391e1e710 100644
index e42677bb004201efe1702779a78cc8d0ca05e80f..6676be8304e9415099ed423d3315180cafebd928 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
@@ -42,6 +42,12 @@ class PaperEventManager {
if (event.isAsynchronous() && this.server.isPrimaryThread()) {
throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
} else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
+ // Leaf start - Multithreaded tracker
+ if (org.dreeam.leaf.config.modules.async.MultithreadedTracker.enabled && Thread.currentThread() instanceof org.dreeam.leaf.async.tracker.MultithreadedTracker.MultithreadedTrackerThread) {
+ if (org.dreeam.leaf.config.modules.async.MultithreadedTracker.enabled) {
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(event::callEvent);
+ return;
+ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This patch was ported from project: https://github.com/snackbag/TT20
Project license: AGPL-3.0

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 09e55f62b4cea5b058e04356252f4f56957646b8..279289e0c3dc65fed0ee4b2f5b0ef077ab433d5e 100644
index 37c377761b45eefab39164a7e714e585a02a4447..f268001f7a821ad1d0db8a02de19e80cc951d0fd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1628,6 +1628,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ index 11b7f15755dde766140c29bedca456c80d53293f..749d00449ac3f3c79bfc73a5517ea3a0
this.id = id;
}
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
index 3fa04bad6f5263c626c22ef0a795947391e1e710..411bc27324c34e4cad1849512a4531214d7fe9d2 100644
index 6676be8304e9415099ed423d3315180cafebd928..30b56382e9574004e344c1c8289d7dcbb177386b 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
@@ -48,6 +48,12 @@ class PaperEventManager {
return;
}
// Leaf end - Multithreaded tracker
+ // Leaf start - Async locator
+ if (org.dreeam.leaf.config.modules.async.AsyncLocator.enabled && Thread.currentThread() instanceof org.dreeam.leaf.async.locate.AsyncLocator.AsyncLocatorThread) {
+ if (org.dreeam.leaf.config.modules.async.AsyncLocator.enabled) {
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(event::callEvent);
+ return;
+ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Virtual thread for chat executor


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 37c377761b45eefab39164a7e714e585a02a4447..09e55f62b4cea5b058e04356252f4f56957646b8 100644
index f268001f7a821ad1d0db8a02de19e80cc951d0fd..279289e0c3dc65fed0ee4b2f5b0ef077ab433d5e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2894,7 +2894,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2900,7 +2900,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}

public final java.util.concurrent.ExecutorService chatExecutor = java.util.concurrent.Executors.newCachedThreadPool(
Expand Down

0 comments on commit 2de96fc

Please sign in to comment.