--- a/net/minecraft/server/ServerAdvancementManager.java
+++ b/net/minecraft/server/ServerAdvancementManager.java
@@ -1,8 +1,8 @@
 package net.minecraft.server;
 
 import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Multimap;
 import com.google.common.collect.ImmutableMap.Builder;
+import com.google.common.collect.Multimap;
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.google.gson.JsonElement;
@@ -10,6 +10,7 @@
 import com.mojang.logging.LogUtils;
 import com.mojang.serialization.JsonOps;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.stream.Collectors;
 import javax.annotation.Nullable;
@@ -27,61 +28,83 @@
 import net.minecraft.util.profiling.ProfilerFiller;
 import org.slf4j.Logger;
 
+// CraftBukkit start
+import java.util.HashMap;
+// CraftBukkit end
+
 public class ServerAdvancementManager extends SimpleJsonResourceReloadListener {
+
     private static final Logger LOGGER = LogUtils.getLogger();
-    public static final Gson GSON = new GsonBuilder().create();
-    public Map<ResourceLocation, AdvancementHolder> advancements = Map.of();
+    public static final Gson GSON = (new GsonBuilder()).create();
+    public Map<ResourceLocation, AdvancementHolder> advancements = new HashMap<>(); // CraftBukkit - SPIGOT-7734: mutable
     private AdvancementTree tree = new AdvancementTree();
     private final HolderLookup.Provider registries;
 
     public ServerAdvancementManager(HolderLookup.Provider registryLookup) {
-        super(GSON, "advancements");
+        super(ServerAdvancementManager.GSON, "advancements");
         this.registries = registryLookup;
     }
 
-    @Override
     protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager, ProfilerFiller profiler) {
-        RegistryOps<JsonElement> registryOps = this.registries.createSerializationContext(JsonOps.INSTANCE);
+        RegistryOps<JsonElement> registryops = this.registries.createSerializationContext(JsonOps.INSTANCE);
         Builder<ResourceLocation, AdvancementHolder> builder = ImmutableMap.builder();
-        prepared.forEach((id, json) -> {
+
+        prepared.forEach((minecraftkey, jsonelement) -> {
+            // Spigot start
+            if (org.spigotmc.SpigotConfig.disabledAdvancements != null && (org.spigotmc.SpigotConfig.disabledAdvancements.contains("*") || org.spigotmc.SpigotConfig.disabledAdvancements.contains(minecraftkey.toString()) || org.spigotmc.SpigotConfig.disabledAdvancements.contains(minecraftkey.getNamespace()))) {
+                return;
+            }
+            // Spigot end
+
             try {
-                Advancement advancement = Advancement.CODEC.parse(registryOps, json).getOrThrow(JsonParseException::new);
-                this.validate(id, advancement);
-                builder.put(id, new AdvancementHolder(id, advancement));
-            } catch (Exception var6x) {
-                LOGGER.error("Parsing error loading custom advancement {}: {}", id, var6x.getMessage());
+                Advancement advancement = (Advancement) Advancement.CODEC.parse(registryops, jsonelement).getOrThrow(JsonParseException::new);
+
+                this.validate(minecraftkey, advancement);
+                builder.put(minecraftkey, new AdvancementHolder(minecraftkey, advancement));
+            } catch (Exception exception) {
+                ServerAdvancementManager.LOGGER.error("Parsing error loading custom advancement {}: {}", minecraftkey, exception.getMessage());
             }
+
         });
-        this.advancements = builder.buildOrThrow();
-        AdvancementTree advancementTree = new AdvancementTree();
-        advancementTree.addAll(this.advancements.values());
+        this.advancements = new HashMap<>(builder.buildOrThrow()); // CraftBukkit - SPIGOT-7734: mutable
+        AdvancementTree advancementtree = new AdvancementTree();
 
-        for (AdvancementNode advancementNode : advancementTree.roots()) {
-            if (advancementNode.holder().value().display().isPresent()) {
-                TreeNodePosition.run(advancementNode);
+        advancementtree.addAll(this.advancements.values());
+        LOGGER.info("Loaded {} advancements", advancementtree.nodes().size()); // Paper - Improve logging and errors; moved from AdvancementTree#addAll
+        Iterator iterator = advancementtree.roots().iterator();
+
+        while (iterator.hasNext()) {
+            AdvancementNode advancementnode = (AdvancementNode) iterator.next();
+
+            if (advancementnode.holder().value().display().isPresent()) {
+                TreeNodePosition.run(advancementnode);
             }
         }
 
-        this.tree = advancementTree;
+        this.tree = advancementtree;
     }
 
     private void validate(ResourceLocation id, Advancement advancement) {
-        ProblemReporter.Collector collector = new ProblemReporter.Collector();
-        advancement.validate(collector, this.registries.asGetterLookup());
-        Multimap<String, String> multimap = collector.get();
+        ProblemReporter.Collector problemreporter_a = new ProblemReporter.Collector();
+
+        advancement.validate(problemreporter_a, this.registries.asGetterLookup());
+        Multimap<String, String> multimap = problemreporter_a.get();
+
         if (!multimap.isEmpty()) {
-            String string = multimap.asMap()
-                .entrySet()
-                .stream()
-                .map(entry -> "  at " + entry.getKey() + ": " + String.join("; ", entry.getValue()))
-                .collect(Collectors.joining("\n"));
-            LOGGER.warn("Found validation problems in advancement {}: \n{}", id, string);
+            String s = (String) multimap.asMap().entrySet().stream().map((entry) -> {
+                String s1 = (String) entry.getKey();
+
+                return "  at " + s1 + ": " + String.join("; ", (Iterable) entry.getValue());
+            }).collect(Collectors.joining("\n"));
+
+            ServerAdvancementManager.LOGGER.warn("Found validation problems in advancement {}: \n{}", id, s);
         }
+
     }
 
     @Nullable
     public AdvancementHolder get(ResourceLocation id) {
-        return this.advancements.get(id);
+        return (AdvancementHolder) this.advancements.get(id);
     }
 
     public AdvancementTree tree() {
