Add CraftTweaker support for the Compressor

This commit is contained in:
al132 2016-07-17 15:19:31 -05:00
parent 42ee2b7d57
commit ea74721945
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,43 @@
package techreborn.compat.minetweaker;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.recipe.machines.CompressorRecipe;
import techreborn.api.Reference;
/*
* mods.techreborn.compressor.addRecipe(<minecraft:clay>,<minecraft:clay_ball>, 40,100);
*/
@ZenClass("mods.techreborn.compressor")
public class MTCompressor extends MTGeneric {
@ZenMethod
public static void addRecipe(IItemStack output1, IIngredient input1, int ticktime, int euTick) {
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
//public CompressorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) {
CompressorRecipe r = new CompressorRecipe(oInput1, MinetweakerCompat.toStack(output1), ticktime, euTick);
addRecipe(r);
}
@ZenMethod
public static void removeInputRecipe(IIngredient iIngredient) {
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
}
public static String getMachineName() {
return Reference.compressorRecipe;
}
}

View file

@ -37,6 +37,7 @@ public class MinetweakerCompat implements ICompatModule {
MineTweakerAPI.registerClass(MTBlastFurnace.class);
MineTweakerAPI.registerClass(MTCentrifuge.class);
MineTweakerAPI.registerClass(MTChemicalReactor.class);
MineTweakerAPI.registerClass(MTCompressor.class);
MineTweakerAPI.registerClass(MTIndustrialGrinder.class);
MineTweakerAPI.registerClass(MTImplosionCompressor.class);
MineTweakerAPI.registerClass(MTIndustrialElectrolyzer.class);