PaperMC/paper-server/nms-patches/net/minecraft/server/AdvancementDataWorld.patch

29 lines
1.1 KiB
Diff
Raw Normal View History

--- a/net/minecraft/server/AdvancementDataWorld.java
+++ b/net/minecraft/server/AdvancementDataWorld.java
@@ -27,11 +27,15 @@
import net.minecraft.util.profiling.GameProfilerFiller;
import org.slf4j.Logger;
+// CraftBukkit start
+import java.util.HashMap;
+// CraftBukkit end
+
public class AdvancementDataWorld extends ResourceDataJson {
private static final Logger LOGGER = LogUtils.getLogger();
public static final Gson GSON = (new GsonBuilder()).create();
- public Map<MinecraftKey, AdvancementHolder> advancements = Map.of();
+ public Map<MinecraftKey, AdvancementHolder> advancements = new HashMap<>(); // CraftBukkit - SPIGOT-7734: mutable
private AdvancementTree tree = new AdvancementTree();
private final HolderLookup.a registries;
@@ -55,7 +59,7 @@
}
});
- this.advancements = builder.buildOrThrow();
+ this.advancements = new HashMap<>(builder.buildOrThrow()); // CraftBukkit - SPIGOT-7734: mutable
AdvancementTree advancementtree = new AdvancementTree();
advancementtree.addAll(this.advancements.values());