ContentTweaker

ContentTweaker

27M Downloads

itemGetContainerItem not working properly

iridiumlynx opened this issue ยท 2 comments

commented

Problem:
Setting itemGetContainerItem works (sometimes), but when using the item as a fuel (or in recipes), Minecraft crashes with "java.lang.IllegalArgumentException: stack cannot be null" though it isn't null in the script.

Prerequisites:
forge-1.12.2-14.23.5.2847
CraftTweaker2-1.12-4.1.20
ContentTweaker-1.12.2-4.9.1

Scripts:
test0.zs
test1.zs

Logs:
crafttweaker.log
Minecraft log

commented
  1. Will item:contenttweaker:testitem_fuel be resolved if I register it after setting itemGetContainerItem?
  2. This doesn't work either though return (<item:minecraft:iron_pickaxe>*1).withDamage(input.damage+1); and return <item:minecraft:iron_ingot>*3; guarantee that returned IItemStack in not either null or empty.
  3. According to this and this itemGetContainerItem function is allowed to return null.
commented

First of all:
You do the getItemContainerItem before you do the register call.

Second:
The exception that the stack cannot be null also appears when you try to create an empty ItemStack.