Paper/patches/server/0888-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch
Jake Potrebic 6a7fef0e4a
Allow entity effect changes off the main thread for worldgen (#8942)
* Allow entity effect modification off the main thread for worldgen

* squash all async catcher patches
2023-04-09 11:38:32 -07:00

26 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 19 Sep 2022 00:13:02 +0100
Subject: [PATCH] Mitigate effects of WorldCreator#keepSpawnLoaded ret type
change
TODO: Remove in 1.21?
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
index d7c1077f2eb2846a17a5872f01ebb8aabf0cb181..ebbbfc318439fec33331d71563e528cd3429e541 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
@@ -443,6 +443,12 @@ public class Commodore
super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE + "/advancement/CraftAdvancement", "getDisplay0", desc, false);
return;
}
+ if (owner.equals("org/bukkit/WorldCreator") && name.equals("keepSpawnLoaded") && desc.equals("(Lnet/kyori/adventure/util/TriState;)V")) {
+ super.visitMethodInsn(opcode, owner, name, "(Lnet/kyori/adventure/util/TriState;)Lorg/bukkit/WorldCreator;", itf);
+ // new method has a return, so, make sure we pop it
+ super.visitInsn(Opcodes.POP);
+ return;
+ }
// Paper end
if ( modern )
{