diff --git a/patches/server/0662-Add-more-advancement-API.patch b/patches/server/0662-Add-more-advancement-API.patch index 0def40b23f..2acb44facc 100644 --- a/patches/server/0662-Add-more-advancement-API.patch +++ b/patches/server/0662-Add-more-advancement-API.patch @@ -96,10 +96,10 @@ index a6ea13198a2de14d57472681b5a2b30baf3c4280..11b26d14b863075d776884544629cdd2 public DisplayInfo(ItemStack icon, Component title, Component description, @Nullable ResourceLocation background, FrameType frame, boolean showToast, boolean announceToChat, boolean hidden) { this.title = title; diff --git a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java -index 52baf818579a6841b77ff80e42f4f1b9f635ea08..3321445645514769ff494f90090f22241fffbc44 100644 +index 52baf818579a6841b77ff80e42f4f1b9f635ea08..bd640e0d8d796ee114ff787def7e07edbeffc0a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java +++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java -@@ -29,12 +29,49 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement { +@@ -29,12 +29,47 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement { return Collections.unmodifiableCollection(this.handle.value().criteria().keySet()); } @@ -120,9 +120,7 @@ index 52baf818579a6841b77ff80e42f4f1b9f635ea08..3321445645514769ff494f90090f2224 + + @Override + public net.kyori.adventure.text.Component displayName() { -+ return this.handle.value().display() -+ .map(d -> io.papermc.paper.adventure.PaperAdventure.asAdventure(net.minecraft.advancements.Advancement.decorateName(d))) -+ .orElseGet(() -> net.kyori.adventure.text.Component.text(this.handle.id().toString())); ++ return io.papermc.paper.adventure.PaperAdventure.asAdventure(net.minecraft.advancements.Advancement.name(this.handle)); + } + + @Override @@ -135,10 +133,10 @@ index 52baf818579a6841b77ff80e42f4f1b9f635ea08..3321445645514769ff494f90090f2224 + + @Override + public Collection getChildren() { -+ final var children = com.google.common.collect.ImmutableList.builder(); -+ final var advancementNode = net.minecraft.server.MinecraftServer.getServer().getAdvancements().tree().get(this.handle); ++ final com.google.common.collect.ImmutableList.Builder children = com.google.common.collect.ImmutableList.builder(); ++ final net.minecraft.advancements.AdvancementNode advancementNode = net.minecraft.server.MinecraftServer.getServer().getAdvancements().tree().get(this.handle); + if (advancementNode != null) { -+ for (final var child : advancementNode.children()) { ++ for (final net.minecraft.advancements.AdvancementNode child : advancementNode.children()) { + children.add(child.holder().toBukkit()); + } } @@ -148,7 +146,7 @@ index 52baf818579a6841b77ff80e42f4f1b9f635ea08..3321445645514769ff494f90090f2224 - return new CraftAdvancementDisplay(this.handle.value().display().get()); + @Override + public org.bukkit.advancement.Advancement getRoot() { -+ final var advancementNode = net.minecraft.server.MinecraftServer.getServer().getAdvancements().tree().get(this.handle); ++ final net.minecraft.advancements.AdvancementNode advancementNode = net.minecraft.server.MinecraftServer.getServer().getAdvancements().tree().get(this.handle); + return java.util.Objects.requireNonNull(advancementNode, "could not find internal advancement node for advancement " + this.handle.id()).root().holder().toBukkit(); } + // Paper end