From dec5df263250700d23656916ea21d771e0358c95 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 10 Apr 2020 10:56:00 +1000 Subject: [PATCH] SPIGOT-5667: Can't add recipe without (vanilla) datapack --- nms-patches/CraftingManager.patch | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/nms-patches/CraftingManager.patch b/nms-patches/CraftingManager.patch index ae5cdcfd63..bb53a16843 100644 --- a/nms-patches/CraftingManager.patch +++ b/nms-patches/CraftingManager.patch @@ -15,16 +15,21 @@ private boolean d; public CraftingManager() { -@@ -35,7 +37,7 @@ +@@ -35,7 +37,12 @@ protected void a(Map map, IResourceManager iresourcemanager, GameProfilerFiller gameprofilerfiller) { this.d = false; - Map, Builder>> map1 = Maps.newHashMap(); -+ Map, Object2ObjectLinkedOpenHashMap>> map1 = Maps.newHashMap(); // CraftBukkit ++ // CraftBukkit start - SPIGOT-5667 make sure all types are populated and mutable ++ Map, Object2ObjectLinkedOpenHashMap>> map1 = Maps.newHashMap(); ++ for (Recipes recipeType : IRegistry.RECIPE_TYPE) { ++ map1.put(recipeType, new Object2ObjectLinkedOpenHashMap<>()); ++ } ++ // CraftBukkit end Iterator iterator = map.entrySet().iterator(); while (iterator.hasNext()) { -@@ -45,24 +47,42 @@ +@@ -45,24 +52,42 @@ try { IRecipe irecipe = a(minecraftkey, (JsonObject) entry.getValue()); @@ -72,7 +77,7 @@ } public > List b(Recipes recipes, C c0, World world) { -@@ -74,7 +94,7 @@ +@@ -74,7 +99,7 @@ } private > Map> a(Recipes recipes) { @@ -81,7 +86,7 @@ } public > NonNullList c(Recipes recipes, C c0, World world) { -@@ -95,7 +115,7 @@ +@@ -95,7 +120,7 @@ public Optional> a(MinecraftKey minecraftkey) { return this.recipes.values().stream().map((map) -> { @@ -90,7 +95,7 @@ }).filter(Objects::nonNull).findFirst(); } -@@ -118,4 +138,14 @@ +@@ -118,4 +143,14 @@ return new JsonSyntaxException("Invalid or unsupported recipe type '" + s + "'"); })).a(minecraftkey, jsonobject); }