diff --git a/patches/server/Fix-UnsafeValues-loadAdvancement.patch b/patches/server/Fix-UnsafeValues-loadAdvancement.patch index efaec7b3ae..2a33703fbc 100644 --- a/patches/server/Fix-UnsafeValues-loadAdvancement.patch +++ b/patches/server/Fix-UnsafeValues-loadAdvancement.patch @@ -22,7 +22,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + mapBuilder.put(minecraftkey, holder); + + MinecraftServer.getServer().getAdvancements().advancements = mapBuilder.build(); -+ MinecraftServer.getServer().getAdvancements().tree().addAll(List.of(holder)); ++ final net.minecraft.advancements.AdvancementTree tree = MinecraftServer.getServer().getAdvancements().tree(); ++ tree.addAll(List.of(holder)); ++ ++ // recalculate advancement position ++ final net.minecraft.advancements.AdvancementNode node = tree.get(minecraftkey); ++ if (node != null) { ++ final net.minecraft.advancements.AdvancementNode root = node.root(); ++ if (root.holder().value().display().isPresent()) { ++ net.minecraft.advancements.TreeNodePosition.run(root); ++ } ++ } + // Paper end - Fix throw UnsupportedOperationException Advancement bukkit = Bukkit.getAdvancement(key);