Tech Reborn

Tech Reborn

30M Downloads

[1.12] Industrial Grinder and Crafttweaker

tgstyle opened this issue ยท 12 comments

commented

Trying to add a recipe with null for output stack 2-4 says output stack null or empty. Is this not possible? Input stack 2 as null works fine.
mods.techreborn.grinder.addRecipe(techreborn:dust:20 * 4, null, null, null, enderore:ore_ender, null, liquid:water, 20, 128);

commented

Can you use air?

commented

those if checks need to make sure the stack isnt empty. But should still do a null check.

commented

@drcrazy, nope, we get "Output stack should not be empty" when using minecraft:air.

commented

@modmuss50 indeed. Should be something like:

if(output1 != null)
    if(!output1.isItemEqual(ItemStack.EMPTY))
        addOutput(output1);
commented

if(output1 != null && !output1.isItemEqual(ItemStack.EMPTY)) is what needs to be done. If I get a chance it will only take 10 mins to fix.

commented

Could even put those checks in the addOutput method.

commented

The same here. Reason: CT returns ItemStack.EMPTY instead of null when null is passed in Zenscript. Should be pretty easy to fix:

if (output1 != null)
addOutput(output1);
if (output2 != null)
addOutput(output2);
if (output3 != null)
addOutput(output3);
if (output4 != null)
addOutput(output4);

commented

I'm not a java guy, and have no idea - whether it is smart enough not to check second condition, if first one is already false, otherwise it is quite possible to get NPE ;) But you're the boss ;)

commented
commented

Have you updated reborn core? You can pick latest from curse

commented

CraftTweaker2-1.12-4.0.4
RebornCore-1.12.1-3.3.0.99-universal
TechReborn-1.12.1-2.7.0.209-universal

CT script:
mods.techreborn.grinder.addRecipe(minecraft:diamond, null, null, null, minecraft:dirt, null, liquid:water, 200, 20);

Results:
image