No idea why injection adding isn't working.
anyone is free to take a look and give input
This commit is contained in:
parent
a451413267
commit
f5034b04d8
|
@ -5,7 +5,7 @@ import java.util.regex.Pattern;
|
|||
import minetweaker.MineTweakerAPI;
|
||||
import modtweaker2.mods.mekanism.gas.GasBracketHandler;
|
||||
import modtweaker2.mods.mekanism.handlers.v8.ChemicalInfuser;
|
||||
import modtweaker2.mods.mekanism.handlers.ChemicalInjection;
|
||||
import modtweaker2.mods.mekanism.handlers.v8.ChemicalInjection;
|
||||
import modtweaker2.mods.mekanism.handlers.ChemicalOxidizer;
|
||||
import modtweaker2.mods.mekanism.handlers.ChemicalWasher;
|
||||
import modtweaker2.mods.mekanism.handlers.Combiner;
|
||||
|
|
|
@ -47,7 +47,6 @@ public class ChemicalDissolution {
|
|||
public GasStack output;
|
||||
public ItemStack input;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public DissolutionRecipe(GasStack output, ItemStack input) {
|
||||
this.output = output;
|
||||
this.input = input;
|
||||
|
|
|
@ -8,17 +8,13 @@ import mekanism.api.gas.GasStack;
|
|||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.ChemicalPairInput;
|
||||
import mekanism.common.recipe.inputs.InfusionInput;
|
||||
import mekanism.common.recipe.machines.ChemicalInfuserRecipe;
|
||||
import mekanism.common.recipe.outputs.GasOutput;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.mods.mekanism.MekanismHelper;
|
||||
import modtweaker2.mods.mekanism.gas.IGasStack;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
package modtweaker2.mods.mekanism.handlers.v8;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.mods.mekanism.MekanismHelper;
|
||||
import modtweaker2.mods.mekanism.gas.IGasStack;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@ZenClass("mods.mekanism.chemical.Injection")
|
||||
public class ChemicalInjection {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IItemStack input, IGasStack gas) {
|
||||
MineTweakerAPI.apply(new Add(new InjectionRecipe(InputHelper.toStack(output), InputHelper.toStack(input), MekanismHelper.toGas(gas))));
|
||||
}
|
||||
|
||||
private static class Add extends BaseMapAddition {
|
||||
|
||||
public InjectionRecipe recipe;
|
||||
|
||||
public Add(InjectionRecipe recipe) {
|
||||
super("Chemical Injection", Recipe.CHEMICAL_INJECTION_CHAMBER.get(), recipe.input, recipe.output);
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
RecipeHandler.addChemicalInjectionChamberRecipe(recipe.input, recipe.gas.getGas().getLocalizedName(), recipe.output);
|
||||
}
|
||||
}
|
||||
|
||||
private static class InjectionRecipe {
|
||||
public ItemStack output;
|
||||
public ItemStack input;
|
||||
public GasStack gas;
|
||||
|
||||
public InjectionRecipe(ItemStack output, ItemStack input, GasStack gas) {
|
||||
this.output = output;
|
||||
this.input = input;
|
||||
this.gas = gas;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(InputHelper.toStack(output)));
|
||||
}
|
||||
|
||||
private static class Remove extends BaseMapRemoval {
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
super("Chemical Injection", Recipe.CHEMICAL_DISSOLUTION_CHAMBER.get(), output);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void apply() {
|
||||
List<AdvancedMachineInput> toRemove = new ArrayList<AdvancedMachineInput>();
|
||||
for (AdvancedMachineInput stack : (Set<AdvancedMachineInput>) Recipe.CHEMICAL_DISSOLUTION_CHAMBER.get().keySet()) {
|
||||
ItemStackOutput recipe = (ItemStackOutput) Recipe.CHEMICAL_DISSOLUTION_CHAMBER.get().get(stack);
|
||||
if (recipe.output.isItemEqual((ItemStack)this.stack)) {
|
||||
toRemove.add(stack);
|
||||
}
|
||||
}
|
||||
for (AdvancedMachineInput stack : toRemove) {
|
||||
Recipe.CHEMICAL_DISSOLUTION_CHAMBER.get().remove(stack);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -51,7 +51,6 @@ public class Infuser {
|
|||
public int amount;
|
||||
public InfuseType type;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public InfuserRecipe(ItemStack output, ItemStack input, int amount, InfuseType type) {
|
||||
this.output = output;
|
||||
this.input = input;
|
||||
|
|
Loading…
Reference in a new issue