aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/server/ServerAdvancementManager.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/server/ServerAdvancementManager.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/server/ServerAdvancementManager.java.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/server/ServerAdvancementManager.java.patch b/patch-remap/mache-spigotflower/net/minecraft/server/ServerAdvancementManager.java.patch
new file mode 100644
index 0000000000..0110285a8d
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/server/ServerAdvancementManager.java.patch
@@ -0,0 +1,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() {