aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0843-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0843-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch')
-rw-r--r--patches/server/0843-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/patches/server/0843-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/0843-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch
new file mode 100644
index 0000000000..5601e80875
--- /dev/null
+++ b/patches/server/0843-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch
@@ -0,0 +1,25 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shane Freeder <[email protected]>
+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 2a75bd263dce91bc64601f96b622ed6d4fb18fe6..15c5d1c048bf2780e963a1055f0a6dd77b31ff45 100644
+--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
++++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
+@@ -463,6 +463,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
+
+ // Paper start - ItemFactory#getSpawnEgg (paper had original method that returned ItemStack, upstream added identical but returned Material)