Add extractor support to craft tweaker
This commit is contained in:
parent
d7ce35428c
commit
f1a3387fbf
3 changed files with 47 additions and 2 deletions
|
@ -32,7 +32,7 @@ public class ExtractorRecipe extends BaseRecipe {
|
|||
|
||||
boolean useOreDic = true;
|
||||
|
||||
public ExtractorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) {
|
||||
public ExtractorRecipe(Object input1, ItemStack output1, int tickTime, int euPerTick) {
|
||||
super(Reference.EXTRACTOR_RECIPE, tickTime, euPerTick);
|
||||
if (input1 != null)
|
||||
addInput(input1);
|
||||
|
@ -40,7 +40,7 @@ public class ExtractorRecipe extends BaseRecipe {
|
|||
addOutput(output1);
|
||||
}
|
||||
|
||||
public ExtractorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick, boolean useOreDic) {
|
||||
public ExtractorRecipe(Object input1, ItemStack output1, int tickTime, int euPerTick, boolean useOreDic) {
|
||||
this(input1, output1, tickTime, euPerTick);
|
||||
this.useOreDic = useOreDic;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package techreborn.compat.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.ExtractorRecipe;
|
||||
|
||||
/**
|
||||
* mods.techreborn.extractor.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, 20, 100);
|
||||
*/
|
||||
@ZenClass("mods.techreborn.extractor")
|
||||
public class CTExtractor extends CTGeneric {
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
|
||||
Object oInput1 = CraftTweakerCompat.toObject(input1);
|
||||
|
||||
ExtractorRecipe r = new ExtractorRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeAll(){
|
||||
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.EXTRACTOR_RECIPE;
|
||||
}
|
||||
|
||||
}
|
|
@ -89,6 +89,7 @@ public class CraftTweakerCompat implements ICompatModule {
|
|||
CraftTweakerAPI.registerClass(CTScrapbox.class);
|
||||
CraftTweakerAPI.registerClass(CTDistillationTower.class);
|
||||
CraftTweakerAPI.registerClass(CTGrinder.class);
|
||||
CraftTweakerAPI.registerClass(CTExtractor.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue