mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 06:24:06 +01:00
SPIGOT-5097: Bukkit.clearRecipes() no longer working
This commit is contained in:
parent
38fa220f69
commit
9af900778d
@ -90,22 +90,18 @@
|
|||||||
}).filter(Objects::nonNull).findFirst();
|
}).filter(Objects::nonNull).findFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,4 +138,18 @@
|
@@ -118,4 +138,14 @@
|
||||||
return new JsonSyntaxException("Invalid or unsupported recipe type '" + s + "'");
|
return new JsonSyntaxException("Invalid or unsupported recipe type '" + s + "'");
|
||||||
})).a(minecraftkey, jsonobject);
|
})).a(minecraftkey, jsonobject);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ public static void initializeRecipeMap(Map<Recipes<?>, Object2ObjectLinkedOpenHashMap<MinecraftKey, IRecipe<?>>> map) {
|
+ public void clearRecipes() {
|
||||||
+ map.clear();
|
+ this.recipes = Maps.newHashMap();
|
||||||
+ Iterator iterator = IRegistry.RECIPE_TYPE.iterator();
|
|
||||||
+
|
+
|
||||||
+ while (iterator.hasNext()) {
|
+ for (Recipes<?> recipeType : IRegistry.RECIPE_TYPE) {
|
||||||
+ Recipes<?> recipes = (Recipes) iterator.next();
|
+ this.recipes.put(recipeType, new Object2ObjectLinkedOpenHashMap<>());
|
||||||
+
|
|
||||||
+ map.put(recipes, new Object2ObjectLinkedOpenHashMap<>()); // CraftBukkit
|
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
}
|
}
|
||||||
|
@ -1100,7 +1100,7 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clearRecipes() {
|
public void clearRecipes() {
|
||||||
CraftingManager.initializeRecipeMap(console.getCraftingManager().recipes);
|
console.getCraftingManager().clearRecipes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user