commit
825658669b
|
@ -17,7 +17,7 @@ Supported Mods
|
|||
- ExNihilo
|
||||
- ExtendedWorkbench
|
||||
- Factorization (0.8.95+)
|
||||
- Forestry
|
||||
- Forestry (3.6.0+)
|
||||
- Flaxbeard's Steam Power
|
||||
- Mariculture
|
||||
- Mekanism 8
|
||||
|
|
|
@ -20,7 +20,6 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
public class InputHelper {
|
||||
public static boolean isABlock(IItemStack block) {
|
||||
if (!(isABlock(toStack(block)))) {
|
||||
LogHelper.logError("Item must be a block, or you must specify a block to render as when adding a TConstruct Melting recipe");
|
||||
return false;
|
||||
} else
|
||||
return true;
|
||||
|
|
|
@ -7,10 +7,10 @@ import mekanism.api.gas.GasStack;
|
|||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.MineTweakerImplementationAPI;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import minetweaker.mc1710.data.NBTConverter;
|
||||
import minetweaker.mc1710.item.MCItemStack;
|
||||
import modtweaker2.mods.mekanism.gas.MCGasStack;
|
||||
import modtweaker2.utils.TweakerPlugin;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
|
@ -59,13 +59,13 @@ public class LogHelper {
|
|||
*/
|
||||
public static String getStackDescription(Object object) {
|
||||
if(object instanceof ItemStack) {
|
||||
return getStackDescription((ItemStack)object);
|
||||
return new MCItemStack((ItemStack)object).toString();
|
||||
} else if (object instanceof FluidStack) {
|
||||
return getStackDescription((FluidStack)object);
|
||||
} else if (object instanceof Block) {
|
||||
return getStackDescription(new ItemStack((Block)object, 1, 0));
|
||||
return new MCItemStack(new ItemStack((Block)object, 1, 0)).toString();
|
||||
} else if (TweakerPlugin.isLoaded("Mekanism") && object instanceof GasStack) {
|
||||
return getStackDescription((GasStack)object);
|
||||
return new MCGasStack((GasStack)object).toString();
|
||||
} else if (object instanceof String) {
|
||||
// Check if string specifies an oredict entry
|
||||
List<ItemStack> ores = OreDictionary.getOres((String)object);
|
||||
|
@ -81,35 +81,6 @@ public class LogHelper {
|
|||
return "null";
|
||||
}
|
||||
}
|
||||
|
||||
public static String getStackDescription(ItemStack stack) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
// Creates a name like <minecraft:piston> or <appliedenergistics2:item.ItemMultiMaterial:156>
|
||||
sb.append('<');
|
||||
sb.append(Item.itemRegistry.getNameForObject(stack.getItem()));
|
||||
if(stack.getItemDamage() == 32767) {
|
||||
sb.append(":*");
|
||||
} else if (stack.getItemDamage() > 0) {
|
||||
sb.append(":").append(stack.getItemDamage());
|
||||
}
|
||||
sb.append('>');
|
||||
|
||||
// Do we have a tag? (e.g. <Botania:specialFlower>.withTag({}) )
|
||||
if(stack.getTagCompound() != null)
|
||||
{
|
||||
sb.append(".withTag(");
|
||||
sb.append(NBTConverter.from(stack.getTagCompound(), true));
|
||||
sb.append(')');
|
||||
}
|
||||
|
||||
// Do we have a stack size > 1?
|
||||
if(stack.stackSize > 1) {
|
||||
sb.append(" * ").append(stack.stackSize);
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String getStackDescription(FluidStack stack) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -123,18 +94,6 @@ public class LogHelper {
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String getStackDescription(GasStack stack) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("<gas:").append(stack.getGas().getName()).append('>');
|
||||
|
||||
if(stack.amount > 1) {
|
||||
sb.append(" * ").append(stack.amount);
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String getListDescription(List<?> objects) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
|
|
@ -11,12 +11,15 @@ import modtweaker2.mods.mekanism.handlers.ChemicalWasher;
|
|||
import modtweaker2.mods.mekanism.handlers.Combiner;
|
||||
import modtweaker2.mods.mekanism.handlers.Compressor;
|
||||
import modtweaker2.mods.mekanism.handlers.Crusher;
|
||||
import modtweaker2.mods.mekanism.handlers.EnergizedSmelter;
|
||||
import modtweaker2.mods.mekanism.handlers.Enrichment;
|
||||
import modtweaker2.mods.mekanism.handlers.Infuser;
|
||||
import modtweaker2.mods.mekanism.handlers.Purification;
|
||||
import modtweaker2.mods.mekanism.handlers.Reaction;
|
||||
import modtweaker2.mods.mekanism.handlers.Sawmill;
|
||||
import modtweaker2.mods.mekanism.handlers.Separator;
|
||||
import modtweaker2.mods.mekanism.handlers.SolarEvaporation;
|
||||
import modtweaker2.mods.mekanism.handlers.SolarNeutronActivator;
|
||||
import modtweaker2.utils.TweakerPlugin;
|
||||
|
||||
public class Mekanism extends TweakerPlugin {
|
||||
|
@ -31,11 +34,14 @@ public class Mekanism extends TweakerPlugin {
|
|||
MineTweakerAPI.registerClass(Combiner.class);
|
||||
MineTweakerAPI.registerClass(Compressor.class);
|
||||
MineTweakerAPI.registerClass(Crusher.class);
|
||||
MineTweakerAPI.registerClass(EnergizedSmelter.class);
|
||||
MineTweakerAPI.registerClass(Enrichment.class);
|
||||
MineTweakerAPI.registerClass(Infuser.class);
|
||||
MineTweakerAPI.registerClass(Purification.class);
|
||||
MineTweakerAPI.registerClass(Reaction.class);
|
||||
MineTweakerAPI.registerClass(Sawmill.class);
|
||||
MineTweakerAPI.registerClass(Separator.class);
|
||||
MineTweakerAPI.registerClass(SolarEvaporation.class);
|
||||
MineTweakerAPI.registerClass(SolarNeutronActivator.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,9 @@ import mekanism.common.recipe.machines.PressurizedRecipe;
|
|||
import mekanism.common.recipe.machines.PurificationRecipe;
|
||||
import mekanism.common.recipe.machines.SawmillRecipe;
|
||||
import mekanism.common.recipe.machines.SeparatorRecipe;
|
||||
import mekanism.common.recipe.machines.SmeltingRecipe;
|
||||
import mekanism.common.recipe.machines.SolarEvaporationRecipe;
|
||||
import mekanism.common.recipe.machines.SolarNeutronRecipe;
|
||||
import mekanism.common.recipe.machines.WasherRecipe;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.MineTweakerImplementationAPI;
|
||||
|
@ -39,8 +42,10 @@ public class MekanismLogger implements ICommandFunction {
|
|||
validArguments.add("crystallizer");
|
||||
validArguments.add("dissolution");
|
||||
validArguments.add("enrichment");
|
||||
validArguments.add("evaporation");
|
||||
validArguments.add("infuser");
|
||||
validArguments.add("injection");
|
||||
validArguments.add("neutron");
|
||||
validArguments.add("oxidizer");
|
||||
validArguments.add("purification");
|
||||
validArguments.add("reaction");
|
||||
|
@ -135,6 +140,14 @@ public class MekanismLogger implements ICommandFunction {
|
|||
}
|
||||
}
|
||||
|
||||
if(args.isEmpty() || args.contains("crusher")) {
|
||||
for(SmeltingRecipe recipe : (Collection<SmeltingRecipe>)Recipe.ENERGIZED_SMELTER.get().values()) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.mekanism.Smelter.addRecipe(%s, %s);",
|
||||
LogHelper.getStackDescription(recipe.recipeInput.ingredient),
|
||||
LogHelper.getStackDescription(recipe.recipeOutput.output)));
|
||||
}
|
||||
}
|
||||
|
||||
if(args.isEmpty() || args.contains("enrichment")) {
|
||||
for(EnrichmentRecipe recipe : (Collection<EnrichmentRecipe>)Recipe.ENRICHMENT_CHAMBER.get().values()) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.mekanism.Enrichment.addRecipe(%s, %s);",
|
||||
|
@ -200,6 +213,22 @@ public class MekanismLogger implements ICommandFunction {
|
|||
LogHelper.getStackDescription(recipe.recipeOutput.rightGas)));
|
||||
}
|
||||
}
|
||||
|
||||
if(args.isEmpty() || args.contains("evaporation")) {
|
||||
for(SolarEvaporationRecipe recipe : (Collection<SolarEvaporationRecipe>)Recipe.SOLAR_EVAPORATION_PLANT.get().values()) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.mekanism.SolarEvaporation.addRecipe(%s, %s);",
|
||||
LogHelper.getStackDescription(recipe.recipeInput.ingredient),
|
||||
LogHelper.getStackDescription(recipe.recipeOutput.output)));
|
||||
}
|
||||
}
|
||||
|
||||
if(args.isEmpty() || args.contains("neutron")) {
|
||||
for(SolarNeutronRecipe recipe : (Collection<SolarNeutronRecipe>)Recipe.SOLAR_NEUTRON_ACTIVATOR.get().values()) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.mekanism.SolarNeutronActivator.addRecipe(%s, %s);",
|
||||
LogHelper.getStackDescription(recipe.recipeInput.ingredient),
|
||||
LogHelper.getStackDescription(recipe.recipeOutput.output)));
|
||||
}
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir"));
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
package modtweaker2.mods.mekanism.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.inputs.MachineInput;
|
||||
import mekanism.common.recipe.machines.MachineRecipe;
|
||||
import mekanism.common.recipe.machines.SmeltingRecipe;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.item.IngredientAny;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.helpers.StackHelper;
|
||||
import modtweaker2.mods.mekanism.util.AddMekanismRecipe;
|
||||
import modtweaker2.mods.mekanism.util.RemoveMekanismRecipe;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@ZenClass("mods.mekanism.Smelter")
|
||||
public class EnergizedSmelter {
|
||||
|
||||
public static final String name = "Mekanism Smelter";
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack itemInput, IItemStack itemOutput) {
|
||||
if(itemInput == null || itemOutput == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
SmeltingRecipe recipe = new SmeltingRecipe(toStack(itemInput), toStack(itemOutput));
|
||||
|
||||
MineTweakerAPI.apply(new AddMekanismRecipe(name, Recipe.ENERGIZED_SMELTER.get(), recipe));
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient itemInput, @Optional IIngredient itemOutput) {
|
||||
if(itemInput == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
if(itemOutput == null) itemOutput = IngredientAny.INSTANCE;
|
||||
|
||||
Map<MachineInput, MachineRecipe> recipes = new HashMap<MachineInput, MachineRecipe>();
|
||||
|
||||
for(Entry<ItemStackInput, SmeltingRecipe> entry : ((Map<ItemStackInput, SmeltingRecipe>)Recipe.ENERGIZED_SMELTER.get()).entrySet() ) {
|
||||
IItemStack inputItem = InputHelper.toIItemStack(entry.getKey().ingredient);
|
||||
IItemStack outputItem = InputHelper.toIItemStack(entry.getValue().recipeOutput.output);
|
||||
|
||||
if(!StackHelper.matches(itemInput, inputItem)) continue;
|
||||
if(!StackHelper.matches(itemOutput, outputItem)) continue;
|
||||
|
||||
recipes.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
if(!recipes.isEmpty()) {
|
||||
MineTweakerAPI.apply(new RemoveMekanismRecipe(name, Recipe.ENERGIZED_SMELTER.get(), recipes));
|
||||
} else {
|
||||
LogHelper.logWarning(String.format("No %s recipe found for %s and %s. Command ignored!", name, itemInput.toString(), itemOutput.toString()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package modtweaker2.mods.mekanism.handlers;
|
||||
|
||||
import static modtweaker2.helpers.InputHelper.toFluid;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.FluidInput;
|
||||
import mekanism.common.recipe.inputs.MachineInput;
|
||||
import mekanism.common.recipe.machines.MachineRecipe;
|
||||
import mekanism.common.recipe.machines.SolarEvaporationRecipe;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IngredientAny;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import modtweaker2.helpers.InputHelper;
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.helpers.StackHelper;
|
||||
import modtweaker2.mods.mekanism.util.AddMekanismRecipe;
|
||||
import modtweaker2.mods.mekanism.util.RemoveMekanismRecipe;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@ZenClass("mods.mekanism.SolarEvaporation")
|
||||
public class SolarEvaporation {
|
||||
|
||||
public static final String name = "Mekanism Solar Evaporation";
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ZenMethod
|
||||
public static void addRecipe(ILiquidStack liquidInput, ILiquidStack liquidOutput) {
|
||||
if(liquidInput == null || liquidOutput == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
SolarEvaporationRecipe recipe = new SolarEvaporationRecipe(toFluid(liquidInput), toFluid(liquidOutput));
|
||||
|
||||
MineTweakerAPI.apply(new AddMekanismRecipe(name, Recipe.SOLAR_EVAPORATION_PLANT.get(), recipe));
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient liquidInput, @Optional IIngredient liquidOutput) {
|
||||
if(liquidInput == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
if(liquidOutput == null) liquidOutput = IngredientAny.INSTANCE;
|
||||
|
||||
Map<MachineInput, MachineRecipe> recipes = new HashMap<MachineInput, MachineRecipe>();
|
||||
|
||||
for(Entry<FluidInput, SolarEvaporationRecipe> entry : ((Map<FluidInput, SolarEvaporationRecipe>)Recipe.SOLAR_EVAPORATION_PLANT.get()).entrySet() ) {
|
||||
ILiquidStack inputLiquid = InputHelper.toILiquidStack(entry.getKey().ingredient);
|
||||
ILiquidStack outputLiquid = InputHelper.toILiquidStack(entry.getValue().recipeOutput.output);
|
||||
|
||||
if(!StackHelper.matches(liquidInput, inputLiquid)) continue;
|
||||
if(!StackHelper.matches(liquidOutput, outputLiquid)) continue;
|
||||
|
||||
recipes.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
if(!recipes.isEmpty()) {
|
||||
MineTweakerAPI.apply(new RemoveMekanismRecipe(name, Recipe.SOLAR_EVAPORATION_PLANT.get(), recipes));
|
||||
} else {
|
||||
LogHelper.logWarning(String.format("No %s recipe found for %s and %s. Command ignored!", name, liquidInput.toString(), liquidOutput.toString()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package modtweaker2.mods.mekanism.handlers;
|
||||
|
||||
import static modtweaker2.mods.mekanism.MekanismHelper.toGas;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.GasInput;
|
||||
import mekanism.common.recipe.inputs.MachineInput;
|
||||
import mekanism.common.recipe.machines.MachineRecipe;
|
||||
import mekanism.common.recipe.machines.SolarNeutronRecipe;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IngredientAny;
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.helpers.StackHelper;
|
||||
import modtweaker2.mods.mekanism.gas.IGasStack;
|
||||
import modtweaker2.mods.mekanism.gas.MCGasStack;
|
||||
import modtweaker2.mods.mekanism.util.AddMekanismRecipe;
|
||||
import modtweaker2.mods.mekanism.util.RemoveMekanismRecipe;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@ZenClass("mods.mekanism.SolarNeutronActivator")
|
||||
public class SolarNeutronActivator {
|
||||
|
||||
public static final String name = "Mekanism Solar Evaporation";
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ZenMethod
|
||||
public static void addRecipe(IGasStack gasInput, IGasStack gasOutput) {
|
||||
if(gasInput == null || gasOutput == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
SolarNeutronRecipe recipe = new SolarNeutronRecipe(toGas(gasInput), toGas(gasOutput));
|
||||
|
||||
MineTweakerAPI.apply(new AddMekanismRecipe(name, Recipe.SOLAR_NEUTRON_ACTIVATOR.get(), recipe));
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient gasInput, @Optional IIngredient gasOutput) {
|
||||
if(gasInput == null) {
|
||||
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
if(gasOutput == null) gasOutput = IngredientAny.INSTANCE;
|
||||
|
||||
Map<MachineInput, MachineRecipe> recipes = new HashMap<MachineInput, MachineRecipe>();
|
||||
|
||||
for(Entry<GasInput, SolarNeutronRecipe> entry : ((Map<GasInput, SolarNeutronRecipe>)Recipe.SOLAR_NEUTRON_ACTIVATOR.get()).entrySet() ) {
|
||||
IGasStack inputGas = new MCGasStack(entry.getKey().ingredient);
|
||||
IGasStack outputGas = new MCGasStack(entry.getValue().recipeOutput.output);
|
||||
|
||||
if(!StackHelper.matches(gasInput, inputGas)) continue;
|
||||
if(!StackHelper.matches(gasOutput, outputGas)) continue;
|
||||
|
||||
recipes.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
if(!recipes.isEmpty()) {
|
||||
MineTweakerAPI.apply(new RemoveMekanismRecipe(name, Recipe.SOLAR_NEUTRON_ACTIVATOR.get(), recipes));
|
||||
} else {
|
||||
LogHelper.logWarning(String.format("No %s recipe found for %s and %s. Command ignored!", name, gasInput.toString(), gasOutput.toString()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,12 +4,14 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
|
||||
import mekanism.common.recipe.inputs.MachineInput;
|
||||
import mekanism.common.recipe.machines.CombinerRecipe;
|
||||
import mekanism.common.recipe.machines.CrusherRecipe;
|
||||
import mekanism.common.recipe.machines.CrystallizerRecipe;
|
||||
import mekanism.common.recipe.machines.MachineRecipe;
|
||||
import mekanism.common.recipe.outputs.ChanceOutput;
|
||||
import mekanism.common.recipe.outputs.ChemicalPairOutput;
|
||||
import mekanism.common.recipe.outputs.FluidOutput;
|
||||
import mekanism.common.recipe.outputs.GasOutput;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
import mekanism.common.recipe.outputs.MachineOutput;
|
||||
import mekanism.common.recipe.outputs.PressurizedOutput;
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.utils.BaseMapAddition;
|
||||
|
||||
|
@ -27,15 +29,22 @@ public class AddMekanismRecipe extends BaseMapAddition<MachineInput, MachineReci
|
|||
|
||||
@Override
|
||||
protected String getRecipeInfo(Entry<MachineInput, MachineRecipe> recipe) {
|
||||
MachineRecipe machineRecipe = recipe.getValue();
|
||||
MachineOutput output = recipe.getValue().recipeOutput;
|
||||
|
||||
if(machineRecipe instanceof CombinerRecipe) {
|
||||
return LogHelper.getStackDescription(((ItemStackOutput)output).output);
|
||||
} else if (machineRecipe instanceof CrusherRecipe) {
|
||||
return LogHelper.getStackDescription(((ItemStackOutput)output).output);
|
||||
} else if (machineRecipe instanceof CrystallizerRecipe) {
|
||||
if(output instanceof ItemStackOutput) {
|
||||
return LogHelper.getStackDescription(((ItemStackOutput)output).output);
|
||||
} else if (output instanceof GasOutput) {
|
||||
return LogHelper.getStackDescription(((GasOutput)output).output);
|
||||
} else if (output instanceof FluidOutput) {
|
||||
return LogHelper.getStackDescription(((FluidOutput)output).output);
|
||||
} else if (output instanceof ChemicalPairOutput) {
|
||||
return "[" + LogHelper.getStackDescription(((ChemicalPairOutput)output).leftGas) + ", " +
|
||||
LogHelper.getStackDescription(((ChemicalPairOutput)output).rightGas) + "]";
|
||||
} else if (output instanceof ChanceOutput) {
|
||||
return LogHelper.getStackDescription(((ChanceOutput)output).primaryOutput);
|
||||
} else if (output instanceof PressurizedOutput) {
|
||||
return "[" + LogHelper.getStackDescription(((PressurizedOutput)output).getItemOutput()) + ", " +
|
||||
LogHelper.getStackDescription(((PressurizedOutput)output).getGasOutput()) + "]";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -4,12 +4,14 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
|
||||
import mekanism.common.recipe.inputs.MachineInput;
|
||||
import mekanism.common.recipe.machines.CombinerRecipe;
|
||||
import mekanism.common.recipe.machines.CrusherRecipe;
|
||||
import mekanism.common.recipe.machines.CrystallizerRecipe;
|
||||
import mekanism.common.recipe.machines.MachineRecipe;
|
||||
import mekanism.common.recipe.outputs.ChanceOutput;
|
||||
import mekanism.common.recipe.outputs.ChemicalPairOutput;
|
||||
import mekanism.common.recipe.outputs.FluidOutput;
|
||||
import mekanism.common.recipe.outputs.GasOutput;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
import mekanism.common.recipe.outputs.MachineOutput;
|
||||
import mekanism.common.recipe.outputs.PressurizedOutput;
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.utils.BaseMapRemoval;
|
||||
|
||||
|
@ -21,15 +23,22 @@ public class RemoveMekanismRecipe extends BaseMapRemoval<MachineInput, MachineRe
|
|||
|
||||
@Override
|
||||
protected String getRecipeInfo(Entry<MachineInput, MachineRecipe> recipe) {
|
||||
MachineRecipe machineRecipe = recipe.getValue();
|
||||
MachineOutput output = recipe.getValue().recipeOutput;
|
||||
|
||||
if(machineRecipe instanceof CombinerRecipe) {
|
||||
return LogHelper.getStackDescription(((ItemStackOutput)output).output);
|
||||
} else if (machineRecipe instanceof CrusherRecipe) {
|
||||
return LogHelper.getStackDescription(((ItemStackOutput)output).output);
|
||||
} else if (machineRecipe instanceof CrystallizerRecipe) {
|
||||
if(output instanceof ItemStackOutput) {
|
||||
return LogHelper.getStackDescription(((ItemStackOutput)output).output);
|
||||
} else if (output instanceof GasOutput) {
|
||||
return LogHelper.getStackDescription(((GasOutput)output).output);
|
||||
} else if (output instanceof FluidOutput) {
|
||||
return LogHelper.getStackDescription(((FluidOutput)output).output);
|
||||
} else if (output instanceof ChemicalPairOutput) {
|
||||
return "[" + LogHelper.getStackDescription(((ChemicalPairOutput)output).leftGas) + ", " +
|
||||
LogHelper.getStackDescription(((ChemicalPairOutput)output).rightGas) + "]";
|
||||
} else if (output instanceof ChanceOutput) {
|
||||
return LogHelper.getStackDescription(((ChanceOutput)output).primaryOutput);
|
||||
} else if (output instanceof PressurizedOutput) {
|
||||
return "[" + LogHelper.getStackDescription(((PressurizedOutput)output).getItemOutput()) + ", " +
|
||||
LogHelper.getStackDescription(((PressurizedOutput)output).getGasOutput()) + "]";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue