diff --git a/patches/api/Add-advancement-display-API.patch b/patches/api/Add-more-advancement-API.patch similarity index 99% rename from patches/api/Add-advancement-display-API.patch rename to patches/api/Add-more-advancement-API.patch index b1043c4c1..98b782b61 100644 --- a/patches/api/Add-advancement-display-API.patch +++ b/patches/api/Add-more-advancement-API.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: syldium Date: Fri, 9 Jul 2021 18:49:40 +0200 -Subject: [PATCH] Add advancement display API +Subject: [PATCH] Add more advancement API diff --git a/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java b/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java diff --git a/patches/server/Add-advancement-display-API.patch b/patches/server/Add-more-advancement-API.patch similarity index 71% rename from patches/server/Add-advancement-display-API.patch rename to patches/server/Add-more-advancement-API.patch index 1e653f3ea..e9a895296 100644 --- a/patches/server/Add-advancement-display-API.patch +++ b/patches/server/Add-more-advancement-API.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: syldium Date: Fri, 9 Jul 2021 18:50:40 +0200 -Subject: [PATCH] Add advancement display API +Subject: [PATCH] Add more advancement API diff --git a/src/main/java/io/papermc/paper/advancement/PaperAdvancementDisplay.java b/src/main/java/io/papermc/paper/advancement/PaperAdvancementDisplay.java @@ -102,6 +102,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return this.handle.getDisplay() == null ? null : this.handle.getDisplay().paper; + } + ++ @Deprecated @io.papermc.paper.annotation.DoNotUse ++ public AdvancementDisplay getDisplay0() { // May be called by plugins via Commodore ++ return this.handle.getDisplay() == null ? null : new CraftAdvancementDisplay(this.handle.getDisplay()); ++ } ++ + @Override + public org.bukkit.advancement.Advancement getParent() { + return this.handle.getParent() == null ? null : this.handle.getParent().bukkit; @@ -127,6 +132,42 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + // Paper end } +diff --git a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java ++++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.craftbukkit.util.CraftChatMessage; + import org.bukkit.inventory.ItemStack; + ++@Deprecated // Paper + public class CraftAdvancementDisplay implements org.bukkit.advancement.AdvancementDisplay { + + private final DisplayInfo handle; +diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +@@ -0,0 +0,0 @@ public class Commodore + ) ); + + // Paper start - Plugin rewrites ++ private static final String CB_PACKAGE = org.bukkit.Bukkit.getServer().getClass().getPackageName().replace('.', '/'); + private static final Map SEARCH_AND_REMOVE = initReplacementsMap(); + private static final java.util.jar.Manifest manifest = io.papermc.paper.util.JarManifests.manifest(Commodore.class); + private static Map initReplacementsMap() +@@ -0,0 +0,0 @@ public class Commodore + { + desc = getOriginalOrRewrite(desc); + } ++ if (owner.equals("org/bukkit/advancement/Advancement") && name.equals("getDisplay") && desc.endsWith(")Lorg/bukkit/advancement/AdvancementDisplay;")) { ++ super.visitTypeInsn(Opcodes.CHECKCAST, CB_PACKAGE + "/advancement/CraftAdvancement"); ++ super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE + "/advancement/CraftAdvancement", "getDisplay0", desc, false); ++ return; ++ } + // Paper end + + if ( modern ) diff --git a/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java b/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch index 7793bd365..2c331b2f3 100644 --- a/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch +++ b/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch @@ -11,8 +11,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -0,0 +0,0 @@ public class Commodore - { - desc = getOriginalOrRewrite(desc); + 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);