diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e16bcb9a..94c19d8e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,8 @@ * Fixed #2896 * Fixed #2899 * Fixed #2906 +* Fixed #2903 +* Fixed #2913 ## Release Candidate 21 (14 Mar 2021) https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#21 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java index 4004bbe19..0317fff6a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java @@ -9,7 +9,6 @@ import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; import org.apache.commons.lang.Validate; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -25,6 +24,7 @@ import org.bukkit.inventory.ShapelessRecipe; import io.github.thebusybiscuit.cscorelib2.data.PersistentDataAPI; import io.github.thebusybiscuit.cscorelib2.item.CustomItem; +import io.github.thebusybiscuit.slimefun4.core.services.MinecraftRecipeService; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.tasks.AsyncRecipeChoiceTask; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; @@ -169,7 +169,10 @@ public class VanillaAutoCrafter extends AbstractAutoCrafter { private List getRecipesFor(@Nonnull ItemStack item) { List recipes = new ArrayList<>(); - for (Recipe recipe : Bukkit.getRecipesFor(item)) { + // Fixes #2913 - Bukkit.getRecipesFor() only checks for Materials + MinecraftRecipeService recipeService = SlimefunPlugin.getMinecraftRecipeService(); + + for (Recipe recipe : recipeService.getRecipesFor(item)) { if (recipe instanceof ShapedRecipe || recipe instanceof ShapelessRecipe) { recipes.add(recipe); }