CraftTweaker

CraftTweaker

151M Downloads

[1.15.2] Inputs in RecipeFunctionMatrix are air

justinrusso opened this issue ยท 1 comments

commented

Issue Description:

When attempting to use a RecipeFunctionMatrix, the inputs are all <item:minecraft:air>.

This appears to be caused by the call to ForgeHooks.getContainerItem which returns ItemStack.EMPTY in IIngredient.getRemainingItem. I would assume not every item has a container.

@ZenCodeType.Method
default IItemStack getRemainingItem(IItemStack stack) {
return new MCItemStack(ForgeHooks.getContainerItem(stack.getInternal()));
}

which is called here
stacks[rowIndex][columnIndex] = ingredient.getRemainingItem(new MCItemStack(inv.getStackInSlot(slotIndex)));

What happens:

When placing the items needed to trigger the recipe function, all inputs in the arrays are <item:minecraft:air>.

What you expected to happen:

The items should essentially be the same as defined in the recipe.

Script & logs:

https://gist.github.com/justinrusso/ec239fc5b11f1b826228c99fc94d2275


Affected Versions (Do not use "latest"):

  • Minecraft: 1.15.2
  • Forge: 31.2.0
  • Crafttweaker: 1.15.2-6.0.0.29 and dev (e3d0d1c)
  • Using a server: No
commented

believe this is fixed