-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
157 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
patches/server/0016-Add-config-to-disable-entity-tick-catchers.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: MrHua269 <wangxyper@163.com> | ||
Date: Mon, 12 Aug 2024 21:30:50 +0800 | ||
Subject: [PATCH] Add config to disable entity tick catchers | ||
|
||
|
||
diff --git a/src/main/java/me/earthme/luminol/config/modules/experiment/DisableEntityCatchConfig.java b/src/main/java/me/earthme/luminol/config/modules/experiment/DisableEntityCatchConfig.java | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..0fd71151a85dd87c2294033e2e7512ac365caa62 | ||
--- /dev/null | ||
+++ b/src/main/java/me/earthme/luminol/config/modules/experiment/DisableEntityCatchConfig.java | ||
@@ -0,0 +1,20 @@ | ||
+package me.earthme.luminol.config.modules.experiment; | ||
+ | ||
+import me.earthme.luminol.config.ConfigInfo; | ||
+import me.earthme.luminol.config.EnumConfigCategory; | ||
+import me.earthme.luminol.config.IConfigModule; | ||
+ | ||
+public class DisableEntityCatchConfig implements IConfigModule { | ||
+ @ConfigInfo(baseName = "enabled") | ||
+ public static boolean enabled = false; | ||
+ | ||
+ @Override | ||
+ public EnumConfigCategory getCategory() { | ||
+ return EnumConfigCategory.EXPERIMENT; | ||
+ } | ||
+ | ||
+ @Override | ||
+ public String getBaseName() { | ||
+ return "disable_entity_exception_catchers"; | ||
+ } | ||
+} | ||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java | ||
index 75ecbdb5bdacb4d4b27d60fe1c1a35c3a9c16207..fc43204a9234ebac35003121e7ae29e566a6386b 100644 | ||
--- a/src/main/java/net/minecraft/world/level/Level.java | ||
+++ b/src/main/java/net/minecraft/world/level/Level.java | ||
@@ -1351,7 +1351,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { | ||
tickConsumer.accept(entity); | ||
MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick | ||
} catch (Throwable throwable) { | ||
- if (throwable instanceof ThreadDeath) throw throwable; // Paper | ||
+ if (throwable instanceof ThreadDeath || me.earthme.luminol.config.modules.experiment.DisableEntityCatchConfig.enabled) throw throwable; // Paper // Luminol | ||
// Paper start - Prevent block entity and entity crashes | ||
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); | ||
MinecraftServer.LOGGER.error(msg, throwable); |
106 changes: 106 additions & 0 deletions
106
patches/server/0017-Add-config-to-disable-async-catchers.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: MrHua269 <wangxyper@163.com> | ||
Date: Mon, 12 Aug 2024 21:29:59 +0800 | ||
Subject: [PATCH] Add config to disable async catchers | ||
|
||
|
||
diff --git a/src/main/java/io/papermc/paper/util/TickThread.java b/src/main/java/io/papermc/paper/util/TickThread.java | ||
index 906f1c9e619a924c622acc76652a4569305edc8d..aaa72fd0bb866ac18ee06e8f50b1374b24c4a8de 100644 | ||
--- a/src/main/java/io/papermc/paper/util/TickThread.java | ||
+++ b/src/main/java/io/papermc/paper/util/TickThread.java | ||
@@ -46,49 +46,49 @@ public class TickThread extends Thread { | ||
*/ | ||
@Deprecated | ||
public static void ensureTickThread(final String reason) { | ||
- if (!isTickThread()) { | ||
+ if (!isTickThread() && !me.earthme.luminol.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Luminol | ||
MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); | ||
throw new IllegalStateException(reason); | ||
} | ||
} | ||
|
||
public static void ensureTickThread(final ServerLevel world, final BlockPos pos, final String reason) { | ||
- if (!isTickThreadFor(world, pos)) { | ||
+ if (!isTickThreadFor(world, pos) && !me.earthme.luminol.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Luminol | ||
MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); | ||
throw new IllegalStateException(reason); | ||
} | ||
} | ||
|
||
public static void ensureTickThread(final ServerLevel world, final ChunkPos pos, final String reason) { | ||
- if (!isTickThreadFor(world, pos)) { | ||
+ if (!isTickThreadFor(world, pos) && !me.earthme.luminol.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Luminol | ||
MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); | ||
throw new IllegalStateException(reason); | ||
} | ||
} | ||
|
||
public static void ensureTickThread(final ServerLevel world, final int chunkX, final int chunkZ, final String reason) { | ||
- if (!isTickThreadFor(world, chunkX, chunkZ)) { | ||
+ if (!isTickThreadFor(world, chunkX, chunkZ) && !me.earthme.luminol.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Luminol | ||
MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); | ||
throw new IllegalStateException(reason); | ||
} | ||
} | ||
|
||
public static void ensureTickThread(final Entity entity, final String reason) { | ||
- if (!isTickThreadFor(entity)) { | ||
+ if (!isTickThreadFor(entity) && !me.earthme.luminol.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Luminol | ||
MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); | ||
throw new IllegalStateException(reason); | ||
} | ||
} | ||
|
||
public static void ensureTickThread(final ServerLevel world, final AABB aabb, final String reason) { | ||
- if (!isTickThreadFor(world, aabb)) { | ||
+ if (!isTickThreadFor(world, aabb) && !me.earthme.luminol.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Luminol | ||
MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); | ||
throw new IllegalStateException(reason); | ||
} | ||
} | ||
|
||
public static void ensureTickThread(final ServerLevel world, final double blockX, final double blockZ, final String reason) { | ||
- if (!isTickThreadFor(world, blockX, blockZ)) { | ||
+ if (!isTickThreadFor(world, blockX, blockZ) && !me.earthme.luminol.config.modules.experiment.DisableAsyncCatcherConfig.enabled) { // Luminol | ||
MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); | ||
throw new IllegalStateException(reason); | ||
} | ||
diff --git a/src/main/java/me/earthme/luminol/config/modules/experiment/DisableAsyncCatcherConfig.java b/src/main/java/me/earthme/luminol/config/modules/experiment/DisableAsyncCatcherConfig.java | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..61f653eeca366672ded88c491cf5c59e546e7301 | ||
--- /dev/null | ||
+++ b/src/main/java/me/earthme/luminol/config/modules/experiment/DisableAsyncCatcherConfig.java | ||
@@ -0,0 +1,20 @@ | ||
+package me.earthme.luminol.config.modules.experiment; | ||
+ | ||
+import me.earthme.luminol.config.ConfigInfo; | ||
+import me.earthme.luminol.config.EnumConfigCategory; | ||
+import me.earthme.luminol.config.IConfigModule; | ||
+ | ||
+public class DisableAsyncCatcherConfig implements IConfigModule { | ||
+ @ConfigInfo(baseName = "enabled") | ||
+ public static boolean enabled = false; | ||
+ | ||
+ @Override | ||
+ public EnumConfigCategory getCategory() { | ||
+ return EnumConfigCategory.EXPERIMENT; | ||
+ } | ||
+ | ||
+ @Override | ||
+ public String getBaseName() { | ||
+ return "disable_async_catchers"; | ||
+ } | ||
+} | ||
diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java | ||
index 2e074c16dab1ead47914070329da0398c3274048..0a9151125539bb20f94a3d8b307b328d4abbe010 100644 | ||
--- a/src/main/java/org/spigotmc/AsyncCatcher.java | ||
+++ b/src/main/java/org/spigotmc/AsyncCatcher.java | ||
@@ -9,7 +9,7 @@ public class AsyncCatcher | ||
|
||
public static void catchOp(String reason) | ||
{ | ||
- if (!(io.papermc.paper.util.TickThread.isTickThread())) // Paper | ||
+ if (!(io.papermc.paper.util.TickThread.isTickThread()) && !me.earthme.luminol.config.modules.experiment.DisableAsyncCatcherConfig.enabled) // Luminol | ||
{ | ||
MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); // Paper | ||
throw new IllegalStateException( "Asynchronous " + reason + "!" ); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.