diff --git a/patches/server/Add-more-advancement-API.patch b/patches/server/Add-more-advancement-API.patch index 8b795d59e5..2650b5ff1d 100644 --- a/patches/server/Add-more-advancement-API.patch +++ b/patches/server/Add-more-advancement-API.patch @@ -201,8 +201,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private static Map initReplacementsMap() { @@ -0,0 +0,0 @@ public class Commodore - { - desc = getOriginalOrRewrite(desc); + super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf); + return; } + if (owner.equals("org/bukkit/advancement/Advancement") && name.equals("getDisplay") && desc.endsWith(")Lorg/bukkit/advancement/AdvancementDisplay;")) { + super.visitTypeInsn(Opcodes.CHECKCAST, CB_PACKAGE + "/advancement/CraftAdvancement"); @@ -210,8 +210,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + 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/Hook-into-CB-plugin-rewrites.patch b/patches/server/Hook-into-CB-plugin-rewrites.patch index 2b4b38125c..b5f43ba9a5 100644 --- a/patches/server/Hook-into-CB-plugin-rewrites.patch +++ b/patches/server/Hook-into-CB-plugin-rewrites.patch @@ -167,20 +167,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 { switch ( name ) @@ -0,0 +0,0 @@ public class Commodore - return; } -+ // Paper start - Rewrite plugins + // Paper start - Rewrite plugins + owner = getOriginalOrRewrite( owner) ; + if (desc != null) + { + desc = getOriginalOrRewrite(desc); + } -+ // Paper end -+ - if ( modern ) - { - if ( owner.equals( "org/bukkit/Material" ) ) + if (owner.equals("org/bukkit/OfflinePlayer") && name.equals("getPlayerProfile") && desc.equals("()Lorg/bukkit/profile/PlayerProfile;")) { + super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf); + return; @@ -0,0 +0,0 @@ public class Commodore @Override public void visitLdcInsn(Object value) diff --git a/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch index 2c331b2f3c..64dd3e4fcc 100644 --- a/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch +++ b/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch @@ -21,5 +21,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return; + } // Paper end - if ( modern ) + { diff --git a/patches/server/Player.setPlayerProfile-API.patch b/patches/server/Player.setPlayerProfile-API.patch index 1353844fe6..a16a3f94ab 100644 --- a/patches/server/Player.setPlayerProfile-API.patch +++ b/patches/server/Player.setPlayerProfile-API.patch @@ -26,6 +26,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 gameProfile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile); playerName = gameProfile.getName(); uniqueId = gameProfile.getId(); +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +@@ -0,0 +0,0 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa + } + + @Override +- public PlayerProfile getPlayerProfile() { +- return new CraftPlayerProfile(this.profile); ++ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() { // Paper ++ return new com.destroystokyo.paper.profile.CraftPlayerProfile(this.profile); // Paper + } + + public Server getServer() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -146,3 +161,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void onEntityRemove(Entity entity) { this.hiddenEntities.remove(entity.getUUID()); +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 + return; + } + ++ // Paper start - Rewrite plugins ++ if (owner.equals("org/bukkit/OfflinePlayer") && name.equals("getPlayerProfile") && desc.equals("()Lorg/bukkit/profile/PlayerProfile;")) { ++ super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf); ++ return; ++ } ++ // Paper end + if ( modern ) + { + if ( owner.equals( "org/bukkit/Material" ) )