diff --git a/patches/server/Add-more-advancement-API.patch b/patches/server/Add-more-advancement-API.patch index 2eb2ec2ee9..a442fa71ef 100644 --- a/patches/server/Add-more-advancement-API.patch +++ b/patches/server/Add-more-advancement-API.patch @@ -120,9 +120,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @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 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @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 0000000000000000000000000000000000000000..00000000000000000000000000000000 - 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