diff options
Diffstat (limited to 'patches/server/0914-Fix-UnsafeValues-loadAdvancement.patch')
-rw-r--r-- | patches/server/0914-Fix-UnsafeValues-loadAdvancement.patch | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/patches/server/0914-Fix-UnsafeValues-loadAdvancement.patch b/patches/server/0914-Fix-UnsafeValues-loadAdvancement.patch index 4bf2224704..5c6b4fb26d 100644 --- a/patches/server/0914-Fix-UnsafeValues-loadAdvancement.patch +++ b/patches/server/0914-Fix-UnsafeValues-loadAdvancement.patch @@ -5,12 +5,16 @@ Subject: [PATCH] Fix UnsafeValues#loadAdvancement diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 2d51418612e4df40b9536ac72ba0a070d59f32d1..34208c749621003ba3ad74894ca25e01469b66f2 100644 +index ac42442b64b1b2ba29997d0720970e7f677a2702..cb72cc3e2b86b447e51236a70a4dd04a611ac81c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -323,7 +323,27 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -321,9 +321,30 @@ public final class CraftMagicNumbers implements UnsafeValues { + ResourceLocation minecraftkey = CraftNamespacedKey.toMinecraft(key); + JsonElement jsonelement = ServerAdvancementManager.GSON.fromJson(advancement, JsonElement.class); - net.minecraft.advancements.Advancement nms = net.minecraft.advancements.Advancement.CODEC.parse(JsonOps.INSTANCE, jsonelement).getOrThrow(JsonParseException::new); +- net.minecraft.advancements.Advancement nms = net.minecraft.advancements.Advancement.CODEC.parse(JsonOps.INSTANCE, jsonelement).getOrThrow(JsonParseException::new); ++ final net.minecraft.resources.RegistryOps<JsonElement> ops = CraftRegistry.getMinecraftRegistry().createSerializationContext(JsonOps.INSTANCE); // Paper - use RegistryOps ++ final net.minecraft.advancements.Advancement nms = net.minecraft.advancements.Advancement.CODEC.parse(ops, jsonelement).getOrThrow(JsonParseException::new); // Paper - use RegistryOps if (nms != null) { - MinecraftServer.getServer().getAdvancements().advancements.put(minecraftkey, new AdvancementHolder(minecraftkey, nms)); + // Paper start - Fix throw UnsupportedOperationException |