From c2700397236a4a8edc7970314d95520bd020f720 Mon Sep 17 00:00:00 2001 From: Jake Potrebic <jake.m.potrebic@gmail.com> Date: Sat, 2 Dec 2023 13:17:35 -0800 Subject: [PATCH] Log correct recipes and advancement count on server start (#9978) --- .../server/Improve-logging-and-errors.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/patches/server/Improve-logging-and-errors.patch b/patches/server/Improve-logging-and-errors.patch index 39b80e5fdb..c7bac0d5cc 100644 --- a/patches/server/Improve-logging-and-errors.patch +++ b/patches/server/Improve-logging-and-errors.patch @@ -18,6 +18,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.nodes.remove(advancement.holder().id()); if (advancement.parent() == null) { this.roots.remove(advancement); +@@ -0,0 +0,0 @@ public class AdvancementTree { + } + } + +- // AdvancementTree.LOGGER.info("Loaded {} advancements", this.nodes.size()); // CraftBukkit - moved to AdvancementDataWorld#reload ++ // AdvancementTree.LOGGER.info("Loaded {} advancements", this.nodes.size()); // CraftBukkit - moved to AdvancementDataWorld#reload // Paper - you say it was moved... but it wasn't :) it should be moved however, since this is called when the API creates an advancement + } + + private boolean tryInsert(AdvancementHolder advancement) { +diff --git a/src/main/java/net/minecraft/server/ServerAdvancementManager.java b/src/main/java/net/minecraft/server/ServerAdvancementManager.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/ServerAdvancementManager.java ++++ b/src/main/java/net/minecraft/server/ServerAdvancementManager.java +@@ -0,0 +0,0 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener { + AdvancementTree advancementtree = new AdvancementTree(); + + advancementtree.addAll(this.advancements.values()); ++ LOGGER.info("Loaded {} advancements", advancementtree.nodes().size()); // Paper - moved from AdvancementTree#addAll + Iterator iterator = advancementtree.roots().iterator(); + + while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -48,6 +69,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (ResourceLocation.isValidNamespace(string)) { set.add(string); } else { +diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java ++++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +@@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { + return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore? + })); + this.byName = Maps.newHashMap(builder.build()); // CraftBukkit +- RecipeManager.LOGGER.info("Loaded {} recipes", map1.size()); ++ RecipeManager.LOGGER.info("Loaded {} recipes", this.byName.size()); // Paper - log correct number of recipes + } + + // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java