--- a/net/minecraft/advancements/AdvancementTree.java
+++ b/net/minecraft/advancements/AdvancementTree.java
@@ -5,8 +5,10 @@
 import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Optional;
 import java.util.Set;
 import javax.annotation.Nullable;
@@ -14,19 +16,26 @@
 import org.slf4j.Logger;
 
 public class AdvancementTree {
+
     private static final Logger LOGGER = LogUtils.getLogger();
-    private final Map<ResourceLocation, AdvancementNode> nodes = new Object2ObjectOpenHashMap<>();
-    private final Set<AdvancementNode> roots = new ObjectLinkedOpenHashSet<>();
-    private final Set<AdvancementNode> tasks = new ObjectLinkedOpenHashSet<>();
+    private final Map<ResourceLocation, AdvancementNode> nodes = new Object2ObjectOpenHashMap();
+    private final Set<AdvancementNode> roots = new ObjectLinkedOpenHashSet();
+    private final Set<AdvancementNode> tasks = new ObjectLinkedOpenHashSet();
     @Nullable
     private AdvancementTree.Listener listener;
 
+    public AdvancementTree() {}
+
     private void remove(AdvancementNode advancement) {
-        for (AdvancementNode advancementNode : advancement.children()) {
-            this.remove(advancementNode);
+        Iterator iterator = advancement.children().iterator();
+
+        while (iterator.hasNext()) {
+            AdvancementNode advancementnode1 = (AdvancementNode) iterator.next();
+
+            this.remove(advancementnode1);
         }
 
-        LOGGER.info("Forgot about advancement {}", advancement.holder());
+        AdvancementTree.LOGGER.debug("Forgot about advancement {}", advancement.holder()); // Paper - Improve logging and errors
         this.nodes.remove(advancement.holder().id());
         if (advancement.parent() == null) {
             this.roots.remove(advancement);
@@ -39,53 +48,64 @@
                 this.listener.onRemoveAdvancementTask(advancement);
             }
         }
+
     }
 
     public void remove(Set<ResourceLocation> advancements) {
-        for (ResourceLocation resourceLocation : advancements) {
-            AdvancementNode advancementNode = this.nodes.get(resourceLocation);
-            if (advancementNode == null) {
-                LOGGER.warn("Told to remove advancement {} but I don't know what that is", resourceLocation);
+        Iterator iterator = advancements.iterator();
+
+        while (iterator.hasNext()) {
+            ResourceLocation minecraftkey = (ResourceLocation) iterator.next();
+            AdvancementNode advancementnode = (AdvancementNode) this.nodes.get(minecraftkey);
+
+            if (advancementnode == null) {
+                AdvancementTree.LOGGER.warn("Told to remove advancement {} but I don't know what that is", minecraftkey);
             } else {
-                this.remove(advancementNode);
+                this.remove(advancementnode);
             }
         }
+
     }
 
     public void addAll(Collection<AdvancementHolder> advancements) {
-        List<AdvancementHolder> list = new ArrayList<>(advancements);
+        List<AdvancementHolder> list = new ArrayList(advancements);
 
         while (!list.isEmpty()) {
             if (!list.removeIf(this::tryInsert)) {
-                LOGGER.error("Couldn't load advancements: {}", list);
+                AdvancementTree.LOGGER.error("Couldn't load advancements: {}", list);
                 break;
             }
         }
 
-        LOGGER.info("Loaded {} advancements", this.nodes.size());
+        // AdvancementTree.LOGGER.info("Loaded {} advancements", this.nodes.size()); // CraftBukkit - moved to AdvancementDataWorld#reload // Paper - Improve logging and errors; 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) {
         Optional<ResourceLocation> optional = advancement.value().parent();
-        AdvancementNode advancementNode = optional.map(this.nodes::get).orElse(null);
-        if (advancementNode == null && optional.isPresent()) {
+        Map map = this.nodes;
+
+        Objects.requireNonNull(this.nodes);
+        AdvancementNode advancementnode = (AdvancementNode) optional.map(map::get).orElse((Object) null);
+
+        if (advancementnode == null && optional.isPresent()) {
             return false;
         } else {
-            AdvancementNode advancementNode2 = new AdvancementNode(advancement, advancementNode);
-            if (advancementNode != null) {
-                advancementNode.addChild(advancementNode2);
+            AdvancementNode advancementnode1 = new AdvancementNode(advancement, advancementnode);
+
+            if (advancementnode != null) {
+                advancementnode.addChild(advancementnode1);
             }
 
-            this.nodes.put(advancement.id(), advancementNode2);
-            if (advancementNode == null) {
-                this.roots.add(advancementNode2);
+            this.nodes.put(advancement.id(), advancementnode1);
+            if (advancementnode == null) {
+                this.roots.add(advancementnode1);
                 if (this.listener != null) {
-                    this.listener.onAddAdvancementRoot(advancementNode2);
+                    this.listener.onAddAdvancementRoot(advancementnode1);
                 }
             } else {
-                this.tasks.add(advancementNode2);
+                this.tasks.add(advancementnode1);
                 if (this.listener != null) {
-                    this.listener.onAddAdvancementTask(advancementNode2);
+                    this.listener.onAddAdvancementTask(advancementnode1);
                 }
             }
 
@@ -100,6 +120,7 @@
         if (this.listener != null) {
             this.listener.onAdvancementsCleared();
         }
+
     }
 
     public Iterable<AdvancementNode> roots() {
@@ -112,28 +133,38 @@
 
     @Nullable
     public AdvancementNode get(ResourceLocation id) {
-        return this.nodes.get(id);
+        return (AdvancementNode) this.nodes.get(id);
     }
 
     @Nullable
     public AdvancementNode get(AdvancementHolder advancement) {
-        return this.nodes.get(advancement.id());
+        return (AdvancementNode) this.nodes.get(advancement.id());
     }
 
     public void setListener(@Nullable AdvancementTree.Listener listener) {
         this.listener = listener;
         if (listener != null) {
-            for (AdvancementNode advancementNode : this.roots) {
-                listener.onAddAdvancementRoot(advancementNode);
+            Iterator iterator = this.roots.iterator();
+
+            AdvancementNode advancementnode;
+
+            while (iterator.hasNext()) {
+                advancementnode = (AdvancementNode) iterator.next();
+                listener.onAddAdvancementRoot(advancementnode);
             }
 
-            for (AdvancementNode advancementNode2 : this.tasks) {
-                listener.onAddAdvancementTask(advancementNode2);
+            iterator = this.tasks.iterator();
+
+            while (iterator.hasNext()) {
+                advancementnode = (AdvancementNode) iterator.next();
+                listener.onAddAdvancementTask(advancementnode);
             }
         }
+
     }
 
     public interface Listener {
+
         void onAddAdvancementRoot(AdvancementNode root);
 
         void onRemoveAdvancementRoot(AdvancementNode root);
