0

I have an auto-crafter plugin for a Minecraft server, what's important is that it lookups the recipe of the item it is to craft using the ingredient map ((ShapedRecipe)recipe).getIngredientMap();. the ingredient map links a character in the recipe to an ItemStack. The issue is for a recipe (such as a stick) that uses variants of wood types, when getting the ItemStack from the map, it is always an Oak plank, even though sticks in-game can be crafted with other wood varients. is there any way to get all variants of wood from the ItemStack in the ingredient map?

RIVERMAN2010
  • 427
  • 3
  • 9
  • What is your spigot MC version? If below 1.13, it's with byte data. Else, it's like "OAK_PLANK" so check for "JUNGLE_PLANK" etc – Elikill58 Jun 07 '23 at 06:11
  • the version I am using is 1.19, the problem is that spigot uses `MaterialChoice` to allow multiple types of materials, but when I get the `ItemStack` from the ingredient map it is always OAK_PLANK for recipes like sticks or chests that can be made from varying types of planks – RIVERMAN2010 Jun 07 '23 at 13:23

1 Answers1

0

ShapelessRecipe also has a method called getChoiceMap which can be used to get the recipe choices for a given recipe, which allows a search of variant materials that can also be used.

RIVERMAN2010
  • 427
  • 3
  • 9