SPIGOT-5097: Bukkit.clearRecipes() no longer working
Dieser Commit ist enthalten in:
Ursprung
38fa220f69
Commit
9af900778d
@ -90,22 +90,18 @@
|
||||
}).filter(Objects::nonNull).findFirst();
|
||||
}
|
||||
|
||||
@@ -118,4 +138,18 @@
|
||||
@@ -118,4 +138,14 @@
|
||||
return new JsonSyntaxException("Invalid or unsupported recipe type '" + s + "'");
|
||||
})).a(minecraftkey, jsonobject);
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ public static void initializeRecipeMap(Map<Recipes<?>, Object2ObjectLinkedOpenHashMap<MinecraftKey, IRecipe<?>>> map) {
|
||||
+ map.clear();
|
||||
+ Iterator iterator = IRegistry.RECIPE_TYPE.iterator();
|
||||
+ public void clearRecipes() {
|
||||
+ this.recipes = Maps.newHashMap();
|
||||
+
|
||||
+ while (iterator.hasNext()) {
|
||||
+ Recipes<?> recipes = (Recipes) iterator.next();
|
||||
+
|
||||
+ map.put(recipes, new Object2ObjectLinkedOpenHashMap<>()); // CraftBukkit
|
||||
+ for (Recipes<?> recipeType : IRegistry.RECIPE_TYPE) {
|
||||
+ this.recipes.put(recipeType, new Object2ObjectLinkedOpenHashMap<>());
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
@ -1100,7 +1100,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public void clearRecipes() {
|
||||
CraftingManager.initializeRecipeMap(console.getCraftingManager().recipes);
|
||||
console.getCraftingManager().clearRecipes();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren