aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/server/ServerAdvancementManager.java.patch
blob: 0110285a8dc5e876dcb2179a4c4cbdedef2a801e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
--- a/net/minecraft/server/ServerAdvancementManager.java
+++ b/net/minecraft/server/ServerAdvancementManager.java
@@ -1,3 +1,4 @@
+// mc-dev import
 package net.minecraft.server;
 
 import com.google.common.collect.ImmutableMap;
@@ -31,28 +32,27 @@
 public class ServerAdvancementManager extends SimpleJsonResourceReloadListener {
 
     private static final Logger LOGGER = LogUtils.getLogger();
-    private static final Gson GSON = (new GsonBuilder()).create();
-    private Map<ResourceLocation, AdvancementHolder> advancements = Map.of();
+    public static final Gson GSON = (new GsonBuilder()).create();
+    public Map<ResourceLocation, AdvancementHolder> advancements = Map.of();
     private AdvancementTree tree = new AdvancementTree();
     private final LootDataManager lootData;
 
-    public ServerAdvancementManager(LootDataManager lootdatamanager) {
+    public ServerAdvancementManager(LootDataManager lootData) {
         super(ServerAdvancementManager.GSON, "advancements");
-        this.lootData = lootdatamanager;
+        this.lootData = lootData;
     }
 
-    @Override
-    protected void apply(Map<ResourceLocation, JsonElement> map, ResourceManager resourcemanager, ProfilerFiller profilerfiller) {
+    protected void apply(Map<ResourceLocation, JsonElement> object, ResourceManager resourceManager, ProfilerFiller profiler) {
         Builder<ResourceLocation, AdvancementHolder> builder = ImmutableMap.builder();
 
-        map.forEach((resourcelocation, jsonelement) -> {
+        object.forEach((minecraftkey, jsonelement) -> {
             try {
                 Advancement advancement = (Advancement) Util.getOrThrow(Advancement.CODEC.parse(JsonOps.INSTANCE, jsonelement), JsonParseException::new);
 
-                this.validate(resourcelocation, advancement);
-                builder.put(resourcelocation, new AdvancementHolder(resourcelocation, advancement));
+                this.validate(minecraftkey, advancement);
+                builder.put(minecraftkey, new AdvancementHolder(minecraftkey, advancement));
             } catch (Exception exception) {
-                ServerAdvancementManager.LOGGER.error("Parsing error loading custom advancement {}: {}", resourcelocation, exception.getMessage());
+                ServerAdvancementManager.LOGGER.error("Parsing error loading custom advancement {}: {}", minecraftkey, exception.getMessage());
             }
 
         });
@@ -73,11 +73,11 @@
         this.tree = advancementtree;
     }
 
-    private void validate(ResourceLocation resourcelocation, Advancement advancement) {
-        ProblemReporter.Collector problemreporter_collector = new ProblemReporter.Collector();
+    private void validate(ResourceLocation minecraftkey, Advancement advancement) {
+        ProblemReporter.a problemreporter_a = new ProblemReporter.a();
 
-        advancement.validate(problemreporter_collector, this.lootData);
-        Multimap<String, String> multimap = problemreporter_collector.get();
+        advancement.validate(problemreporter_a, this.lootData);
+        Multimap<String, String> multimap = problemreporter_a.get();
 
         if (!multimap.isEmpty()) {
             String s = (String) multimap.asMap().entrySet().stream().map((entry) -> {
@@ -86,14 +86,14 @@
                 return "  at " + s1 + ": " + String.join("; ", (Iterable) entry.getValue());
             }).collect(Collectors.joining("\n"));
 
-            ServerAdvancementManager.LOGGER.warn("Found validation problems in advancement {}: \n{}", resourcelocation, s);
+            ServerAdvancementManager.LOGGER.warn("Found validation problems in advancement {}: \n{}", minecraftkey, s);
         }
 
     }
 
     @Nullable
-    public AdvancementHolder get(ResourceLocation resourcelocation) {
-        return (AdvancementHolder) this.advancements.get(resourcelocation);
+    public AdvancementHolder get(ResourceLocation minecraftkey) {
+        return (AdvancementHolder) this.advancements.get(minecraftkey);
     }
 
     public AdvancementTree tree() {