From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Shane Freeder 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 0103dcc3f34e07c540e7db0f9bf32c358ccef8f2..1c44050735430f7d9b41a95c64c57fc924b0a7bc 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -438,6 +438,12 @@ public class Commodore { super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, runtimeCbPkgPrefix() + "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)