From 0ec9b61de9c6786083de44c0ceb9c5d932529ec3 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 23 Apr 2019 20:53:56 +1000 Subject: [PATCH] SPIGOT-4717: Fix adding recipes after clearRecipes is called --- nms-patches/CraftingManager.patch | 2 +- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nms-patches/CraftingManager.patch b/nms-patches/CraftingManager.patch index ffe263dfeb..d88fc01a50 100644 --- a/nms-patches/CraftingManager.patch +++ b/nms-patches/CraftingManager.patch @@ -59,7 +59,7 @@ } - private static void a(Map, Map>> map) { -+ private static void a(Map, it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap>> map) { // CraftBukkit ++ public static void a(Map, it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap>> map) { // CraftBukkit map.clear(); Iterator iterator = IRegistry.RECIPE_TYPE.iterator(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index e19d31a44d..55a874f95f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -49,6 +49,7 @@ import net.minecraft.server.BlockPosition; import net.minecraft.server.BossBattleCustom; import net.minecraft.server.CommandDispatcher; import net.minecraft.server.CommandListenerWrapper; +import net.minecraft.server.CraftingManager; import net.minecraft.server.DedicatedPlayerList; import net.minecraft.server.DedicatedServer; import net.minecraft.server.DedicatedServerProperties; @@ -1096,7 +1097,7 @@ public final class CraftServer implements Server { @Override public void clearRecipes() { - console.getCraftingManager().recipes.clear(); + CraftingManager.a(console.getCraftingManager().recipes); } @Override