Mekanism

Mekanism

111M Downloads

[Suggestion/Question] Mekanism Crafttweaker machine recipe output

Entayan opened this issue ยท 7 comments

commented

I don't know if this is already a feature but I can't seem to find hide nor tail of it. Does integration exist to allow a Crafttweaker command to dump Mekanism machine recipes as zenscript? I've already asked the Crafttweaker devs about this and they told me that this was a question for Mekanism developers.

I've been trying to add recipes to various machines but always seem to run into issues because I don't know what the recipes require as input (and I'm not familiar with how to deal with mekanism gas in crafttweaker) so I thought that looking at zenscript versions of the recipes would help me to figure out what's going on.

What I've been trying to do is add compatibility for certain ores but I can't seem to specify the amount of gas produced for my dissolution chamber recipe. I've tried both multiplying the gas directly as in "gas * 1000" or using "gas.withAmount(1000)" and neither seem to work. It works fine when I don't specify the amount but then I only get 1mb from an ore.

Any information or help would be greatly appreciated!

commented

I've written some stuff about our crafttweaker integration over at http://wiki.aidancbrady.com/wiki/Tutorials/CraftTweaker

commented

@thommy101 The dissolution chamber add recipe zen method is actually bugged, though.

  1. mods.mekanism.chemical.dissolution.addRecipe(denseGold, gasGold); Functions, but only creates an output of 1mb of Gold Slurry. The output should be size configurable anyways.

  2. mods.mekanism.chemical.dissolution.addRecipe(denseGold, gasGold * 3000); Produces this https://github.com/aidancbrady/Mekanism/blob/07aab3bd2052209b41020e83f5251ea3690b2170/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalDissolution.java#L41 error, so the output is not properly configurable.

EDIT: Changed source reference to perma-link.

commented

mods.mekanism.chemical.dissolution.addRecipe(denseGold, gasGold.withAmount(3000)); gives the same error.

CraftTweaker Log
Main Script in Question (You will need to remove the rest of the script if you try to directly run it -- it has global variables from many other files.)
Mek Globals for Script in Question
Dense Ores Globals for Script in Question
Sorry for all the script files, this is how I've been organizing my work.

commented

<gasstack>.withAmount(int amount) should do it (though it looks like that method is annotated so that it gets called when you do *)

commented

I'm getting this also.

Might have something to do with this:
public IGasStack withAmount(int amount) { return null; }

in Mekanism/src/main/java/mekanism/common/integration/crafttweaker/gas/CraftTweakerGasStack.java

commented

I don't know how to do a pull request, but I think I've fixed it with this:

public IGasStack withAmount(int amount) { return new CraftTweakerGasStack(stack.withAmount(amount)); }

This code definitely does work, whether it causes other problems, though, I can't say for sure.

commented

Though maybe this is the better way of doing things?
public IGasStack withAmount(int amount) { stack.withAmount(amount); return this; }