PaperMC/paper-server/patches/sources/net/minecraft/server/ServerAdvancementManager.java.patch
CraftBukkit/Spigot 30e4583dbe Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
2024-12-11 22:26:55 +01:00

27 lines
1.2 KiB
Diff

--- a/net/minecraft/server/ServerAdvancementManager.java
+++ b/net/minecraft/server/ServerAdvancementManager.java
@@ -21,10 +21,14 @@
import net.minecraft.util.profiling.ProfilerFiller;
import org.slf4j.Logger;
+// CraftBukkit start
+import java.util.HashMap;
+// CraftBukkit end
+
public class ServerAdvancementManager extends SimpleJsonResourceReloadListener<Advancement> {
private static final Logger LOGGER = LogUtils.getLogger();
- public Map<ResourceLocation, AdvancementHolder> advancements = Map.of();
+ public Map<ResourceLocation, AdvancementHolder> advancements = new HashMap<>(); // CraftBukkit - SPIGOT-7734: mutable
private AdvancementTree tree = new AdvancementTree();
private final HolderLookup.Provider registries;
@@ -40,7 +44,7 @@
this.validate(minecraftkey, advancement);
builder.put(minecraftkey, new AdvancementHolder(minecraftkey, advancement));
});
- this.advancements = builder.buildOrThrow();
+ this.advancements = new HashMap<>(builder.buildOrThrow()); // CraftBukkit - SPIGOT-7734: mutable
AdvancementTree advancementtree = new AdvancementTree();
advancementtree.addAll(this.advancements.values());