Mitigate effects of WorldCreator#keepSpawnLoaded ret type change

TODO: Remove in 1.21?
This commit is contained in:
Shane Freeder 2022-09-19 00:13:02 +01:00
parent 60026267e3
commit 084e7e62ad

View file

@ -463,6 +463,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)