Add more recipes

This commit is contained in:
Tom Elfring committed 2017-06-19 20:39:49 +02:00
1 parent a13ce7910d
commit bac3c884c1
1960 files changed
+43632 -5087

No files matched your search

@@ -1,186 +0,0 @@
package mekanism.client.jei;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import mekanism.api.gas.GasStack;
import mekanism.client.gui.IGuiWrapper;
import mekanism.client.gui.element.GuiElement;
import mekanism.client.gui.element.GuiProgress.ProgressBar;
import mekanism.client.render.MekanismRenderer;
import mekanism.client.render.MekanismRenderer.FluidType;
import mekanism.common.util.LangUtils;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.recipe.IRecipeCategory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
public abstract class BaseRecipeCategory implements IRecipeCategory, IGuiWrapper
{
public static final GuiDummy gui = new GuiDummy();
public String recipeName;
public String unlocalizedName;
public String guiTexture;
public ResourceLocation guiLocation;
public ProgressBar progressBar;
public int xOffset = 28;
public int yOffset = 16;
public BaseRecipeCategory(String gui, String name, String unlocalized, ProgressBar progress)
{
guiTexture = gui;
guiLocation = new ResourceLocation(guiTexture);
progressBar = progress;
recipeName = name;
unlocalizedName = unlocalized;
addGuiElements();
}
@Override
public String getUid()
{
return "mekanism." + recipeName;
}
@Override
public String getTitle()
{
return LangUtils.localize(unlocalizedName);
}
@Override
public void drawExtras(Minecraft minecraft)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
changeTexture(guiLocation);
for(GuiElement e : guiElements)
{
e.renderBackground(0, 0, -xOffset, -yOffset);
}
}
@Override
public void drawTexturedRect(int x, int y, int u, int v, int w, int h)
{
gui.drawTexturedModalRect(x, y, u, v, w, h);
}
@Override
public void drawTexturedRectFromIcon(int x, int y, TextureAtlasSprite icon, int w, int h)
{
gui.drawTexturedModalRect(x, y, icon, w, h);
}
@Override
public void displayTooltip(String s, int xAxis, int yAxis) {}
@Override
public void displayTooltips(List<String> list, int xAxis, int yAxis) {}
@Override
public FontRenderer getFont()
{
return null;
}
public void displayGauge(int length, int xPos, int yPos, int overlayX, int overlayY, int scale, FluidStack fluid, GasStack gas)
{
if(fluid == null && gas == null)
{
return;
}
int start = 0;
while(true)
{
int renderRemaining = 0;
if(scale > 16)
{
renderRemaining = 16;
scale -= 16;
}
else {
renderRemaining = scale;
scale = 0;
}
changeTexture(MekanismRenderer.getBlocksTexture());
if(fluid != null)
{
gui.drawTexturedModalRect(xPos, yPos + length - renderRemaining - start, MekanismRenderer.getFluidTexture(fluid.getFluid(), FluidType.STILL), 16, 16 - (16 - renderRemaining));
}
else if(gas != null)
{
gui.drawTexturedModalRect(xPos, yPos + length - renderRemaining - start, gas.getGas().getSprite(), 16, 16 - (16 - renderRemaining));
}
start+=16;
if(renderRemaining == 0 || scale == 0)
{
break;
}
}
changeTexture(guiLocation);
gui.drawTexturedModalRect(xPos, yPos, overlayX, overlayY, 16, length+1);
}
public void displayGauge(int xPos, int yPos, int sizeX, int sizeY, GasStack gas)
{
if(gas == null)
{
return;
}
changeTexture(MekanismRenderer.getBlocksTexture());
gui.drawTexturedModalRect(xPos, yPos, gas.getGas().getSprite(), sizeX, sizeY);
}
public String stripTexture()
{
return guiTexture.replace("mekanism:gui/", "");
}
public void changeTexture(ResourceLocation texture)
{
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
}
public Set<GuiElement> guiElements = new HashSet<GuiElement>();
public void addGuiElements() {}
public static class GuiDummy extends Gui {}
@Override
public IDrawable getIcon()
{
return null;
}
@Override
public List getTooltipStrings(int mouseX, int mouseY)
{
return Collections.emptyList();
}
}
@@ -1,94 +0,0 @@
package mekanism.client.jei;
import java.awt.Color;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
import com.google.common.base.MoreObjects;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasStack;
import mezz.jei.api.ingredients.IIngredientHelper;
import net.minecraft.item.ItemStack;
public class GasStackHelper implements IIngredientHelper<GasStack>
{
@Override
public List<GasStack> expandSubtypes(List<GasStack> contained)
{
return contained;
}
@Override
@Nullable
public GasStack getMatch(Iterable<GasStack> ingredients, GasStack toMatch)
{
for(GasStack stack : ingredients)
{
if(toMatch.getGas() == stack.getGas())
{
return stack;
}
}
return null;
}
@Override
public String getDisplayName(GasStack ingredient)
{
return ingredient.getGas().getLocalizedName();
}
@Override
public String getUniqueId(GasStack ingredient)
{
return "gas:" + ingredient.getGas().getName();
}
@Override
public String getWildcardId(GasStack ingredient)
{
return getUniqueId(ingredient);
}
@Override
public String getModId(GasStack ingredient)
{
return ingredient.getGas().getIcon().getResourceDomain();
}
@Override
public Iterable<Color> getColors(GasStack ingredient)
{
return Collections.emptyList();
}
@Override
public ItemStack cheatIngredient(GasStack ingredient, boolean fullStack)
{
return ItemStack.EMPTY;
}
@Override
public String getErrorInfo(GasStack ingredient)
{
MoreObjects.ToStringHelper toStringHelper = MoreObjects.toStringHelper(GasStack.class);
Gas gas = ingredient.getGas();
if(gas != null)
{
toStringHelper.add("Gas", gas.getLocalizedName());
}
else {
toStringHelper.add("Gas", "null");
}
toStringHelper.add("Amount", ingredient.amount);
return toStringHelper.toString();
}
}
@@ -1,45 +0,0 @@
package mekanism.client.jei;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import mekanism.client.gui.GuiMekanism;
import mekanism.client.gui.element.GuiElement;
import mezz.jei.api.gui.IAdvancedGuiHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
public class GuiElementHandler implements IAdvancedGuiHandler
{
@Override
public Class getGuiContainerClass()
{
return GuiMekanism.class;
}
@Override
public List getGuiExtraAreas(GuiContainer gui)
{
if(gui instanceof GuiMekanism)
{
List<Rectangle> list = new ArrayList<Rectangle>();
GuiMekanism guiMek = (GuiMekanism)gui;
for(GuiElement element : guiMek.guiElements)
{
list.add(element.getBounds(guiMek.getXPos(), guiMek.getYPos()).toRectangle());
}
return list;
}
return null;
}
@Override
public Object getIngredientUnderMouse(GuiContainer guiContainer, int mouseX, int mouseY)
{
return null;
}
}
@@ -1,328 +0,0 @@
package mekanism.client.jei;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasRegistry;
import mekanism.api.gas.GasStack;
import mekanism.client.gui.GuiChemicalCrystallizer;
import mekanism.client.gui.GuiChemicalDissolutionChamber;
import mekanism.client.gui.GuiChemicalInfuser;
import mekanism.client.gui.GuiChemicalInjectionChamber;
import mekanism.client.gui.GuiChemicalOxidizer;
import mekanism.client.gui.GuiChemicalWasher;
import mekanism.client.gui.GuiCombiner;
import mekanism.client.gui.GuiCrusher;
import mekanism.client.gui.GuiElectrolyticSeparator;
import mekanism.client.gui.GuiEnrichmentChamber;
import mekanism.client.gui.GuiMetallurgicInfuser;
import mekanism.client.gui.GuiOsmiumCompressor;
import mekanism.client.gui.GuiPRC;
import mekanism.client.gui.GuiPrecisionSawmill;
import mekanism.client.gui.GuiPurificationChamber;
import mekanism.client.gui.GuiRotaryCondensentrator;
import mekanism.client.gui.GuiSolarNeutronActivator;
import mekanism.client.gui.GuiThermalEvaporationController;
import mekanism.client.gui.element.GuiProgress.ProgressBar;
import mekanism.client.jei.crafting.ShapedMekanismRecipeHandler;
import mekanism.client.jei.crafting.ShapelessMekanismRecipeHandler;
import mekanism.client.jei.gas.GasStackRenderer;
import mekanism.client.jei.machine.AdvancedMachineRecipeCategory;
import mekanism.client.jei.machine.AdvancedMachineRecipeWrapper;
import mekanism.client.jei.machine.BaseRecipeHandler;
import mekanism.client.jei.machine.ChanceMachineRecipeCategory;
import mekanism.client.jei.machine.ChanceMachineRecipeWrapper;
import mekanism.client.jei.machine.MachineRecipeCategory;
import mekanism.client.jei.machine.MachineRecipeWrapper;
import mekanism.client.jei.machine.advanced.ChemicalInjectionChamberRecipeWrapper;
import mekanism.client.jei.machine.advanced.CombinerRecipeWrapper;
import mekanism.client.jei.machine.advanced.OsmiumCompressorRecipeWrapper;
import mekanism.client.jei.machine.advanced.PurificationChamberRecipeWrapper;
import mekanism.client.jei.machine.basic.CrusherRecipeWrapper;
import mekanism.client.jei.machine.basic.EnrichmentRecipeWrapper;
import mekanism.client.jei.machine.chance.PrecisionSawmillRecipeWrapper;
import mekanism.client.jei.machine.chemical.ChemicalCrystallizerRecipeCategory;
import mekanism.client.jei.machine.chemical.ChemicalCrystallizerRecipeWrapper;
import mekanism.client.jei.machine.chemical.ChemicalDissolutionChamberRecipeCategory;
import mekanism.client.jei.machine.chemical.ChemicalDissolutionChamberRecipeWrapper;
import mekanism.client.jei.machine.chemical.ChemicalInfuserRecipeCategory;
import mekanism.client.jei.machine.chemical.ChemicalInfuserRecipeWrapper;
import mekanism.client.jei.machine.chemical.ChemicalOxidizerRecipeCategory;
import mekanism.client.jei.machine.chemical.ChemicalOxidizerRecipeWrapper;
import mekanism.client.jei.machine.chemical.ChemicalWasherRecipeCategory;
import mekanism.client.jei.machine.chemical.ChemicalWasherRecipeWrapper;
import mekanism.client.jei.machine.other.ElectrolyticSeparatorRecipeCategory;
import mekanism.client.jei.machine.other.ElectrolyticSeparatorRecipeWrapper;
import mekanism.client.jei.machine.other.MetallurgicInfuserRecipeCategory;
import mekanism.client.jei.machine.other.MetallurgicInfuserRecipeWrapper;
import mekanism.client.jei.machine.other.PRCRecipeCategory;
import mekanism.client.jei.machine.other.PRCRecipeWrapper;
import mekanism.client.jei.machine.other.RotaryCondensentratorRecipeCategory;
import mekanism.client.jei.machine.other.RotaryCondensentratorRecipeWrapper;
import mekanism.client.jei.machine.other.SolarNeutronRecipeCategory;
import mekanism.client.jei.machine.other.SolarNeutronRecipeWrapper;
import mekanism.client.jei.machine.other.ThermalEvaporationRecipeCategory;
import mekanism.client.jei.machine.other.ThermalEvaporationRecipeWrapper;
import mekanism.common.MekanismBlocks;
import mekanism.common.MekanismItems;
import mekanism.common.base.IFactory;
import mekanism.common.base.IFactory.RecipeType;
import mekanism.common.base.ITierItem;
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
import mekanism.common.block.states.BlockStateMachine.MachineType;
import mekanism.common.recipe.RecipeHandler.Recipe;
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
import mekanism.common.recipe.machines.BasicMachineRecipe;
import mekanism.common.recipe.machines.ChanceMachineRecipe;
import mekanism.common.recipe.machines.ChemicalInfuserRecipe;
import mekanism.common.recipe.machines.CrystallizerRecipe;
import mekanism.common.recipe.machines.DissolutionRecipe;
import mekanism.common.recipe.machines.MachineRecipe;
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
import mekanism.common.recipe.machines.OxidationRecipe;
import mekanism.common.recipe.machines.PressurizedRecipe;
import mekanism.common.recipe.machines.SeparatorRecipe;
import mekanism.common.recipe.machines.SolarNeutronRecipe;
import mekanism.common.recipe.machines.ThermalEvaporationRecipe;
import mekanism.common.recipe.machines.WasherRecipe;
import mezz.jei.api.BlankModPlugin;
import mezz.jei.api.IModRegistry;
import mezz.jei.api.ISubtypeRegistry;
import mezz.jei.api.ISubtypeRegistry.ISubtypeInterpreter;
import mezz.jei.api.JEIPlugin;
import mezz.jei.api.ingredients.IModIngredientRegistration;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
@JEIPlugin
public class MekanismJEI extends BlankModPlugin
{
public static ISubtypeInterpreter NBT_INTERPRETER = new ISubtypeInterpreter() {
@Override
public String getSubtypeInfo(ItemStack itemStack)
{
String ret = Integer.toString(itemStack.getMetadata());
if(itemStack.getItem() instanceof ITierItem)
{
ret += ":" + ((ITierItem)itemStack.getItem()).getBaseTier(itemStack).getSimpleName();
}
if(itemStack.getItem() instanceof IFactory)
{
ret += ":" + RecipeType.values()[((IFactory)itemStack.getItem()).getRecipeType(itemStack)].getName();
}
return ret.isEmpty() ? null : ret.toLowerCase();
}
};
@Override
public void registerItemSubtypes(ISubtypeRegistry registry)
{
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.EnergyCube), NBT_INTERPRETER);
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.MachineBlock), NBT_INTERPRETER);
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.MachineBlock2), NBT_INTERPRETER);
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.MachineBlock3), NBT_INTERPRETER);
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.BasicBlock), NBT_INTERPRETER);
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.BasicBlock2), NBT_INTERPRETER);
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.GasTank), NBT_INTERPRETER);
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.CardboardBox), NBT_INTERPRETER);
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.Transmitter), NBT_INTERPRETER);
}
@Override
public void registerIngredients(IModIngredientRegistration registry)
{
List<GasStack> list = GasRegistry.getRegisteredGasses().stream().filter(g -> g.isVisible()).map(g -> new GasStack(g, Fluid.BUCKET_VOLUME)).collect(Collectors.toList());
registry.register(GasStack.class, list, new GasStackHelper(), new GasStackRenderer());
}
@Override
public void register(IModRegistry registry)
{
registry.addAdvancedGuiHandlers(new GuiElementHandler());
registry.addRecipeHandlers(new ShapedMekanismRecipeHandler(registry.getJeiHelpers()));
registry.addRecipeHandlers(new ShapelessMekanismRecipeHandler(registry.getJeiHelpers()));
registry.getJeiHelpers().getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(MekanismItems.ItemProxy));
registry.getJeiHelpers().getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(MekanismBlocks.BoundingBlock));
try {
registerBasicMachine(registry, Recipe.ENRICHMENT_CHAMBER, "tile.MachineBlock.EnrichmentChamber.name", ProgressBar.BLUE, EnrichmentRecipeWrapper.class);
registerBasicMachine(registry, Recipe.CRUSHER, "tile.MachineBlock.Crusher.name", ProgressBar.CRUSH, CrusherRecipeWrapper.class);
registerAdvancedMachine(registry, Recipe.COMBINER, "tile.MachineBlock.Combiner.name", ProgressBar.STONE, CombinerRecipeWrapper.class);
registerAdvancedMachine(registry, Recipe.PURIFICATION_CHAMBER, "tile.MachineBlock.PurificationChamber.name", ProgressBar.RED, PurificationChamberRecipeWrapper.class);
registerAdvancedMachine(registry, Recipe.OSMIUM_COMPRESSOR, "tile.MachineBlock.OsmiumCompressor.name", ProgressBar.RED, OsmiumCompressorRecipeWrapper.class);
registerAdvancedMachine(registry, Recipe.CHEMICAL_INJECTION_CHAMBER, "nei.chemicalInjectionChamber", ProgressBar.YELLOW, ChemicalInjectionChamberRecipeWrapper.class);
registerChanceMachine(registry, Recipe.PRECISION_SAWMILL, "tile.MachineBlock2.PrecisionSawmill.name", ProgressBar.PURPLE, PrecisionSawmillRecipeWrapper.class);
MetallurgicInfuserRecipeCategory metallurgicInfuserCategory = new MetallurgicInfuserRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(metallurgicInfuserCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(metallurgicInfuserCategory, MetallurgicInfuserRecipeWrapper.class));
addRecipes(registry, Recipe.METALLURGIC_INFUSER, metallurgicInfuserCategory, MetallurgicInfuserRecipe.class, MetallurgicInfuserRecipeCategory.class, MetallurgicInfuserRecipeWrapper.class);
ChemicalCrystallizerRecipeCategory chemicalCrystallizerCategory = new ChemicalCrystallizerRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(chemicalCrystallizerCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(chemicalCrystallizerCategory, ChemicalCrystallizerRecipeWrapper.class));
addRecipes(registry, Recipe.CHEMICAL_CRYSTALLIZER, chemicalCrystallizerCategory, CrystallizerRecipe.class, ChemicalCrystallizerRecipeCategory.class, ChemicalCrystallizerRecipeWrapper.class);
ChemicalDissolutionChamberRecipeCategory chemicalDissolutionChamberCategory = new ChemicalDissolutionChamberRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(chemicalDissolutionChamberCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(chemicalDissolutionChamberCategory, ChemicalDissolutionChamberRecipeWrapper.class));
addRecipes(registry, Recipe.CHEMICAL_DISSOLUTION_CHAMBER, chemicalDissolutionChamberCategory, DissolutionRecipe.class, ChemicalDissolutionChamberRecipeCategory.class, ChemicalDissolutionChamberRecipeWrapper.class);
ChemicalInfuserRecipeCategory chemicalInfuserCategory = new ChemicalInfuserRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(chemicalInfuserCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(chemicalInfuserCategory, ChemicalInfuserRecipeWrapper.class));
addRecipes(registry, Recipe.CHEMICAL_INFUSER, chemicalInfuserCategory, ChemicalInfuserRecipe.class, ChemicalInfuserRecipeCategory.class, ChemicalInfuserRecipeWrapper.class);
ChemicalOxidizerRecipeCategory chemicalOxidizerCategory = new ChemicalOxidizerRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(chemicalOxidizerCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(chemicalOxidizerCategory, ChemicalOxidizerRecipeWrapper.class));
addRecipes(registry, Recipe.CHEMICAL_OXIDIZER, chemicalOxidizerCategory, OxidationRecipe.class, ChemicalOxidizerRecipeCategory.class, ChemicalOxidizerRecipeWrapper.class);
ChemicalWasherRecipeCategory chemicalWasherCategory = new ChemicalWasherRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(chemicalWasherCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(chemicalWasherCategory, ChemicalWasherRecipeWrapper.class));
addRecipes(registry, Recipe.CHEMICAL_WASHER, chemicalWasherCategory, WasherRecipe.class, ChemicalWasherRecipeCategory.class, ChemicalWasherRecipeWrapper.class);
SolarNeutronRecipeCategory solarNeutronCategory = new SolarNeutronRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(solarNeutronCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(solarNeutronCategory, SolarNeutronRecipeWrapper.class));
addRecipes(registry, Recipe.SOLAR_NEUTRON_ACTIVATOR, solarNeutronCategory, SolarNeutronRecipe.class, SolarNeutronRecipeCategory.class, SolarNeutronRecipeWrapper.class);
ElectrolyticSeparatorRecipeCategory electrolyticSeparatorCategory = new ElectrolyticSeparatorRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(electrolyticSeparatorCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(electrolyticSeparatorCategory, ElectrolyticSeparatorRecipeWrapper.class));
addRecipes(registry, Recipe.ELECTROLYTIC_SEPARATOR, electrolyticSeparatorCategory, SeparatorRecipe.class, ElectrolyticSeparatorRecipeCategory.class, ElectrolyticSeparatorRecipeWrapper.class);
ThermalEvaporationRecipeCategory thermalEvaporationCategory = new ThermalEvaporationRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(thermalEvaporationCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(thermalEvaporationCategory, ThermalEvaporationRecipeWrapper.class));
addRecipes(registry, Recipe.THERMAL_EVAPORATION_PLANT, thermalEvaporationCategory, ThermalEvaporationRecipe.class, ThermalEvaporationRecipeCategory.class, ThermalEvaporationRecipeWrapper.class);
PRCRecipeCategory prcCategory = new PRCRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(prcCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(prcCategory, PRCRecipeWrapper.class));
addRecipes(registry, Recipe.PRESSURIZED_REACTION_CHAMBER, prcCategory, PressurizedRecipe.class, PRCRecipeCategory.class, PRCRecipeWrapper.class);
} catch(Exception e) {
e.printStackTrace();
}
List<RotaryCondensentratorRecipeWrapper> condensentratorRecipes = new ArrayList<RotaryCondensentratorRecipeWrapper>();
RotaryCondensentratorRecipeCategory rotaryCondensentratorCategory = new RotaryCondensentratorRecipeCategory(registry.getJeiHelpers().getGuiHelper());
registry.addRecipeCategories(rotaryCondensentratorCategory);
registry.addRecipeHandlers(new BaseRecipeHandler(rotaryCondensentratorCategory, RotaryCondensentratorRecipeWrapper.class));
for(Gas gas : GasRegistry.getRegisteredGasses())
{
if(gas.hasFluid())
{
condensentratorRecipes.add(new RotaryCondensentratorRecipeWrapper(gas.getFluid(), gas, true, rotaryCondensentratorCategory));
condensentratorRecipes.add(new RotaryCondensentratorRecipeWrapper(gas.getFluid(), gas, false, rotaryCondensentratorCategory));
}
}
registry.addRecipes(condensentratorRecipes);
registry.addRecipeClickArea(GuiEnrichmentChamber.class, 79, 40, 24, 7, "mekanism.enrichment_chamber");
registry.addRecipeClickArea(GuiCrusher.class, 79, 40, 24, 7, "mekanism.crusher");
registry.addRecipeClickArea(GuiCombiner.class, 79, 40, 24, 7, "mekanism.combiner");
registry.addRecipeClickArea(GuiPurificationChamber.class, 79, 40, 24, 7, "mekanism.purification_chamber");
registry.addRecipeClickArea(GuiOsmiumCompressor.class, 79, 40, 24, 7, "mekanism.osmium_compressor");
registry.addRecipeClickArea(GuiChemicalInjectionChamber.class, 79, 40, 24, 7, "mekanism.chemical_injection_chamber");
registry.addRecipeClickArea(GuiPrecisionSawmill.class, 79, 40, 24, 7, "mekanism.precision_sawmill");
registry.addRecipeClickArea(GuiMetallurgicInfuser.class, 72, 47, 32, 8, "mekanism.metallurgic_infuser");
registry.addRecipeClickArea(GuiChemicalCrystallizer.class, 53, 62, 48, 8, "mekanism.chemical_crystallizer");
registry.addRecipeClickArea(GuiChemicalDissolutionChamber.class, 64, 40, 48, 8, "mekanism.chemical_dissolution_chamber");
registry.addRecipeClickArea(GuiChemicalInfuser.class, 47, 39, 28, 8, "mekanism.chemical_infuser");
registry.addRecipeClickArea(GuiChemicalInfuser.class, 101, 39, 28, 8, "mekanism.chemical_infuser");
registry.addRecipeClickArea(GuiChemicalOxidizer.class, 64, 40, 48, 8, "mekanism.chemical_oxidizer");
registry.addRecipeClickArea(GuiChemicalWasher.class, 61, 39, 55, 8, "mekanism.chemical_washer");
registry.addRecipeClickArea(GuiSolarNeutronActivator.class, 64, 39, 48, 8, "mekanism.solar_neutron_activator");
registry.addRecipeClickArea(GuiElectrolyticSeparator.class, 80, 30, 16, 6, "mekanism.electrolytic_separator");
registry.addRecipeClickArea(GuiThermalEvaporationController.class, 49, 20, 78, 38, "mekanism.thermal_evaporation_plant");
registry.addRecipeClickArea(GuiPRC.class, 75, 37, 36, 10, "mekanism.pressurized_reaction_chamber");
registry.addRecipeClickArea(GuiRotaryCondensentrator.class, 64, 39, 48, 8, "mekanism.rotary_condensentrator");
registerRecipeItem(registry, MachineType.ENRICHMENT_CHAMBER);
registerRecipeItem(registry, MachineType.CRUSHER);
registerRecipeItem(registry, MachineType.COMBINER);
registerRecipeItem(registry, MachineType.PURIFICATION_CHAMBER);
registerRecipeItem(registry, MachineType.OSMIUM_COMPRESSOR);
registerRecipeItem(registry, MachineType.CHEMICAL_INJECTION_CHAMBER);
registerRecipeItem(registry, MachineType.PRECISION_SAWMILL);
registerRecipeItem(registry, MachineType.METALLURGIC_INFUSER);
registerRecipeItem(registry, MachineType.CHEMICAL_CRYSTALLIZER);
registerRecipeItem(registry, MachineType.CHEMICAL_DISSOLUTION_CHAMBER);
registerRecipeItem(registry, MachineType.CHEMICAL_INFUSER);
registerRecipeItem(registry, MachineType.CHEMICAL_OXIDIZER);
registerRecipeItem(registry, MachineType.CHEMICAL_WASHER);
registerRecipeItem(registry, MachineType.SOLAR_NEUTRON_ACTIVATOR);
registerRecipeItem(registry, MachineType.ELECTROLYTIC_SEPARATOR);
registerRecipeItem(registry, MachineType.PRESSURIZED_REACTION_CHAMBER);
registerRecipeItem(registry, MachineType.ROTARY_CONDENSENTRATOR);
registry.addRecipeCategoryCraftingItem(BasicBlockType.THERMAL_EVAPORATION_CONTROLLER.getStack(1), "mekanism.thermal_evaporation_plant");
}
private void registerRecipeItem(IModRegistry registry, MachineType type)
{
registry.addRecipeCategoryCraftingItem(type.getStack(), "mekanism." + type.getName());
}
private void registerBasicMachine(IModRegistry registry, Recipe recipe, String unlocalized, ProgressBar bar, Class<? extends MachineRecipeWrapper> wrapper) throws Exception
{
MachineRecipeCategory category = new MachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), recipe.name().toLowerCase(), unlocalized, bar);
registry.addRecipeCategories(category);
registry.addRecipeHandlers(new BaseRecipeHandler(category, wrapper));
addRecipes(registry, recipe, category, BasicMachineRecipe.class, MachineRecipeCategory.class, wrapper);
}
private void registerAdvancedMachine(IModRegistry registry, Recipe recipe, String unlocalized, ProgressBar bar, Class<? extends AdvancedMachineRecipeWrapper> wrapper) throws Exception
{
AdvancedMachineRecipeCategory category = new AdvancedMachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), recipe.name().toLowerCase(), unlocalized, bar);
registry.addRecipeCategories(category);
registry.addRecipeHandlers(new BaseRecipeHandler(category, wrapper));
addRecipes(registry, recipe, category, AdvancedMachineRecipe.class, AdvancedMachineRecipeCategory.class, wrapper);
}
private void registerChanceMachine(IModRegistry registry, Recipe recipe, String unlocalized, ProgressBar bar, Class<? extends ChanceMachineRecipeWrapper> wrapper) throws Exception
{
ChanceMachineRecipeCategory category = new ChanceMachineRecipeCategory(registry.getJeiHelpers().getGuiHelper(), recipe.name().toLowerCase(), unlocalized, bar);
registry.addRecipeCategories(category);
registry.addRecipeHandlers(new BaseRecipeHandler(category, wrapper));
addRecipes(registry, recipe, category, ChanceMachineRecipe.class, ChanceMachineRecipeCategory.class, wrapper);
}
private void addRecipes(IModRegistry registry, Recipe type, IRecipeCategory cat, Class recipe, Class category, Class<? extends IRecipeWrapper> wrapper) throws Exception
{
List<IRecipeWrapper> recipes = new ArrayList<IRecipeWrapper>();
for(Object obj : type.get().values())
{
if(obj instanceof MachineRecipe)
{
recipes.add(wrapper.getConstructor(recipe, category).newInstance(obj, cat));
}
}
registry.addRecipes(recipes);
}
}
@@ -1,41 +0,0 @@
package mekanism.client.jei.crafting;
import mekanism.common.recipe.ShapedMekanismRecipe;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
public class ShapedMekanismRecipeHandler implements IRecipeHandler<ShapedMekanismRecipe>
{
private final IJeiHelpers jeiHelpers;
public ShapedMekanismRecipeHandler(IJeiHelpers helpers)
{
jeiHelpers = helpers;
}
@Override
public Class<ShapedMekanismRecipe> getRecipeClass()
{
return ShapedMekanismRecipe.class;
}
@Override
public IRecipeWrapper getRecipeWrapper(ShapedMekanismRecipe recipe)
{
return new ShapedMekanismRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(ShapedMekanismRecipe recipe)
{
return true;
}
@Override
public String getRecipeCategoryUid(ShapedMekanismRecipe recipe)
{
return VanillaRecipeCategoryUid.CRAFTING;
}
}
@@ -1,60 +0,0 @@
package mekanism.client.jei.crafting;
import java.util.Arrays;
import java.util.List;
import mekanism.common.recipe.ShapedMekanismRecipe;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import mezz.jei.api.recipe.IStackHelper;
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
import net.minecraft.item.ItemStack;
public class ShapedMekanismRecipeWrapper extends BlankRecipeWrapper implements IShapedCraftingRecipeWrapper
{
private final IJeiHelpers jeiHelpers;
private final ShapedMekanismRecipe recipe;
public ShapedMekanismRecipeWrapper(IJeiHelpers helpers, ShapedMekanismRecipe r)
{
jeiHelpers = helpers;
recipe = r;
for(Object input : recipe.getInput())
{
if(input instanceof ItemStack)
{
ItemStack itemStack = (ItemStack)input;
if(itemStack.getCount() != 1)
{
itemStack.setCount(1);
}
}
}
}
@Override
public void getIngredients(IIngredients ingredients)
{
IStackHelper stackHelper = jeiHelpers.getStackHelper();
ItemStack recipeOutput = recipe.getRecipeOutput();
List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(Arrays.asList(recipe.getInput()));
ingredients.setInputLists(ItemStack.class, inputs);
ingredients.setOutput(ItemStack.class, recipeOutput);
}
@Override
public int getWidth()
{
return recipe.width;
}
@Override
public int getHeight()
{
return recipe.height;
}
}
@@ -1,45 +0,0 @@
package mekanism.client.jei.crafting;
import javax.annotation.Nonnull;
import mekanism.common.recipe.ShapelessMekanismRecipe;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
public class ShapelessMekanismRecipeHandler implements IRecipeHandler<ShapelessMekanismRecipe>
{
private final IJeiHelpers jeiHelpers;
public ShapelessMekanismRecipeHandler(IJeiHelpers helpers)
{
jeiHelpers = helpers;
}
@Override
@Nonnull
public Class<ShapelessMekanismRecipe> getRecipeClass()
{
return ShapelessMekanismRecipe.class;
}
@Override
@Nonnull
public IRecipeWrapper getRecipeWrapper(@Nonnull ShapelessMekanismRecipe recipe)
{
return new ShapelessMekanismRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(@Nonnull ShapelessMekanismRecipe recipe)
{
return true;
}
@Override
public String getRecipeCategoryUid(@Nonnull ShapelessMekanismRecipe recipe)
{
return VanillaRecipeCategoryUid.CRAFTING;
}
}
@@ -1,50 +0,0 @@
package mekanism.client.jei.crafting;
import java.util.List;
import mekanism.common.recipe.ShapelessMekanismRecipe;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import mezz.jei.api.recipe.IStackHelper;
import net.minecraft.item.ItemStack;
public class ShapelessMekanismRecipeWrapper extends BlankRecipeWrapper
{
private final IJeiHelpers jeiHelpers;
private final ShapelessMekanismRecipe recipe;
public ShapelessMekanismRecipeWrapper(IJeiHelpers helpers, ShapelessMekanismRecipe r)
{
jeiHelpers = helpers;
recipe = r;
for(Object input : recipe.getInput())
{
if(input instanceof ItemStack)
{
ItemStack itemStack = (ItemStack)input;
if(itemStack.getCount() != 1)
{
itemStack.setCount(1);
}
}
}
}
@Override
public void getIngredients(IIngredients ingredients)
{
IStackHelper stackHelper = jeiHelpers.getStackHelper();
ItemStack recipeOutput = recipe.getRecipeOutput();
List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.getInput());
ingredients.setInputLists(ItemStack.class, inputs);
if(recipeOutput != null)
{
ingredients.setOutput(ItemStack.class, recipeOutput);
}
}
}
@@ -1,230 +0,0 @@
package mekanism.client.jei.gas;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasStack;
import mekanism.common.util.LangUtils;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.ingredients.IIngredientRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fluids.Fluid;
public class GasStackRenderer implements IIngredientRenderer<GasStack>
{
private static final int TEX_WIDTH = 16;
private static final int TEX_HEIGHT = 16;
private static final int MIN_FLUID_HEIGHT = 1; // ensure tiny amounts of gas are still visible
private final int capacityMb;
private final TooltipMode tooltipMode;
private final int width;
private final int height;
@Nullable
private final IDrawable overlay;
enum TooltipMode
{
SHOW_AMOUNT,
SHOW_AMOUNT_AND_CAPACITY,
ITEM_LIST
}
public GasStackRenderer()
{
this(Fluid.BUCKET_VOLUME, TooltipMode.ITEM_LIST, TEX_WIDTH, TEX_HEIGHT, null);
}
public GasStackRenderer(int capacityMb, boolean showCapacity, int width, int height, @Nullable IDrawable overlay)
{
this(capacityMb, showCapacity ? TooltipMode.SHOW_AMOUNT_AND_CAPACITY : TooltipMode.SHOW_AMOUNT, width, height, overlay);
}
public GasStackRenderer(int capacityMb, TooltipMode tooltipMode, int width, int height, @Nullable IDrawable overlay)
{
this.capacityMb = capacityMb;
this.tooltipMode = tooltipMode;
this.width = width;
this.height = height;
this.overlay = overlay;
}
@Override
public void render(Minecraft minecraft, final int xPosition, final int yPosition, @Nullable GasStack gasStack)
{
GlStateManager.enableBlend();
GlStateManager.enableAlpha();
drawGas(minecraft, xPosition, yPosition, gasStack);
GlStateManager.color(1, 1, 1, 1);
if(overlay != null)
{
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, 200);
overlay.draw(minecraft, xPosition, yPosition);
GlStateManager.popMatrix();
}
GlStateManager.disableAlpha();
GlStateManager.disableBlend();
}
private void drawGas(Minecraft minecraft, final int xPosition, final int yPosition, @Nullable GasStack gasStack)
{
if(gasStack == null)
{
return;
}
Gas gas = gasStack.getGas();
if(gas == null)
{
return;
}
TextureAtlasSprite gasStillSprite = getStillGasSprite(minecraft, gas);
int gasColor = 0xFFFFFFFF;
int scaledAmount = (gasStack.amount * height) / capacityMb;
if(gasStack.amount > 0 && scaledAmount < MIN_FLUID_HEIGHT)
{
scaledAmount = MIN_FLUID_HEIGHT;
}
if(scaledAmount > height)
{
scaledAmount = height;
}
drawTiledSprite(minecraft, xPosition, yPosition, width, height, gasColor, scaledAmount, gasStillSprite);
}
private void drawTiledSprite(Minecraft minecraft, final int xPosition, final int yPosition, final int tiledWidth, final int tiledHeight, int color, int scaledAmount, TextureAtlasSprite sprite)
{
minecraft.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
setGLColorFromInt(color);
final int xTileCount = tiledWidth / TEX_WIDTH;
final int xRemainder = tiledWidth - (xTileCount * TEX_WIDTH);
final int yTileCount = scaledAmount / TEX_HEIGHT;
final int yRemainder = scaledAmount - (yTileCount * TEX_HEIGHT);
final int yStart = yPosition + tiledHeight;
for(int xTile = 0; xTile <= xTileCount; xTile++)
{
for(int yTile = 0; yTile <= yTileCount; yTile++)
{
int width = (xTile == xTileCount) ? xRemainder : TEX_WIDTH;
int height = (yTile == yTileCount) ? yRemainder : TEX_HEIGHT;
int x = xPosition + (xTile * TEX_WIDTH);
int y = yStart - ((yTile + 1) * TEX_HEIGHT);
if(width > 0 && height > 0)
{
int maskTop = TEX_HEIGHT - height;
int maskRight = TEX_WIDTH - width;
drawTextureWithMasking(x, y, sprite, maskTop, maskRight, 100);
}
}
}
}
private static TextureAtlasSprite getStillGasSprite(Minecraft minecraft, Gas gas)
{
TextureMap textureMapBlocks = minecraft.getTextureMapBlocks();
ResourceLocation gasStill = gas.getIcon();
TextureAtlasSprite gasStillSprite = null;
if(gasStill != null)
{
gasStillSprite = textureMapBlocks.getTextureExtry(gasStill.toString());
}
if(gasStillSprite == null)
{
gasStillSprite = textureMapBlocks.getMissingSprite();
}
return gasStillSprite;
}
private static void setGLColorFromInt(int color)
{
float red = (color >> 16 & 0xFF) / 255.0F;
float green = (color >> 8 & 0xFF) / 255.0F;
float blue = (color & 0xFF) / 255.0F;
GlStateManager.color(red, green, blue, 1.0F);
}
private static void drawTextureWithMasking(double xCoord, double yCoord, TextureAtlasSprite textureSprite, int maskTop, int maskRight, double zLevel)
{
double uMin = (double) textureSprite.getMinU();
double uMax = (double) textureSprite.getMaxU();
double vMin = (double) textureSprite.getMinV();
double vMax = (double) textureSprite.getMaxV();
uMax = uMax - (maskRight / 16.0 * (uMax - uMin));
vMax = vMax - (maskTop / 16.0 * (vMax - vMin));
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder vertexBuffer = tessellator.getBuffer();
vertexBuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
vertexBuffer.pos(xCoord, yCoord + 16, zLevel).tex(uMin, vMax).endVertex();
vertexBuffer.pos(xCoord + 16 - maskRight, yCoord + 16, zLevel).tex(uMax, vMax).endVertex();
vertexBuffer.pos(xCoord + 16 - maskRight, yCoord + maskTop, zLevel).tex(uMax, vMin).endVertex();
vertexBuffer.pos(xCoord, yCoord + maskTop, zLevel).tex(uMin, vMin).endVertex();
tessellator.draw();
}
@Override
public List<String> getTooltip(Minecraft minecraft, GasStack gasStack)
{
List<String> tooltip = new ArrayList<String>();
Gas gasType = gasStack.getGas();
if(gasType == null)
{
return tooltip;
}
String gasName = gasType.getLocalizedName();
tooltip.add(gasName);
if(tooltipMode == TooltipMode.SHOW_AMOUNT_AND_CAPACITY)
{
String amount = LangUtils.localizeWithFormat("jei.tooltip.liquid.amount.with.capacity", gasStack.amount, capacityMb);
tooltip.add(TextFormatting.GRAY + amount);
}
else if (tooltipMode == TooltipMode.SHOW_AMOUNT)
{
String amount = LangUtils.localizeWithFormat("jei.tooltip.liquid.amount", gasStack.amount);
tooltip.add(TextFormatting.GRAY + amount);
}
return tooltip;
}
@Override
public FontRenderer getFontRenderer(Minecraft minecraft, GasStack gasStack) {
return minecraft.fontRenderer;
}
}
@@ -1,117 +0,0 @@
package mekanism.client.jei.machine;
import java.util.List;
import mekanism.api.gas.GasStack;
import mekanism.client.gui.element.GuiPowerBar;
import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler;
import mekanism.client.gui.element.GuiProgress;
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.element.GuiProgress.ProgressBar;
import mekanism.client.gui.element.GuiSlot;
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.inputs.AdvancedMachineInput;
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
import mekanism.common.recipe.outputs.ItemStackOutput;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
public class AdvancedMachineRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public String recipeName;
public String unlocalizedName;
public IDrawable background;
public AdvancedMachineRecipe tempRecipe;
public ITickTimer timer;
public AdvancedMachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress)
{
super("mekanism:gui/GuiAdvancedMachine.png", name, unlocalized, progress);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), 28, 16, 144, 54);
}
@Override
public void addGuiElements()
{
guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 30, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 55, 52));
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 111, 30));
guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() {
@Override
public double getLevel()
{
return 1F;
}
}, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 164, 15));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return (double)timer.getValue() / 20F;
}
}, progressBar, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 77, 37));
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
AdvancedMachineInput input = (AdvancedMachineInput)tempRecipe.getInput();
if(input.gasType != null)
{
displayGauge(33, 21, 6, 12, new GasStack(input.gasType, 1));
}
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof AdvancedMachineRecipeWrapper)
{
tempRecipe = ((AdvancedMachineRecipeWrapper)recipeWrapper).recipe;
}
AdvancedMachineInput input = (AdvancedMachineInput)tempRecipe.recipeInput;
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 27, 0);
itemStacks.init(1, false, 87, 18);
itemStacks.init(2, false, 27, 36);
itemStacks.set(0, input.itemStack);
itemStacks.set(1, ((ItemStackOutput)tempRecipe.recipeOutput).output);
itemStacks.set(2, ((AdvancedMachineRecipeWrapper)recipeWrapper).getFuelStacks(input.gasType));
}
}
@@ -1,55 +0,0 @@
package mekanism.client.jei.machine;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.Gas;
import mekanism.common.recipe.inputs.AdvancedMachineInput;
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
import mekanism.common.recipe.outputs.ItemStackOutput;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.item.ItemStack;
public abstract class AdvancedMachineRecipeWrapper extends BaseRecipeWrapper
{
public AdvancedMachineRecipe recipe;
public AdvancedMachineRecipeCategory category;
public AdvancedMachineRecipeWrapper(AdvancedMachineRecipe r, AdvancedMachineRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInput(ItemStack.class, ((AdvancedMachineInput)recipe.getInput()).itemStack);
ingredients.setOutput(ItemStack.class, ((ItemStackOutput)recipe.getOutput()).output);
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
if(mouseX >= 33 && mouseX <= 39 && mouseY >= 22 && mouseY <= 34)
{
currenttip.add(((AdvancedMachineInput)recipe.getInput()).gasType.getLocalizedName());
}
return currenttip;
}
@Override
public AdvancedMachineRecipeCategory getCategory()
{
return category;
}
public abstract List<ItemStack> getFuelStacks(Gas gasType);
}
@@ -1,46 +0,0 @@
package mekanism.client.jei.machine;
import javax.annotation.Nonnull;
import mekanism.client.jei.BaseRecipeCategory;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
public class BaseRecipeHandler<CATEGORY extends BaseRecipeCategory, WRAPPER extends BaseRecipeWrapper> implements IRecipeHandler<WRAPPER>
{
private final CATEGORY category;
public Class<WRAPPER> wrapperClass;
public BaseRecipeHandler(CATEGORY c, Class<WRAPPER> wrapper)
{
category = c;
wrapperClass = wrapper;
}
@Override
public Class<WRAPPER> getRecipeClass()
{
return wrapperClass;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull WRAPPER recipe)
{
return recipe;
}
@Override
public boolean isRecipeValid(@Nonnull WRAPPER recipe)
{
return recipe.getCategory() == category;
}
@Override
public String getRecipeCategoryUid(@Nonnull WRAPPER recipe)
{
return category.getUid();
}
}
@@ -1,9 +0,0 @@
package mekanism.client.jei.machine;
import mekanism.client.jei.BaseRecipeCategory;
import mezz.jei.api.recipe.BlankRecipeWrapper;
public abstract class BaseRecipeWrapper extends BlankRecipeWrapper
{
public abstract BaseRecipeCategory getCategory();
}
@@ -1,107 +0,0 @@
package mekanism.client.jei.machine;
import java.util.List;
import mekanism.client.gui.element.GuiPowerBar;
import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler;
import mekanism.client.gui.element.GuiProgress;
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.element.GuiProgress.ProgressBar;
import mekanism.client.gui.element.GuiSlot;
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.inputs.ItemStackInput;
import mekanism.common.recipe.machines.ChanceMachineRecipe;
import mekanism.common.recipe.outputs.ChanceOutput;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.util.ResourceLocation;
public class ChanceMachineRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public ChanceMachineRecipe tempRecipe;
public ITickTimer timer;
public ChanceMachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress)
{
super("mekanism:gui/GuiBasicMachine.png", name, unlocalized, progress);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), 28, 16, 144, 54);
}
@Override
public void addGuiElements()
{
guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 55, 52).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT_WIDE, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 111, 30));
guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() {
@Override
public double getLevel()
{
return 1F;
}
}, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 164, 15));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return (double)timer.getValue() / 20F;
}
}, progressBar, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 77, 37));
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof ChanceMachineRecipeWrapper)
{
tempRecipe = ((ChanceMachineRecipeWrapper)recipeWrapper).recipe;
}
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 27, 0);
itemStacks.init(1, false, 87, 18);
itemStacks.init(2, false, 103, 18);
itemStacks.set(0, ((ItemStackInput)tempRecipe.recipeInput).ingredient);
ChanceOutput output = (ChanceOutput)tempRecipe.getOutput();
if(output.hasPrimary())
{
itemStacks.set(1, output.primaryOutput);
}
if(output.hasSecondary())
{
itemStacks.set(2, output.secondaryOutput);
}
}
}
@@ -1,52 +0,0 @@
package mekanism.client.jei.machine;
import java.util.Arrays;
import javax.annotation.Nonnull;
import mekanism.common.recipe.inputs.ItemStackInput;
import mekanism.common.recipe.machines.ChanceMachineRecipe;
import mekanism.common.recipe.outputs.ChanceOutput;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.item.ItemStack;
public class ChanceMachineRecipeWrapper extends BaseRecipeWrapper
{
public ChanceMachineRecipe recipe;
public ChanceMachineRecipeCategory category;
public ChanceMachineRecipeWrapper(ChanceMachineRecipe r, ChanceMachineRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ChanceOutput output = (ChanceOutput)recipe.getOutput();
ingredients.setInput(ItemStack.class, ((ItemStackInput)recipe.getInput()).ingredient);
ingredients.setOutputs(ItemStack.class, Arrays.asList(output.primaryOutput, output.secondaryOutput));
}
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
{
ChanceOutput output = (ChanceOutput)recipe.getOutput();
if(output.hasSecondary())
{
FontRenderer fontRenderer = minecraft.fontRenderer;
fontRenderer.drawString(Math.round(output.secondaryChance*100) + "%", 104, 41, 0x404040, false);
}
}
@Override
public ChanceMachineRecipeCategory getCategory()
{
return category;
}
}
@@ -1,93 +0,0 @@
package mekanism.client.jei.machine;
import java.util.List;
import mekanism.client.gui.element.GuiPowerBar;
import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler;
import mekanism.client.gui.element.GuiProgress;
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.element.GuiProgress.ProgressBar;
import mekanism.client.gui.element.GuiSlot;
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.machines.BasicMachineRecipe;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
public class MachineRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public BasicMachineRecipe tempRecipe;
public ITickTimer timer;
public MachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress)
{
super("mekanism:gui/GuiBasicMachine.png", name, unlocalized, progress);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), 28, 16, 144, 54);
}
@Override
public void addGuiElements()
{
guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 55, 52).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 111, 30));
guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() {
@Override
public double getLevel()
{
return 1F;
}
}, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 164, 15));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return (double)timer.getValue() / 20F;
}
}, progressBar, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 77, 37));
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof MachineRecipeWrapper)
{
tempRecipe = ((MachineRecipeWrapper)recipeWrapper).recipe;
}
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 27, 0);
itemStacks.init(1, false, 87, 18);
itemStacks.set(ingredients);
}
}
@@ -1,33 +0,0 @@
package mekanism.client.jei.machine;
import mekanism.common.recipe.inputs.ItemStackInput;
import mekanism.common.recipe.machines.BasicMachineRecipe;
import mekanism.common.recipe.outputs.ItemStackOutput;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.item.ItemStack;
public class MachineRecipeWrapper extends BaseRecipeWrapper
{
public BasicMachineRecipe recipe;
public MachineRecipeCategory category;
public MachineRecipeWrapper(BasicMachineRecipe r, MachineRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInput(ItemStack.class, ((ItemStackInput)recipe.getInput()).ingredient);
ingredients.setOutput(ItemStack.class, ((ItemStackOutput)recipe.getOutput()).output);
}
@Override
public MachineRecipeCategory getCategory()
{
return category;
}
}
@@ -1,51 +0,0 @@
package mekanism.client.jei.machine.advanced;
import java.util.ArrayList;
import java.util.List;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasRegistry;
import mekanism.client.jei.machine.AdvancedMachineRecipeCategory;
import mekanism.client.jei.machine.AdvancedMachineRecipeWrapper;
import mekanism.common.MekanismFluids;
import mekanism.common.Tier.GasTankTier;
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
import mekanism.common.util.ListUtils;
import mekanism.common.util.MekanismUtils;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class ChemicalInjectionChamberRecipeWrapper extends AdvancedMachineRecipeWrapper
{
public ChemicalInjectionChamberRecipeWrapper(AdvancedMachineRecipe r, AdvancedMachineRecipeCategory c)
{
super(r, c);
}
@Override
public List<ItemStack> getFuelStacks(Gas gasType)
{
if(gasType == MekanismFluids.SulfuricAcid)
{
List<ItemStack> fuels = new ArrayList<ItemStack>();
fuels.addAll(OreDictionary.getOres("dustSulfur"));
fuels.add(MekanismUtils.getFullGasTank(GasTankTier.BASIC, MekanismFluids.SulfuricAcid));
return fuels;
}
else if(gasType == MekanismFluids.Water)
{
return ListUtils.asList(MekanismUtils.getFullGasTank(GasTankTier.BASIC, MekanismFluids.Water));
}
else if(gasType == MekanismFluids.HydrogenChloride)
{
List<ItemStack> fuels = new ArrayList<ItemStack>();
fuels.addAll(OreDictionary.getOres("dustSalt"));
fuels.add(MekanismUtils.getFullGasTank(GasTankTier.BASIC, MekanismFluids.HydrogenChloride));
return fuels;
}
return new ArrayList<ItemStack>();
}
}
@@ -1,25 +0,0 @@
package mekanism.client.jei.machine.advanced;
import java.util.List;
import mekanism.api.gas.Gas;
import mekanism.client.jei.machine.AdvancedMachineRecipeCategory;
import mekanism.client.jei.machine.AdvancedMachineRecipeWrapper;
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
import mekanism.common.util.ListUtils;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
public class CombinerRecipeWrapper extends AdvancedMachineRecipeWrapper
{
public CombinerRecipeWrapper(AdvancedMachineRecipe r, AdvancedMachineRecipeCategory c)
{
super(r, c);
}
@Override
public List<ItemStack> getFuelStacks(Gas gasType)
{
return ListUtils.asList(new ItemStack(Blocks.COBBLESTONE));
}
}
@@ -1,26 +0,0 @@
package mekanism.client.jei.machine.advanced;
import java.util.List;
import mekanism.api.gas.Gas;
import mekanism.client.jei.machine.AdvancedMachineRecipeCategory;
import mekanism.client.jei.machine.AdvancedMachineRecipeWrapper;
import mekanism.common.MekanismItems;
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
import mekanism.common.util.ListUtils;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.item.ItemStack;
public class OsmiumCompressorRecipeWrapper extends AdvancedMachineRecipeWrapper
{
public OsmiumCompressorRecipeWrapper(AdvancedMachineRecipe r, AdvancedMachineRecipeCategory c)
{
super(r, c);
}
@Override
public List<ItemStack> getFuelStacks(Gas gasType)
{
return ListUtils.asList(new ItemStack(MekanismItems.Ingot, 1, 1));
}
}
@@ -1,34 +0,0 @@
package mekanism.client.jei.machine.advanced;
import java.util.ArrayList;
import java.util.List;
import mekanism.api.gas.Gas;
import mekanism.client.jei.machine.AdvancedMachineRecipeCategory;
import mekanism.client.jei.machine.AdvancedMachineRecipeWrapper;
import mekanism.common.MekanismFluids;
import mekanism.common.Tier.GasTankTier;
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
import mekanism.common.util.ListUtils;
import mekanism.common.util.MekanismUtils;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class PurificationChamberRecipeWrapper extends AdvancedMachineRecipeWrapper
{
public PurificationChamberRecipeWrapper(AdvancedMachineRecipe r, AdvancedMachineRecipeCategory c)
{
super(r, c);
}
@Override
public List<ItemStack> getFuelStacks(Gas gasType)
{
if(gasType == MekanismFluids.Oxygen)
{
return ListUtils.asList(new ItemStack(Items.FLINT), MekanismUtils.getFullGasTank(GasTankTier.BASIC, MekanismFluids.Oxygen));
}
return new ArrayList<ItemStack>();
}
}
@@ -1,13 +0,0 @@
package mekanism.client.jei.machine.basic;
import mekanism.client.jei.machine.MachineRecipeCategory;
import mekanism.client.jei.machine.MachineRecipeWrapper;
import mekanism.common.recipe.machines.BasicMachineRecipe;
public class CrusherRecipeWrapper extends MachineRecipeWrapper
{
public CrusherRecipeWrapper(BasicMachineRecipe r, MachineRecipeCategory c)
{
super(r, c);
}
}
@@ -1,13 +0,0 @@
package mekanism.client.jei.machine.basic;
import mekanism.client.jei.machine.MachineRecipeCategory;
import mekanism.client.jei.machine.MachineRecipeWrapper;
import mekanism.common.recipe.machines.BasicMachineRecipe;
public class EnrichmentRecipeWrapper extends MachineRecipeWrapper
{
public EnrichmentRecipeWrapper(BasicMachineRecipe r, MachineRecipeCategory c)
{
super(r, c);
}
}
@@ -1,13 +0,0 @@
package mekanism.client.jei.machine.chance;
import mekanism.client.jei.machine.ChanceMachineRecipeCategory;
import mekanism.client.jei.machine.ChanceMachineRecipeWrapper;
import mekanism.common.recipe.machines.ChanceMachineRecipe;
public class PrecisionSawmillRecipeWrapper extends ChanceMachineRecipeWrapper
{
public PrecisionSawmillRecipeWrapper(ChanceMachineRecipe r, ChanceMachineRecipeCategory c)
{
super(r, c);
}
}
@@ -1,76 +0,0 @@
package mekanism.client.jei.machine.chemical;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.machines.CrystallizerRecipe;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
public class ChemicalCrystallizerRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public CrystallizerRecipe tempRecipe;
public ITickTimer timer;
public ChemicalCrystallizerRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/nei/GuiChemicalCrystallizer.png", "chemical_crystallizer", "tile.MachineBlock2.ChemicalCrystallizer.name", null);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 5;
yOffset = 3;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 147, 79);
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
GasStack gas = tempRecipe.getInput().ingredient;
float f = (float)timer.getValue() / 20F;
drawTexturedRect(53-xOffset, 61-yOffset, 176, 63, (int)(48*f), 8);
if(gas != null)
{
displayGauge(58, 6-xOffset, 5-yOffset, 176, 4, 58, null, gas);
}
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof ChemicalCrystallizerRecipeWrapper)
{
tempRecipe = ((ChemicalCrystallizerRecipeWrapper)recipeWrapper).recipe;
}
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, false, 130-xOffset, 56-yOffset);
itemStacks.set(0, tempRecipe.getOutput().output);
}
}
@@ -1,53 +0,0 @@
package mekanism.client.jei.machine.chemical;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.CrystallizerRecipe;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.item.ItemStack;
public class ChemicalCrystallizerRecipeWrapper extends BaseRecipeWrapper
{
public CrystallizerRecipe recipe;
public ChemicalCrystallizerRecipeCategory category;
public ChemicalCrystallizerRecipeWrapper(CrystallizerRecipe r, ChemicalCrystallizerRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInput(GasStack.class, recipe.recipeInput.ingredient);
ingredients.setOutput(ItemStack.class, recipe.recipeOutput.output);
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
if(mouseX >= 1 && mouseX <= 17 && mouseY >= 5-3 && mouseY <= 63-3)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getInput().ingredient));
}
return currenttip;
}
@Override
public ChemicalCrystallizerRecipeCategory getCategory()
{
return category;
}
}
@@ -1,79 +0,0 @@
package mekanism.client.jei.machine.chemical;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.MekanismFluids;
import mekanism.common.recipe.machines.DissolutionRecipe;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
public class ChemicalDissolutionChamberRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public DissolutionRecipe tempRecipe;
public ITickTimer timer;
public ChemicalDissolutionChamberRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/nei/GuiChemicalDissolutionChamber.png", "chemical_dissolution_chamber", "gui.chemicalDissolutionChamber.short", null);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 3;
yOffset = 3;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 170, 79);
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
GasStack gas = tempRecipe.getOutput().output;
float f = (float)timer.getValue() / 20F;
drawTexturedRect(64-xOffset, 40-yOffset, 176, 63, (int)(48*f), 8);
displayGauge(58, 6-xOffset, 5-yOffset, 176, 4, 58, null, new GasStack(MekanismFluids.SulfuricAcid, 1));
if(gas != null)
{
displayGauge(58, 134-xOffset, 14-yOffset, 176, 4, 58, null, gas);
}
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof ChemicalDissolutionChamberRecipeWrapper)
{
tempRecipe = ((ChemicalDissolutionChamberRecipeWrapper)recipeWrapper).recipe;
}
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 25-xOffset, 35-yOffset);
itemStacks.set(0, tempRecipe.getInput().ingredient);
}
}
@@ -1,59 +0,0 @@
package mekanism.client.jei.machine.chemical;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.MekanismFluids;
import mekanism.common.recipe.machines.DissolutionRecipe;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.item.ItemStack;
public class ChemicalDissolutionChamberRecipeWrapper extends BaseRecipeWrapper
{
public DissolutionRecipe recipe;
public ChemicalDissolutionChamberRecipeCategory category;
public ChemicalDissolutionChamberRecipeWrapper(DissolutionRecipe r, ChemicalDissolutionChamberRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInput(GasStack.class, new GasStack(MekanismFluids.SulfuricAcid, 1000));
ingredients.setInput(ItemStack.class, recipe.recipeInput.ingredient);
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
if(mouseX >= 6-3 && mouseX <= 22-3 && mouseY >= 5-3 && mouseY <= 63-3)
{
currenttip.add(MekanismFluids.SulfuricAcid.getLocalizedName());
}
else if(mouseX >= 134-3 && mouseX <= 150-3 && mouseY >= 14-3 && mouseY <= 72-3)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getOutput().output));
}
return currenttip;
}
@Override
public ChemicalDissolutionChamberRecipeCategory getCategory()
{
return category;
}
}
@@ -1,76 +0,0 @@
package mekanism.client.jei.machine.chemical;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.machines.ChemicalInfuserRecipe;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
public class ChemicalInfuserRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public ChemicalInfuserRecipe tempRecipe;
public ITickTimer timer;
public ChemicalInfuserRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/nei/GuiChemicalInfuser.png", "chemical_infuser", "tile.MachineBlock2.ChemicalInfuser.name", null);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 3;
yOffset = 3;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 170, 80);
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
drawTexturedRect(47-xOffset, 39-yOffset, 176, 71, 28, 8);
drawTexturedRect(101-xOffset, 39-yOffset, 176, 63, 28, 8);
if(tempRecipe.getInput().leftGas != null)
{
displayGauge(58, 26-xOffset, 14-yOffset, 176, 4, 58, null, tempRecipe.getInput().leftGas);
}
if(tempRecipe.getOutput().output != null)
{
displayGauge(58, 80-xOffset, 5-yOffset, 176, 4, 58, null, tempRecipe.getOutput().output);
}
if(tempRecipe.getInput().rightGas != null)
{
displayGauge(58, 134-xOffset, 14-yOffset, 176, 4, 58, null, tempRecipe.getInput().rightGas);
}
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof ChemicalInfuserRecipeWrapper)
{
tempRecipe = ((ChemicalInfuserRecipeWrapper)recipeWrapper).recipe;
}
}
}
@@ -1,61 +0,0 @@
package mekanism.client.jei.machine.chemical;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.ChemicalInfuserRecipe;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
public class ChemicalInfuserRecipeWrapper extends BaseRecipeWrapper
{
public ChemicalInfuserRecipe recipe;
public ChemicalInfuserRecipeCategory category;
public ChemicalInfuserRecipeWrapper(ChemicalInfuserRecipe r, ChemicalInfuserRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInputs(GasStack.class, Arrays.asList(recipe.recipeInput.leftGas, recipe.recipeInput.rightGas));
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
if(mouseX >= 26-3 && mouseX <= 42-3 && mouseY >= 14-3 && mouseY <= 72-3)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getInput().leftGas));
}
else if(mouseX >= 80-3 && mouseX <= 96-3 && mouseY >= 5-3 && mouseY <= 63-3)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getOutput().output));
}
else if(mouseX >= 134-3 && mouseX <= 150-3 && mouseY >= 14-3 && mouseY <= 72-3)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getInput().rightGas));
}
return currenttip;
}
@Override
public ChemicalInfuserRecipeCategory getCategory()
{
return category;
}
}
@@ -1,98 +0,0 @@
package mekanism.client.jei.machine.chemical;
import mekanism.client.gui.element.GuiGasGauge;
import mekanism.client.gui.element.GuiGauge;
import mekanism.client.gui.element.GuiProgress;
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.element.GuiProgress.ProgressBar;
import mekanism.client.gui.element.GuiSlot;
import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.machines.OxidationRecipe;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
public class ChemicalOxidizerRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public OxidationRecipe tempRecipe;
public GuiGasGauge gasOutput;
public ITickTimer timer;
public ChemicalOxidizerRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/GuiChemicalOxidizer.png", "chemical_oxidizer", "tile.MachineBlock2.ChemicalOxidizer.name", ProgressBar.LARGE_RIGHT);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 20;
yOffset = 12;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 132, 62);
}
@Override
public void addGuiElements()
{
guiElements.add(gasOutput = GuiGasGauge.getDummy(GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 133, 13));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 25, 35));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return (double)timer.getValue() / 20F;
}
}, progressBar, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 62, 39));
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
if(tempRecipe.getOutput().output != null)
{
gasOutput.setDummyType(tempRecipe.getOutput().output.getGas());
gasOutput.renderScale(0, 0, -xOffset, -yOffset);
}
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof ChemicalOxidizerRecipeWrapper)
{
tempRecipe = ((ChemicalOxidizerRecipeWrapper)recipeWrapper).recipe;
}
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 25-xOffset, 35-yOffset);
itemStacks.set(0, tempRecipe.getInput().ingredient);
}
}
@@ -1,53 +0,0 @@
package mekanism.client.jei.machine.chemical;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.OxidationRecipe;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.item.ItemStack;
public class ChemicalOxidizerRecipeWrapper extends BaseRecipeWrapper
{
public OxidationRecipe recipe;
public ChemicalOxidizerRecipeCategory category;
public ChemicalOxidizerRecipeWrapper(OxidationRecipe r, ChemicalOxidizerRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInput(ItemStack.class, recipe.recipeInput.ingredient);
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
if(mouseX >= 134-20 && mouseX <= 150-20 && mouseY >= 14-12 && mouseY <= 72-12)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getOutput().output));
}
return currenttip;
}
@Override
public ChemicalOxidizerRecipeCategory getCategory()
{
return category;
}
}
@@ -1,90 +0,0 @@
package mekanism.client.jei.machine.chemical;
import java.util.List;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.machines.WasherRecipe;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiFluidStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.gui.ITooltipCallback;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
public class ChemicalWasherRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public IDrawable fluidOverlay;
public WasherRecipe tempRecipe;
public ITickTimer timer;
public ChemicalWasherRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/nei/GuiChemicalWasher.png", "chemical_washer", "tile.MachineBlock2.ChemicalWasher.name", null);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 3;
yOffset = 3;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 170, 70);
fluidOverlay = guiHelper.createDrawable(new ResourceLocation(guiTexture), 176, 4, 16, 59);
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
drawTexturedRect(61-xOffset, 39-yOffset, 176, 63, 55, 8);
if(tempRecipe.getInput().ingredient != null)
{
displayGauge(58, 27-xOffset, 14-yOffset, 176, 4, 58, null, tempRecipe.getInput().ingredient);
}
if(tempRecipe.getOutput().output != null)
{
displayGauge(58, 134-xOffset, 14-yOffset, 176, 4, 58, null, tempRecipe.getOutput().output);
}
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof ChemicalWasherRecipeWrapper)
{
tempRecipe = ((ChemicalWasherRecipeWrapper)recipeWrapper).recipe;
}
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(0, true, 6-xOffset, 5-yOffset, 16, 58, 1000, false, fluidOverlay);
fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0));
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
@Override
public void onTooltip(int slotIndex, boolean input, FluidStack ingredient, List<String> tooltip)
{
tooltip.remove(1);
}
});
}
}
@@ -1,59 +0,0 @@
package mekanism.client.jei.machine.chemical;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.WasherRecipe;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
public class ChemicalWasherRecipeWrapper extends BaseRecipeWrapper
{
public WasherRecipe recipe;
public ChemicalWasherRecipeCategory category;
public ChemicalWasherRecipeWrapper(WasherRecipe r, ChemicalWasherRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInput(FluidStack.class, new FluidStack(FluidRegistry.WATER, 1000));
ingredients.setInput(GasStack.class, recipe.recipeInput.ingredient);
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
if(mouseX >= 27-3 && mouseX <= 43-3 && mouseY >= 14-3 && mouseY <= 72-3)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getInput().ingredient));
}
else if(mouseX >= 134-3 && mouseX <= 150-3 && mouseY >= 14-3 && mouseY <= 72-3)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getOutput().output));
}
return currenttip;
}
@Override
public ChemicalWasherRecipeCategory getCategory()
{
return category;
}
}
@@ -1,138 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.ArrayList;
import java.util.List;
import mekanism.client.gui.element.GuiFluidGauge;
import mekanism.client.gui.element.GuiGasGauge;
import mekanism.client.gui.element.GuiGauge;
import mekanism.client.gui.element.GuiPowerBar;
import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler;
import mekanism.client.gui.element.GuiProgress;
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.element.GuiProgress.ProgressBar;
import mekanism.client.gui.element.GuiSlot;
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.machines.SeparatorRecipe;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiFluidStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.gui.ITooltipCallback;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
public class ElectrolyticSeparatorRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public IDrawable fluidOverlay;
public GuiGasGauge leftGas;
public GuiGasGauge rightGas;
public SeparatorRecipe tempRecipe;
public ITickTimer timer;
public ElectrolyticSeparatorRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/GuiElectrolyticSeparator.png", "electrolytic_separator", "tile.MachineBlock2.ElectrolyticSeparator.name", ProgressBar.BI);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 4;
yOffset = 9;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 167, 62);
fluidOverlay = guiHelper.createDrawable(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, GuiGauge.Type.STANDARD.textureLocation), 19, 1, 16, 59);
}
@Override
public void addGuiElements()
{
guiElements.add(GuiFluidGauge.getDummy(GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 5, 10));
guiElements.add(leftGas = GuiGasGauge.getDummy(GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 18));
guiElements.add(rightGas = GuiGasGauge.getDummy(GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 18));
guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() {
@Override
public double getLevel()
{
return 1F;
}
}, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 164, 15));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 25, 34));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 51));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 51));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return 1;
}
}, progressBar, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 78, 29));
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
if(tempRecipe.getOutput().leftGas != null)
{
leftGas.setDummyType(tempRecipe.getOutput().leftGas.getGas());
leftGas.renderScale(0, 0, -xOffset, -yOffset);
}
if(tempRecipe.getOutput().rightGas != null)
{
rightGas.setDummyType(tempRecipe.getOutput().rightGas.getGas());
rightGas.renderScale(0, 0, -xOffset, -yOffset);
}
changeTexture(guiLocation);
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof ElectrolyticSeparatorRecipeWrapper)
{
tempRecipe = ((ElectrolyticSeparatorRecipeWrapper)recipeWrapper).recipe;
}
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(0, true, 2, 2, 16, 58, tempRecipe.getInput().ingredient.amount, false, fluidOverlay);
fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0));
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
@Override
public void onTooltip(int slotIndex, boolean input, FluidStack ingredient, List<String> tooltip)
{
tooltip.remove(1);
}
});
}
}
@@ -1,57 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.SeparatorRecipe;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraftforge.fluids.FluidStack;
public class ElectrolyticSeparatorRecipeWrapper extends BaseRecipeWrapper
{
public SeparatorRecipe recipe;
public ElectrolyticSeparatorRecipeCategory category;
public ElectrolyticSeparatorRecipeWrapper(SeparatorRecipe r, ElectrolyticSeparatorRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInput(FluidStack.class, recipe.recipeInput.ingredient);
ingredients.setOutputs(GasStack.class, Arrays.asList(recipe.recipeOutput.leftGas, recipe.recipeOutput.rightGas));
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
if(mouseX >= 59-4 && mouseX <= 75-4 && mouseY >= 19-9 && mouseY <= 47-9)
{
currenttip.add(recipe.getOutput().leftGas.getGas().getLocalizedName());
}
else if(mouseX >= 101-4 && mouseX <= 117-4 && mouseY >= 19-9 && mouseY <= 47-9)
{
currenttip.add(recipe.getOutput().rightGas.getGas().getLocalizedName());
}
return currenttip;
}
@Override
public ElectrolyticSeparatorRecipeCategory getCategory()
{
return category;
}
}
@@ -1,131 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import mekanism.api.infuse.InfuseObject;
import mekanism.api.infuse.InfuseRegistry;
import mekanism.api.infuse.InfuseType;
import mekanism.client.gui.element.GuiPowerBar;
import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler;
import mekanism.client.gui.element.GuiProgress;
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.element.GuiProgress.ProgressBar;
import mekanism.client.gui.element.GuiSlot;
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
public class MetallurgicInfuserRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public MetallurgicInfuserRecipe tempRecipe;
public ITickTimer timer;
public MetallurgicInfuserRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/GuiMetallurgicInfuser.png", "metallurgic_infuser", "tile.MachineBlock.MetallurgicInfuser.name", ProgressBar.MEDIUM);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 5;
yOffset = 16;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 166, 54);
}
@Override
public void addGuiElements()
{
guiElements.add(new GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 16, 34));
guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 50, 42));
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 108, 42));
guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() {
@Override
public double getLevel()
{
return 1F;
}
}, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 164, 15));
guiElements.add(new GuiProgress(new IProgressInfoHandler() {
@Override
public double getProgress()
{
return (double)timer.getValue() / 20F;
}
}, ProgressBar.MEDIUM, this, MekanismUtils.getResource(ResourceType.GUI, stripTexture()), 70, 46));
}
public static List<ItemStack> getInfuseStacks(InfuseType type)
{
List<ItemStack> ret = new ArrayList<ItemStack>();
for(Map.Entry<ItemStack, InfuseObject> obj : InfuseRegistry.getObjectMap().entrySet())
{
if(obj.getValue().type == type)
{
ret.add(obj.getKey());
}
}
return ret;
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
InfuseType type = tempRecipe.getInput().infuse.type;
changeTexture(MekanismRenderer.getBlocksTexture());
drawTexturedRectFromIcon(2, 2, type.sprite, 4, 52);
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof MetallurgicInfuserRecipeWrapper)
{
tempRecipe = ((MetallurgicInfuserRecipeWrapper)recipeWrapper).recipe;
}
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 45, 26);
itemStacks.init(1, false, 103, 26);
itemStacks.init(2, true, 11, 18);
itemStacks.set(0, tempRecipe.getInput().inputStack);
itemStacks.set(1, tempRecipe.getOutput().output);
itemStacks.set(2, getInfuseStacks(tempRecipe.getInput().infuse.type));
}
}
@@ -1,39 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.Arrays;
import java.util.List;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.item.ItemStack;
public class MetallurgicInfuserRecipeWrapper extends BaseRecipeWrapper
{
public MetallurgicInfuserRecipe recipe;
public MetallurgicInfuserRecipeCategory category;
public MetallurgicInfuserRecipeWrapper(MetallurgicInfuserRecipe r, MetallurgicInfuserRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
List<ItemStack> inputStacks = Arrays.asList(recipe.recipeInput.inputStack);
List<ItemStack> infuseStacks = MetallurgicInfuserRecipeCategory.getInfuseStacks(recipe.getInput().infuse.type);
ingredients.setInput(ItemStack.class, recipe.recipeInput.inputStack);
ingredients.setInputLists(ItemStack.class, Arrays.asList(inputStacks, infuseStacks));
ingredients.setOutput(ItemStack.class, recipe.recipeOutput.output);
}
@Override
public MetallurgicInfuserRecipeCategory getCategory()
{
return category;
}
}
@@ -1,142 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.List;
import mekanism.client.gui.element.GuiFluidGauge;
import mekanism.client.gui.element.GuiGasGauge;
import mekanism.client.gui.element.GuiGauge;
import mekanism.client.gui.element.GuiPowerBar;
import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler;
import mekanism.client.gui.element.GuiProgress;
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.element.GuiProgress.ProgressBar;
import mekanism.client.gui.element.GuiSlot;
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.machines.PressurizedRecipe;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiFluidStackGroup;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.gui.ITooltipCallback;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
public class PRCRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public IDrawable fluidOverlay;
public GuiGasGauge gasInput;
public GuiGasGauge gasOutput;
public PressurizedRecipe tempRecipe;
public ITickTimer timer;
public PRCRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/nei/GuiPRC.png", "pressurized_reaction_chamber", "tile.MachineBlock2.PressurizedReactionChamber.short.name", ProgressBar.MEDIUM);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 3;
yOffset = 11;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 170, 68);
fluidOverlay = guiHelper.createDrawable(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, GuiGauge.Type.STANDARD.textureLocation), 19, 1, 16, 59);
}
@Override
public void addGuiElements()
{
guiElements.add(new GuiSlot(SlotType.INPUT, this, guiLocation, 53, 34));
guiElements.add(new GuiSlot(SlotType.POWER, this, guiLocation, 140, 18).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, guiLocation, 115, 34));
guiElements.add(GuiFluidGauge.getDummy(GuiGauge.Type.STANDARD_YELLOW, this, guiLocation, 5, 10));
guiElements.add(gasInput = GuiGasGauge.getDummy(GuiGauge.Type.STANDARD_RED, this, guiLocation, 28, 10));
guiElements.add(gasOutput = GuiGasGauge.getDummy(GuiGauge.Type.SMALL_BLUE, this, guiLocation, 140, 40));
guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() {
@Override
public double getLevel()
{
return 1F;
}
}, guiLocation, 164, 15));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return (float)timer.getValue() / 20F;
}
}, progressBar, this, guiLocation, 75, 37));
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
if(tempRecipe.getInput().getGas() != null)
{
gasInput.setDummyType(tempRecipe.getInput().getGas().getGas());
gasInput.renderScale(0, 0, -xOffset, -yOffset);
}
if(tempRecipe.getOutput().getGasOutput() != null)
{
gasOutput.setDummyType(tempRecipe.getOutput().getGasOutput().getGas());
gasOutput.renderScale(0, 0, -xOffset, -yOffset);
}
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof PRCRecipeWrapper)
{
tempRecipe = ((PRCRecipeWrapper)recipeWrapper).recipe;
}
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 53-xOffset, 34-yOffset);
itemStacks.init(1, false, 115-xOffset, 34-yOffset);
itemStacks.set(0, tempRecipe.recipeInput.getSolid());
itemStacks.set(1, tempRecipe.recipeOutput.getItemOutput());
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(0, true, 3, 0, 16, 58, tempRecipe.getInput().getFluid().amount, false, fluidOverlay);
fluidStacks.set(0, tempRecipe.recipeInput.getFluid());
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
@Override
public void onTooltip(int slotIndex, boolean input, FluidStack ingredient, List<String> tooltip)
{
tooltip.remove(1);
}
});
}
}
@@ -1,61 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.PressurizedRecipe;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class PRCRecipeWrapper extends BaseRecipeWrapper
{
public PressurizedRecipe recipe;
public PRCRecipeCategory category;
public PRCRecipeWrapper(PressurizedRecipe r, PRCRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInput(ItemStack.class, recipe.recipeInput.getSolid());
ingredients.setInput(FluidStack.class, recipe.recipeInput.getFluid());
ingredients.setInput(GasStack.class, recipe.recipeInput.getGas());
ingredients.setOutput(ItemStack.class, recipe.recipeOutput.getItemOutput());
ingredients.setOutput(GasStack.class, recipe.recipeOutput.getGasOutput());
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
if(mouseX >= 29-3 && mouseX <= 45-3 && mouseY >= 11-12 && mouseY <= 69-12)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getInput().getGas()));
}
else if(mouseX >= 141-3 && mouseX <= 157-3 && mouseY >= 41-12 && mouseY <= 69-12)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getOutput().getGasOutput()));
}
return currenttip;
}
@Override
public PRCRecipeCategory getCategory()
{
return category;
}
}
@@ -1,89 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.List;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.BaseRecipeCategory;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiFluidStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
public class RotaryCondensentratorRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public IDrawable fluidOverlay;
public RotaryCondensentratorRecipeWrapper tempRecipe;
public ITickTimer timer;
public RotaryCondensentratorRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/nei/GuiRotaryCondensentrator.png", "rotary_condensentrator", "nei.rotaryCondensentrator", null);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 3;
yOffset = 12;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 170, 71);
fluidOverlay = guiHelper.createDrawable(new ResourceLocation(guiTexture), 176, 40, 16, 59);
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
if(tempRecipe.condensentrating)
{
drawTexturedRect(64-xOffset, 39-yOffset, 176, 123, 48, 8);
}
else {
drawTexturedRect(64-xOffset, 39-yOffset, 176, 115, 48, 8);
}
if(tempRecipe.gasType != null)
{
displayGauge(58, 26-xOffset, 14-yOffset, 176, 40, 58, null, new GasStack(tempRecipe.gasType, 1));
}
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof RotaryCondensentratorRecipeWrapper)
{
tempRecipe = (RotaryCondensentratorRecipeWrapper)recipeWrapper;
}
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(0, !tempRecipe.condensentrating, 134-xOffset, 14-yOffset, 16, 58, 1000, false, fluidOverlay);
if(tempRecipe.condensentrating)
{
fluidStacks.set(0, ingredients.getOutputs(FluidStack.class).get(0));
}
else {
fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0));
}
}
}
@@ -1,77 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
public class RotaryCondensentratorRecipeWrapper extends BaseRecipeWrapper
{
public Fluid fluidType;
public Gas gasType;
public boolean condensentrating = true;
public RotaryCondensentratorRecipeCategory category;
public RotaryCondensentratorRecipeWrapper(Fluid fluid, Gas gas, boolean b, RotaryCondensentratorRecipeCategory c)
{
fluidType = fluid;
gasType = gas;
condensentrating = b;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
if(condensentrating)
{
ingredients.setInput(GasStack.class, new GasStack(gasType, 1000));
ingredients.setOutput(FluidStack.class, new FluidStack(fluidType, 1000));
}
else {
ingredients.setInput(FluidStack.class, new FluidStack(fluidType, 1000));
ingredients.setOutput(GasStack.class, new GasStack(gasType, 1000));
}
}
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
{
FontRenderer fontRenderer = minecraft.fontRenderer;
fontRenderer.drawString(condensentrating ? LangUtils.localize("gui.condensentrating") : LangUtils.localize("gui.decondensentrating"), 6-3, 74-12, 0x404040, false);
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
if(mouseX >= 26-3 && mouseX <= 42-3 && mouseY >= 14-12 && mouseY <= 72-12)
{
currenttip.add(gasType.getLocalizedName());
}
return currenttip;
}
@Override
public RotaryCondensentratorRecipeCategory getCategory()
{
return category;
}
}
@@ -1,72 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.List;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.machines.SolarNeutronRecipe;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
public class SolarNeutronRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public SolarNeutronRecipe tempRecipe;
public ITickTimer timer;
public SolarNeutronRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/nei/GuiSolarNeutronActivator.png", "solar_neutron_activator", "tile.MachineBlock3.SolarNeutronActivator.name", null);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 3;
yOffset = 12;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 170, 70);
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
drawTexturedRect(64-xOffset, 39-yOffset, 176, 58, 55, 8);
if(tempRecipe.getInput().ingredient != null)
{
displayGauge(58, 26-xOffset, 14-yOffset, 176, 0, 58, null, tempRecipe.getInput().ingredient);
}
if(tempRecipe.getOutput().output != null)
{
displayGauge(58, 134-xOffset, 14-yOffset, 176, 0, 58, null, tempRecipe.getOutput().output);
}
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof SolarNeutronRecipeWrapper)
{
tempRecipe = ((SolarNeutronRecipeWrapper)recipeWrapper).recipe;
}
}
}
@@ -1,56 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import mekanism.api.gas.GasStack;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.SolarNeutronRecipe;
import mekanism.common.util.LangUtils;
import mezz.jei.api.ingredients.IIngredients;
public class SolarNeutronRecipeWrapper extends BaseRecipeWrapper
{
public SolarNeutronRecipe recipe;
public SolarNeutronRecipeCategory category;
public SolarNeutronRecipeWrapper(SolarNeutronRecipe r, SolarNeutronRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInput(GasStack.class, recipe.getInput().ingredient);
ingredients.setOutput(GasStack.class, recipe.getOutput().output);
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
List<String> currenttip = new ArrayList<String>();
if(mouseX >= 26-3 && mouseX <= 42-3 && mouseY >= 14-12 && mouseY <= 72-12)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getInput().ingredient));
}
else if(mouseX >= 134-3 && mouseX <= 150-3 && mouseY >= 14-12 && mouseY <= 72-12)
{
currenttip.add(LangUtils.localizeGasStack(recipe.getOutput().output));
}
return currenttip;
}
@Override
public SolarNeutronRecipeCategory getCategory()
{
return category;
}
}
@@ -1,83 +0,0 @@
package mekanism.client.jei.machine.other;
import java.util.List;
import mekanism.client.jei.BaseRecipeCategory;
import mekanism.common.recipe.machines.ThermalEvaporationRecipe;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiFluidStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ITickTimer;
import mezz.jei.api.gui.ITooltipCallback;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
public class ThermalEvaporationRecipeCategory extends BaseRecipeCategory
{
public IGuiHelper guiHelper;
public IDrawable background;
public IDrawable fluidOverlay;
public ThermalEvaporationRecipe tempRecipe;
public ITickTimer timer;
public ThermalEvaporationRecipeCategory(IGuiHelper helper)
{
super("mekanism:gui/nei/GuiThermalEvaporationController.png", "thermal_evaporation_plant", "gui.thermalEvaporationController.short", null);
guiHelper = helper;
timer = helper.createTickTimer(20, 20, false);
xOffset = 3;
yOffset = 12;
background = guiHelper.createDrawable(new ResourceLocation(guiTexture), xOffset, yOffset, 170, 62);
fluidOverlay = guiHelper.createDrawable(new ResourceLocation(guiTexture), 176, 0, 16, 59);
}
@Override
public void drawExtras(Minecraft minecraft)
{
super.drawExtras(minecraft);
drawTexturedRect(49-xOffset, 64-yOffset, 176, 59, 78, 8);
}
@Override
public IDrawable getBackground()
{
return background;
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
if(recipeWrapper instanceof ThermalEvaporationRecipeWrapper)
{
tempRecipe = ((ThermalEvaporationRecipeWrapper)recipeWrapper).recipe;
}
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(0, true, 7-xOffset, 14-yOffset, 16, 58, tempRecipe.getInput().ingredient.amount, false, fluidOverlay);
fluidStacks.init(1, false, 153-xOffset, 14-yOffset, 16, 58, tempRecipe.getOutput().output.amount, false, fluidOverlay);
fluidStacks.set(0, tempRecipe.recipeInput.ingredient);
fluidStacks.set(1, tempRecipe.recipeOutput.output);
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
@Override
public void onTooltip(int slotIndex, boolean input, FluidStack ingredient, List<String> tooltip)
{
tooltip.remove(1);
}
});
}
}
@@ -1,32 +0,0 @@
package mekanism.client.jei.machine.other;
import mekanism.client.jei.machine.BaseRecipeWrapper;
import mekanism.common.recipe.machines.ThermalEvaporationRecipe;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraftforge.fluids.FluidStack;
public class ThermalEvaporationRecipeWrapper extends BaseRecipeWrapper
{
public ThermalEvaporationRecipe recipe;
public ThermalEvaporationRecipeCategory category;
public ThermalEvaporationRecipeWrapper(ThermalEvaporationRecipe r, ThermalEvaporationRecipeCategory c)
{
recipe = r;
category = c;
}
@Override
public void getIngredients(IIngredients ingredients)
{
ingredients.setInput(FluidStack.class, recipe.getInput().ingredient);
ingredients.setOutput(FluidStack.class, recipe.getOutput().output);
}
@Override
public ThermalEvaporationRecipeCategory getCategory()
{
return category;
}
}
+204
View File
@@ -0,0 +1,204 @@
package mekanism.common;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class Foo {
// Replace calls to GameRegistry.addShapeless/ShapedRecipe with these methods, which will dump it to a json in your dir of choice
// Also works with OD, replace GameRegistry.addRecipe(new ShapedOreRecipe/ShapelessOreRecipe with the same calls
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
private static final File RECIPE_DIR = new File("recipeoutput");
private static HashMap<String, String> constants = new HashMap<>();
public static void addShapedRecipe(ItemStack result, Object... components) {
if (!RECIPE_DIR.exists()) {
RECIPE_DIR.mkdir();
}
// GameRegistry.addShapedRecipe(result, components);
Map<String, Object> json = new HashMap<>();
List<String> pattern = new ArrayList<>();
int i = 0;
while (i < components.length && components[i] instanceof String) {
pattern.add((String) components[i]);
i++;
}
json.put("pattern", pattern);
boolean isOreDict = false;
Map<String, Map<String, Object>> key = new HashMap<>();
Character curKey = null;
for (; i < components.length; i++) {
Object o = components[i];
if (o instanceof Character) {
if (curKey != null)
throw new IllegalArgumentException("Provided two char keys in a row");
curKey = (Character) o;
} else {
if (curKey == null)
throw new IllegalArgumentException("Providing object without a char key");
if (o instanceof String)
isOreDict = true;
try {
key.put(Character.toString(curKey), serializeItem(o));
} catch (IllegalArgumentException e) {
System.out.println("1 Failed to convert recipe" + e.getMessage());
// e.printStackTrace();
return;
}
curKey = null;
}
}
json.put("key", key);
json.put("type", isOreDict ? "forge:ore_shaped" : "minecraft:crafting_shaped");
try {
json.put("result", serializeItem(result));
} catch (IllegalArgumentException e) {
System.out.println("2 Failed to convert recipe" + e.getMessage());
// e.printStackTrace();
return;
}
// names the json the same name as the output's registry name
// repeatedly adds _alt if a file already exists
// janky I know but it works
String suffix = result.getItem().getHasSubtypes() ? "_" + result.getItemDamage() : "";
File f = new File(RECIPE_DIR, result.getItem().getRegistryName().getResourcePath() + suffix + ".json");
while (f.exists()) {
suffix += "_alt";
f = new File(RECIPE_DIR, result.getItem().getRegistryName().getResourcePath() + suffix + ".json");
}
try (FileWriter w = new FileWriter(f)) {
GSON.toJson(json, w);
} catch (IOException e) {
e.printStackTrace();
}
}
public static void addShapelessRecipe(ItemStack result, Object... components)
{
if (!RECIPE_DIR.exists()) {
RECIPE_DIR.mkdir();
}
// GameRegistry.addShapelessRecipe(result, components);
Map<String, Object> json = new HashMap<>();
boolean isOreDict = false;
List<Map<String, Object>> ingredients = new ArrayList<>();
for (Object o : components) {
if (o instanceof String)
isOreDict = true;
try {
ingredients.add(serializeItem(o));
} catch (IllegalArgumentException e) {
System.out.println("3 Failed to convert recipe" + e.getMessage());
// e.printStackTrace();
return;
}
}
json.put("ingredients", ingredients);
json.put("type", isOreDict ? "forge:ore_shapeless" : "minecraft:crafting_shapeless");
try {
json.put("result", serializeItem(result));
} catch (IllegalArgumentException e) {
System.out.println("4 Failed to convert recipe" + e.getMessage());
// e.printStackTrace();
return;
}
// names the json the same name as the output's registry name
// repeatedly adds _alt if a file already exists
// janky I know but it works
String suffix = result.getItem().getHasSubtypes() ? "_" + result.getItemDamage() : "";
File f = new File(RECIPE_DIR, result.getItem().getRegistryName().getResourcePath() + suffix + ".json");
while (f.exists()) {
suffix += "_alt";
f = new File(RECIPE_DIR, result.getItem().getRegistryName().getResourcePath() + suffix + ".json");
}
try (FileWriter w = new FileWriter(f)) {
GSON.toJson(json, w);
} catch (IOException e) {
e.printStackTrace();
}
}
public static Map<String, Object> serializeItem(Object thing) {
if (thing instanceof Item) {
return serializeItem(new ItemStack((Item) thing));
}
if (thing instanceof Block) {
return serializeItem(new ItemStack((Block) thing));
}
if (thing instanceof ItemStack) {
ItemStack stack = (ItemStack) thing;
Map<String, Object> ret = new HashMap<>();
ret.put("item", stack.getItem().getRegistryName().toString());
if (stack.getItem().getHasSubtypes() || stack.getItemDamage() != 0) {
ret.put("data", stack.getItemDamage());
}
if (stack.getCount() > 1) {
ret.put("count", stack.getCount());
}
if (stack.hasTagCompound()) {
Map<String, Object> tag = new HashMap<>();
NBTTagCompound compound = stack.getTagCompound();
Set<String> keySet = compound.getKeySet();
for(String key: keySet) {
if(key.equals("tier") || key.equals("recipeType")) {
tag.put(key, compound.getInteger(key));
} else if (key.equals("mekData")) {
//TODO
} else {
System.out.println("Key: " + key);
}
}
ret.put("nbt", tag);
}
return ret;
}
if (thing instanceof String) {
Map<String, Object> ret = new HashMap<>();
// ret.put("item", "#" + ((String) thing)); // NOTE you need to add this to your _constants.json!
// // todo autogenerate constants.json as well
ret.put("type", "forge:ore_dict");
ret.put("ore", thing);
return ret;
}
throw new IllegalArgumentException("Not a block, item, stack, or od name");
}
}
+13 -585
View File
@@ -27,15 +27,7 @@ import mekanism.api.transmitters.DynamicNetwork.TransmittersAddedEvent;
import mekanism.api.transmitters.TransmitterNetworkRegistry;
import mekanism.client.ClientTickHandler;
import mekanism.common.Tier.BaseTier;
import mekanism.common.Tier.BinTier;
import mekanism.common.Tier.EnergyCubeTier;
import mekanism.common.Tier.FactoryTier;
import mekanism.common.Tier.FluidTankTier;
import mekanism.common.Tier.GasTankTier;
import mekanism.common.Tier.InductionCellTier;
import mekanism.common.Tier.InductionProviderTier;
import mekanism.common.base.IChunkLoadHandler;
import mekanism.common.base.IFactory.RecipeType;
import mekanism.common.base.IModule;
import mekanism.common.block.states.BlockStateMachine.MachineType;
import mekanism.common.block.states.BlockStateTransmitter.TransmitterType;
@@ -66,11 +58,8 @@ import mekanism.common.network.PacketDataRequest.DataRequestMessage;
import mekanism.common.network.PacketSimpleGui;
import mekanism.common.network.PacketTransmitterUpdate.PacketType;
import mekanism.common.network.PacketTransmitterUpdate.TransmitterUpdateMessage;
import mekanism.common.recipe.BinRecipe;
import mekanism.common.recipe.RecipeHandler;
import mekanism.common.recipe.RecipeHandler.Recipe;
import mekanism.common.recipe.ShapedMekanismRecipe;
import mekanism.common.recipe.ShapelessMekanismRecipe;
import mekanism.common.recipe.inputs.ItemStackInput;
import mekanism.common.recipe.machines.SmeltingRecipe;
import mekanism.common.recipe.outputs.ItemStackOutput;
@@ -112,7 +101,6 @@ import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@@ -146,8 +134,6 @@ import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.RecipeSorter;
import net.minecraftforge.oredict.RecipeSorter.Category;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -255,577 +241,19 @@ public class Mekanism
*/
public void addRecipes()
{
//Storage Recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 3),
"***", "***", "***", Character.valueOf('*'), new ItemStack(Items.COAL, 1, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(Items.COAL, 9, 1),
"*", Character.valueOf('*'), new ItemStack(MekanismBlocks.BasicBlock, 1, 3)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 2),
"***", "***", "***", Character.valueOf('*'), "ingotRefinedObsidian"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Ingot, 9, 0),
"*", Character.valueOf('*'), new ItemStack(MekanismBlocks.BasicBlock, 1, 2)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 4),
"***", "***", "***", Character.valueOf('*'), "ingotRefinedGlowstone"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Ingot, 9, 3),
"*", Character.valueOf('*'), new ItemStack(MekanismBlocks.BasicBlock, 1, 4)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 0),
"XXX", "XXX", "XXX", Character.valueOf('X'), "ingotOsmium"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Ingot, 9, 1),
"*", Character.valueOf('*'), new ItemStack(MekanismBlocks.BasicBlock, 1, 0)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 1),
"***", "***", "***", Character.valueOf('*'), "ingotBronze"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Ingot, 9, 2),
"*", Character.valueOf('*'), new ItemStack(MekanismBlocks.BasicBlock, 1, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 5),
"***", "***", "***", Character.valueOf('*'), "ingotSteel"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Ingot, 9, 4),
"*", Character.valueOf('*'), new ItemStack(MekanismBlocks.BasicBlock, 1, 5)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 12),
"***", "***", "***", Character.valueOf('*'), "ingotCopper"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Ingot, 9, 5),
"*", Character.valueOf('*'), new ItemStack(MekanismBlocks.BasicBlock, 1, 12)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 13),
"***", "***", "***", Character.valueOf('*'), "ingotTin"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Ingot, 9, 6),
"*", Character.valueOf('*'), new ItemStack(MekanismBlocks.BasicBlock, 1, 13)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.SaltBlock),
"**", "**", Character.valueOf('*'), MekanismItems.Salt
));
//Base Recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.ObsidianTNT, 1),
"***", "XXX", "***", Character.valueOf('*'), Blocks.OBSIDIAN, Character.valueOf('X'), Blocks.TNT
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.ElectricBow.getUnchargedItem(),
" AB", "E B", " AB", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('B'), Items.STRING, Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem()
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.EnergyTablet.getUnchargedItem(),
"RCR", "ECE", "RCR", Character.valueOf('C'), "ingotGold", Character.valueOf('R'), "dustRedstone", Character.valueOf('E'), MekanismItems.EnrichedAlloy
));
MachineType.ENRICHMENT_CHAMBER.addRecipe(new ShapedMekanismRecipe(MachineType.ENRICHMENT_CHAMBER.getStack(),
"RCR", "iIi", "RCR", Character.valueOf('i'), "ingotIron", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('R'), "alloyBasic", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
));
MachineType.OSMIUM_COMPRESSOR.addRecipe(new ShapedMekanismRecipe(MachineType.OSMIUM_COMPRESSOR.getStack(),
"ECE", "BIB", "ECE", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('B'), Items.BUCKET, Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
));
MachineType.COMBINER.addRecipe(new ShapedMekanismRecipe(MachineType.COMBINER.getStack(),
"RCR", "SIS", "RCR", Character.valueOf('S'), "cobblestone", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('R'), "alloyElite", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
));
MachineType.CRUSHER.addRecipe(new ShapedMekanismRecipe(MachineType.CRUSHER.getStack(),
"RCR", "LIL", "RCR", Character.valueOf('R'), "dustRedstone", Character.valueOf('L'), Items.LAVA_BUCKET, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.SpeedUpgrade),
" G ", "ADA", " G ", Character.valueOf('G'), "blockGlass", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('D'), "dustOsmium"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.EnergyUpgrade),
" G ", "ADA", " G ", Character.valueOf('G'), "blockGlass", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('D'), "dustGold"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.GasUpgrade),
" G ", "ADA", " G ", Character.valueOf('G'), "blockGlass", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('D'), "dustIron"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.FilterUpgrade),
" G ", "ADA", " G ", Character.valueOf('G'), "blockGlass", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('D'), "dustTin"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.MufflingUpgrade),
" G ", "ADA", " G ", Character.valueOf('G'), "blockGlass", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('D'), "dustSteel"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.AnchorUpgrade),
" G ", "ADA", " G ", Character.valueOf('G'), "blockGlass", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('D'), "dustDiamond"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.AtomicDisassembler.getUnchargedItem(),
"AEA", "ACA", " O ", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('C'), MekanismItems.AtomicAlloy, Character.valueOf('O'), "ingotRefinedObsidian"
));
MachineType.METALLURGIC_INFUSER.addRecipe(new ShapedMekanismRecipe(MachineType.METALLURGIC_INFUSER.getStack(),
"IFI", "ROR", "IFI", Character.valueOf('I'), "ingotIron", Character.valueOf('F'), Blocks.FURNACE, Character.valueOf('R'), "dustRedstone", Character.valueOf('O'), "ingotOsmium"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.TeleportationCore),
"LAL", "GDG", "LAL", Character.valueOf('L'), new ItemStack(Items.DYE, 1, 4), Character.valueOf('A'), MekanismItems.AtomicAlloy, Character.valueOf('G'), "ingotGold", Character.valueOf('D'), Items.DIAMOND
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.PortableTeleporter.getUnchargedItem(),
" E ", "CTC", " E ", Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('T'), MekanismItems.TeleportationCore
));
MachineType.TELEPORTER.addRecipe(new ShapedMekanismRecipe(MachineType.TELEPORTER.getStack(),
"COC", "OTO", "COC", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('O'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('T'), MekanismItems.TeleportationCore
));
MachineType.PURIFICATION_CHAMBER.addRecipe(new ShapedMekanismRecipe(MachineType.PURIFICATION_CHAMBER.getStack(),
"ECE", "ORO", "ECE", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('E'), "alloyAdvanced", Character.valueOf('O'), "ingotOsmium", Character.valueOf('R'), MachineType.ENRICHMENT_CHAMBER.getStack()
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.Configurator.getUnchargedItem(),
" L ", "AEA", " S ", Character.valueOf('L'), new ItemStack(Items.DYE, 1, 4), Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('S'), Items.STICK
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 9, 7),
"OOO", "OGO", "OOO", Character.valueOf('O'), "ingotRefinedObsidian", Character.valueOf('G'), "ingotRefinedGlowstone"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 8), new Object[] {
"SGS", "GPG", "SGS", Character.valueOf('S'), "ingotSteel", Character.valueOf('P'), "ingotOsmium", Character.valueOf('G'), "blockGlass"
}));
MachineType.ENERGIZED_SMELTER.addRecipe(new ShapedMekanismRecipe(MachineType.ENERGIZED_SMELTER.getStack(),
"RCR", "GIG", "RCR", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('R'), "alloyBasic", Character.valueOf('G'), "blockGlass", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
));
MachineType.ELECTRIC_PUMP.addRecipe(new ShapedMekanismRecipe(MachineType.ELECTRIC_PUMP.getStack(),
" B ", "ECE", "OOO", Character.valueOf('B'), Items.BUCKET, Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('C'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('O'), "ingotOsmium"
));
MachineType.PERSONAL_CHEST.addRecipe(new ShapedMekanismRecipe(MachineType.PERSONAL_CHEST.getStack(),
"SGS", "CcC", "SSS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), "blockGlass", Character.valueOf('C'), "chestWood", Character.valueOf('c'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 4, 9),
" I ", "IBI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('B'), Items.BUCKET
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 4, 10),
" I ", "IGI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('G'), "blockGlass"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 2, 11),
" I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
));
MachineType.CHARGEPAD.addRecipe(new ShapedMekanismRecipe(MachineType.CHARGEPAD.getStack(),
"PPP", "SES", Character.valueOf('P'), Blocks.STONE_PRESSURE_PLATE, Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem()
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.Robit.getUnchargedItem(),
" S ", "ECE", "OIO", Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('C'), MekanismItems.AtomicAlloy, Character.valueOf('O'), "ingotRefinedObsidian", Character.valueOf('I'), MachineType.PERSONAL_CHEST.getStack()
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.NetworkReader.getUnchargedItem(),
" G ", "AEA", " I ", Character.valueOf('G'), "blockGlass", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('I'), "ingotSteel"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.WalkieTalkie),
" O", "SCS", " S ", Character.valueOf('O'), "ingotOsmium", Character.valueOf('S'), "ingotSteel", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
));
MachineType.LOGISTICAL_SORTER.addRecipe(new ShapedMekanismRecipe(MachineType.LOGISTICAL_SORTER.getStack(),
"IPI", "ICI", "III", Character.valueOf('I'), "ingotIron", Character.valueOf('P'), Blocks.PISTON, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
));
MachineType.DIGITAL_MINER.addRecipe(new ShapedMekanismRecipe(MachineType.DIGITAL_MINER.getStack(),
"ACA", "SES", "TIT", Character.valueOf('A'), MekanismItems.AtomicAlloy, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('S'), MachineType.LOGISTICAL_SORTER.getStack(), Character.valueOf('E'), MekanismItems.Robit.getUnchargedItem(),
Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('T'), MekanismItems.TeleportationCore
));
MachineType.ROTARY_CONDENSENTRATOR.addRecipe(new ShapedMekanismRecipe(MachineType.ROTARY_CONDENSENTRATOR.getStack(),
"GCG", "tEI", "GCG", Character.valueOf('G'), "blockGlass", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('t'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC), Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(),
Character.valueOf('T'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('I'), MekanismUtils.getEmptyFluidTank(FluidTankTier.BASIC)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.Jetpack.getEmptyItem(),
"SCS", "TGT", " T ", Character.valueOf('S'), "ingotSteel", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('T'), "ingotTin", Character.valueOf('G'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Dictionary),
"C", "B", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('B'), Items.BOOK
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.GasMask),
" S ", "GCG", "S S", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), "blockGlass", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.ScubaTank.getEmptyItem(),
" C ", "ATA", "SSS", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('S'), "ingotSteel"
));
MachineType.CHEMICAL_OXIDIZER.addRecipe(new ShapedMekanismRecipe(MachineType.CHEMICAL_OXIDIZER.getStack(),
"ACA", "ERG", "ACA", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('R'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('G'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC), Character.valueOf('E'), MachineType.PERSONAL_CHEST.getStack(), Character.valueOf('A'), MekanismItems.EnrichedAlloy
));
MachineType.CHEMICAL_INFUSER.addRecipe(new ShapedMekanismRecipe(MachineType.CHEMICAL_INFUSER.getStack(),
"ACA", "GRG", "ACA", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('R'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('G'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC), Character.valueOf('A'), MekanismItems.EnrichedAlloy
));
MachineType.CHEMICAL_INJECTION_CHAMBER.addRecipe(new ShapedMekanismRecipe(MachineType.CHEMICAL_INJECTION_CHAMBER.getStack(),
"RCR", "GPG", "RCR", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('R'), "alloyElite", Character.valueOf('G'), "ingotGold", Character.valueOf('P'), MachineType.PURIFICATION_CHAMBER.getStack()
));
MachineType.ELECTROLYTIC_SEPARATOR.addRecipe(new ShapedMekanismRecipe(MachineType.ELECTROLYTIC_SEPARATOR.getStack(),
"IRI", "ECE", "IRI", Character.valueOf('I'), "ingotIron", Character.valueOf('R'), "dustRedstone", Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('C'), MekanismItems.ElectrolyticCore
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.ElectrolyticCore),
"EPE", "IEG", "EPE", Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('P'), "dustOsmium", Character.valueOf('I'), "dustIron", Character.valueOf('G'), "dustGold"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.CardboardBox),
"SS", "SS", Character.valueOf('S'), "pulpWood"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(Items.PAPER, 6),
"SSS", Character.valueOf('S'), MekanismItems.Sawdust
));
MachineType.PRECISION_SAWMILL.addRecipe(new ShapedMekanismRecipe(MachineType.PRECISION_SAWMILL.getStack(),
"ICI", "ASA", "ICI", Character.valueOf('I'), "ingotIron", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('S'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 14),
"CGC", "IBI", "III", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('G'), "paneGlass", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock2, 1, 0), Character.valueOf('B'), Items.BUCKET
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 15),
" I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock2, 1, 0), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 4, 0),
" S ", "SCS", " S ", Character.valueOf('C'), "ingotCopper", Character.valueOf('S'), "ingotSteel"
));
MachineType.CHEMICAL_DISSOLUTION_CHAMBER.addRecipe(new ShapedMekanismRecipe(MachineType.CHEMICAL_DISSOLUTION_CHAMBER.getStack(),
"CGC", "EAE", "CGC", Character.valueOf('G'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('A'), MekanismItems.AtomicAlloy, Character.valueOf('E'), MekanismItems.EnrichedAlloy
));
MachineType.CHEMICAL_WASHER.addRecipe(new ShapedMekanismRecipe(MachineType.CHEMICAL_WASHER.getStack(),
"CWC", "EIE", "CGC", Character.valueOf('W'), Items.BUCKET, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('G'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC), Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
));
MachineType.CHEMICAL_CRYSTALLIZER.addRecipe(new ShapedMekanismRecipe(MachineType.CHEMICAL_CRYSTALLIZER.getStack(),
"CGC", "ASA", "CGC", Character.valueOf('G'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('A'), MekanismItems.AtomicAlloy, Character.valueOf('S'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.FreeRunners.getUnchargedItem(),
"C C", "A A", "T T", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem()
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.ArmoredJetpack.getEmptyItem(),
"D D", "BSB", " J ", Character.valueOf('D'), "dustDiamond", Character.valueOf('B'), "ingotBronze", Character.valueOf('S'), "blockSteel", Character.valueOf('J'), MekanismItems.Jetpack.getEmptyItem()
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.ConfigurationCard),
" A ", "ACA", " A ", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.SeismicReader.getUnchargedItem(),
"SLS", "STS", "SSS", Character.valueOf('S'), "ingotSteel", Character.valueOf('L'), new ItemStack(Items.DYE, 1, 4), Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem()
));
MachineType.SEISMIC_VIBRATOR.addRecipe(new ShapedMekanismRecipe(MachineType.SEISMIC_VIBRATOR.getStack(),
"TLT", "CIC", "TTT", Character.valueOf('T'), "ingotTin", Character.valueOf('L'), new ItemStack(Items.DYE, 1, 4), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
));
MachineType.PRESSURIZED_REACTION_CHAMBER.addRecipe(new ShapedMekanismRecipe(MachineType.PRESSURIZED_REACTION_CHAMBER.getStack(),
"TET", "CIC", "GFG", Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('G'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC),
Character.valueOf('I'), MachineType.ENRICHMENT_CHAMBER.getStack(), Character.valueOf('F'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9)
));
MachineType.FLUIDIC_PLENISHER.addRecipe(new ShapedMekanismRecipe(MachineType.FLUIDIC_PLENISHER.getStack(),
"TTT", "CPC", "TTT", Character.valueOf('P'), MachineType.ELECTRIC_PUMP.getStack(), Character.valueOf('T'), "ingotTin", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(Blocks.RAIL, 24),
"O O", "OSO", "O O", Character.valueOf('O'), "ingotOsmium", Character.valueOf('S'), "stickWood"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.Flamethrower.getEmptyItem(),
"TTT", "TGS", "BCB", Character.valueOf('T'), "ingotTin", Character.valueOf('G'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC), Character.valueOf('S'), Items.FLINT_AND_STEEL, Character.valueOf('B'), "ingotBronze", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.GaugeDropper.getEmptyItem(),
" O ", "G G", "GGG", Character.valueOf('O'), "ingotOsmium", Character.valueOf('G'), "paneGlass"
));
MachineType.SOLAR_NEUTRON_ACTIVATOR.addRecipe(new ShapedMekanismRecipe(MachineType.SOLAR_NEUTRON_ACTIVATOR.getStack(),
"APA", "CSC", "BBB", Character.valueOf('A'), "alloyElite", Character.valueOf('S'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('P'), new ItemStack(MekanismItems.Polyethene, 1, 2), Character.valueOf('B'), "ingotBronze", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 4, 1),
" S ", "SES", " S ", Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem()
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 2, 2),
" I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock2, 1, 1), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.TierInstaller, 1, 0), new Object[] {
"RCR", "iWi", "RCR", Character.valueOf('R'), "alloyBasic", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('i'), "ingotIron", Character.valueOf('W'), "plankWood"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.TierInstaller, 1, 1), new Object[] {
"ECE", "oWo", "ECE", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('o'), "ingotOsmium", Character.valueOf('W'), "plankWood"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.TierInstaller, 1, 2), new Object[] {
"RCR", "gWg", "RCR", Character.valueOf('R'), "alloyElite", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('g'), "ingotGold", Character.valueOf('W'), "plankWood"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.TierInstaller, 1, 3), new Object[] {
"RCR", "dWd", "RCR", Character.valueOf('R'), "alloyUltimate", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ULTIMATE), Character.valueOf('d'), "gemDiamond", Character.valueOf('W'), "plankWood"
}));
MachineType.OREDICTIONIFICATOR.addRecipe(new ShapedMekanismRecipe(MachineType.OREDICTIONIFICATOR.getStack(),
"SGS", "CBC", "SWS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), "paneGlass", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('B'), MekanismItems.Dictionary, Character.valueOf('W'), "chestWood"
));
MachineType.LASER.addRecipe(new ShapedMekanismRecipe(MachineType.LASER.getStack(),
"RE ", "RCD", "RE ", Character.valueOf('R'), "alloyElite", Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('C'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('D'), "gemDiamond"
));
MachineType.LASER_AMPLIFIER.addRecipe(new ShapedMekanismRecipe(MachineType.LASER_AMPLIFIER.getStack(),
"SSS", "SED", "SSS", Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC), Character.valueOf('D'), "gemDiamond"
));
MachineType.LASER_TRACTOR_BEAM.addRecipe(new ShapedMekanismRecipe(MachineType.LASER_TRACTOR_BEAM.getStack(),
"C", "F", Character.valueOf('C'), MachineType.PERSONAL_CHEST.getStack(), Character.valueOf('F'), MachineType.LASER_AMPLIFIER.getStack()
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 1, 6),
"SFS", "FAF", "SFS", Character.valueOf('S'), "ingotSteel", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('F'), Blocks.IRON_BARS
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 4, 7),
" S ", "SIS", " S ", Character.valueOf('S'), "ingotSteel", Character.valueOf('I'), "ingotIron"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 2, 8),
" I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock2, 1, 7), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 1, 5),
"ACA", "CIC", "ACA", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('C'), "ingotCopper", Character.valueOf('A'), "alloyBasic"
));
MachineType.RESISTIVE_HEATER.addRecipe(new ShapedMekanismRecipe(MachineType.RESISTIVE_HEATER.getStack(), new Object[] {
"CRC", "RHR", "CEC", Character.valueOf('C'), "ingotTin", Character.valueOf('R'), "dustRedstone", Character.valueOf('H'), new ItemStack(MekanismBlocks.BasicBlock2, 1, 5), Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem()
}));
MachineType.QUANTUM_ENTANGLOPORTER.addRecipe(new ShapedMekanismRecipe(MachineType.QUANTUM_ENTANGLOPORTER.getStack(), new Object[] {
"OCO", "ATA", "OCO", Character.valueOf('O'), "ingotRefinedObsidian", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ULTIMATE), Character.valueOf('A'), "alloyUltimate", Character.valueOf('T'), MekanismItems.TeleportationCore
}));
MachineType.FORMULAIC_ASSEMBLICATOR.addRecipe(new ShapedMekanismRecipe(MachineType.FORMULAIC_ASSEMBLICATOR.getStack(), new Object[] {
"STS", "BIB", "SCS", Character.valueOf('S'), "ingotSteel", Character.valueOf('T'), Blocks.CRAFTING_TABLE, Character.valueOf('B'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('C'), "chestWood"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapelessMekanismRecipe(new ItemStack(MekanismItems.CraftingFormula), new Object[] {
Items.PAPER, MekanismUtils.getControlCircuit(BaseTier.BASIC)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 1, 9), new Object[] {
"SGS", "CIC", "STS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), "blockGlass", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8),
Character.valueOf('T'), MekanismItems.TeleportationCore
}));
MachineType.FUELWOOD_HEATER.addRecipe(new ShapedMekanismRecipe(MachineType.FUELWOOD_HEATER.getStack(), new Object[] {
"SCS", "FHF", "SSS", Character.valueOf('S'), "ingotSteel", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('F'), Blocks.FURNACE, Character.valueOf('H'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
}));
//Energy Cube recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC),
"RTR", "iIi", "RTR", Character.valueOf('R'), "alloyBasic", Character.valueOf('i'), "ingotIron", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.ADVANCED),
"ETE", "oBo", "ETE", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('o'), "ingotOsmium", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('B'), MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.ELITE),
"RTR", "gAg", "RTR", Character.valueOf('R'), "alloyElite", Character.valueOf('g'), "ingotGold", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('A'), MekanismUtils.getEnergyCube(EnergyCubeTier.ADVANCED)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.ULTIMATE),
"ATA", "dEd", "ATA", Character.valueOf('A'), "alloyUltimate", Character.valueOf('d'), "gemDiamond", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ELITE)
));
//Gas Tank Recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEmptyGasTank(GasTankTier.BASIC), new Object[] {
"APA", "P P", "APA", Character.valueOf('P'), "ingotOsmium", Character.valueOf('A'), "alloyBasic"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEmptyGasTank(GasTankTier.ADVANCED), new Object[] {
"APA", "PTP", "APA", Character.valueOf('P'), "ingotOsmium", Character.valueOf('A'), "alloyAdvanced", Character.valueOf('T'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEmptyGasTank(GasTankTier.ELITE), new Object[] {
"APA", "PTP", "APA", Character.valueOf('P'), "ingotOsmium", Character.valueOf('A'), "alloyElite", Character.valueOf('T'), MekanismUtils.getEmptyGasTank(GasTankTier.ADVANCED)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEmptyGasTank(GasTankTier.ULTIMATE), new Object[] {
"APA", "PTP", "APA", Character.valueOf('P'), "ingotOsmium", Character.valueOf('A'), "alloyUltimate", Character.valueOf('T'), MekanismUtils.getEmptyGasTank(GasTankTier.ELITE)
}));
//Fluid Tank Recipes
MachineType.FLUID_TANK.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getEmptyFluidTank(FluidTankTier.BASIC), new Object[] {
"AIA", "I I", "AIA", Character.valueOf('I'), "ingotIron", Character.valueOf('A'), "alloyBasic"
}));
MachineType.FLUID_TANK.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getEmptyFluidTank(FluidTankTier.ADVANCED), new Object[] {
"AIA", "ITI", "AIA", Character.valueOf('I'), "ingotIron", Character.valueOf('A'), "alloyAdvanced", Character.valueOf('T'), MekanismUtils.getEmptyFluidTank(FluidTankTier.BASIC)
}));
MachineType.FLUID_TANK.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getEmptyFluidTank(FluidTankTier.ELITE), new Object[] {
"AIA", "ITI", "AIA", Character.valueOf('I'), "ingotIron", Character.valueOf('A'), "alloyElite", Character.valueOf('T'), MekanismUtils.getEmptyFluidTank(FluidTankTier.ADVANCED)
}));
MachineType.FLUID_TANK.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getEmptyFluidTank(FluidTankTier.ULTIMATE), new Object[] {
"AIA", "ITI", "AIA", Character.valueOf('I'), "ingotIron", Character.valueOf('A'), "alloyUltimate", Character.valueOf('T'), MekanismUtils.getEmptyFluidTank(FluidTankTier.ELITE)
}));
//Bin recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getBin(BinTier.BASIC), new Object[] {
"SCS", "A A", "SSS", Character.valueOf('S'), "cobblestone", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('A'), "alloyBasic"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getBin(BinTier.ADVANCED), new Object[] {
"SCS", "ABA", "SSS", Character.valueOf('S'), "cobblestone", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('A'), "alloyAdvanced", Character.valueOf('B'), MekanismUtils.getBin(BinTier.BASIC)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getBin(BinTier.ELITE), new Object[] {
"SCS", "ABA", "SSS", Character.valueOf('S'), "cobblestone", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('A'), "alloyElite", Character.valueOf('B'), MekanismUtils.getBin(BinTier.ADVANCED)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getBin(BinTier.ULTIMATE), new Object[] {
"SCS", "ABA", "SSS", Character.valueOf('S'), "cobblestone", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ULTIMATE), Character.valueOf('A'), "alloyUltimate", Character.valueOf('B'), MekanismUtils.getBin(BinTier.ELITE)
}));
//Induction Cell recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getInductionCell(InductionCellTier.BASIC),
"LTL", "TET", "LTL", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC), Character.valueOf('L'), "dustLithium"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getInductionCell(InductionCellTier.ADVANCED),
"TCT", "CEC", "TCT", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ADVANCED), Character.valueOf('C'), MekanismUtils.getInductionCell(InductionCellTier.BASIC)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getInductionCell(InductionCellTier.ELITE),
"TCT", "CEC", "TCT", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ELITE), Character.valueOf('C'), MekanismUtils.getInductionCell(InductionCellTier.ADVANCED)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getInductionCell(InductionCellTier.ULTIMATE),
"TCT", "CEC", "TCT", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ULTIMATE), Character.valueOf('C'), MekanismUtils.getInductionCell(InductionCellTier.ELITE)
));
//Induction Provider recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getInductionProvider(InductionProviderTier.BASIC),
"LCL", "CEC", "LCL", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC), Character.valueOf('L'), "dustLithium"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getInductionProvider(InductionProviderTier.ADVANCED),
"CPC", "PEP", "CPC", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ADVANCED), Character.valueOf('P'), MekanismUtils.getInductionProvider(InductionProviderTier.BASIC)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getInductionProvider(InductionProviderTier.ELITE),
"CPC", "PEP", "CPC", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ELITE), Character.valueOf('P'), MekanismUtils.getInductionProvider(InductionProviderTier.ADVANCED)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getInductionProvider(InductionProviderTier.ULTIMATE),
"CPC", "PEP", "CPC", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ULTIMATE), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ULTIMATE), Character.valueOf('P'), MekanismUtils.getInductionProvider(InductionProviderTier.ELITE)
));
//Circuit recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.ControlCircuit, 1, 1),
"ECE", Character.valueOf('C'), new ItemStack(MekanismItems.ControlCircuit, 1, 0), Character.valueOf('E'), "alloyAdvanced"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.ControlCircuit, 1, 2),
"RCR", Character.valueOf('C'), new ItemStack(MekanismItems.ControlCircuit, 1, 1), Character.valueOf('R'), "alloyElite"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.ControlCircuit, 1, 3),
"ACA", Character.valueOf('C'), new ItemStack(MekanismItems.ControlCircuit, 1, 2), Character.valueOf('A'), "alloyUltimate"
));
//Factory recipes
for(RecipeType type : RecipeType.values())
{
MachineType.BASIC_FACTORY.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getFactory(FactoryTier.BASIC, type),
"RCR", "iOi", "RCR", Character.valueOf('R'), "alloyBasic", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('i'), "ingotIron", Character.valueOf('O'), type.getStack()
));
MachineType.ADVANCED_FACTORY.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getFactory(FactoryTier.ADVANCED, type),
"ECE", "oOo", "ECE", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('o'), "ingotOsmium", Character.valueOf('O'), MekanismUtils.getFactory(FactoryTier.BASIC, type)
));
MachineType.ELITE_FACTORY.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getFactory(FactoryTier.ELITE, type),
"RCR", "gOg", "RCR", Character.valueOf('R'), "alloyElite", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('g'), "ingotGold", Character.valueOf('O'), MekanismUtils.getFactory(FactoryTier.ADVANCED, type)
));
}
//Add the bin recipe system to the CraftingManager
CraftingManager.getInstance().getRecipeList().add(new BinRecipe());
//Transmitters
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.UNIVERSAL_CABLE, BaseTier.BASIC, 8),
"SRS", Character.valueOf('S'), "ingotSteel", Character.valueOf('R'), "dustRedstone"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.UNIVERSAL_CABLE, BaseTier.ADVANCED, 8),
"TTT", "TET", "TTT", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.UNIVERSAL_CABLE, BaseTier.BASIC, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.UNIVERSAL_CABLE, BaseTier.ELITE, 8),
"TTT", "TRT", "TTT", Character.valueOf('R'), "alloyElite", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.UNIVERSAL_CABLE, BaseTier.ADVANCED, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.UNIVERSAL_CABLE, BaseTier.ULTIMATE, 8),
"TTT", "TAT", "TTT", Character.valueOf('A'), "alloyUltimate", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.UNIVERSAL_CABLE, BaseTier.ELITE, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.MECHANICAL_PIPE, BaseTier.BASIC, 8),
"SBS", Character.valueOf('S'), "ingotSteel", Character.valueOf('B'), Items.BUCKET
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.MECHANICAL_PIPE, BaseTier.ADVANCED, 8),
"TTT", "TET", "TTT", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.MECHANICAL_PIPE, BaseTier.BASIC, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.MECHANICAL_PIPE, BaseTier.ELITE, 8),
"TTT", "TRT", "TTT", Character.valueOf('R'), "alloyElite", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.MECHANICAL_PIPE, BaseTier.ADVANCED, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.MECHANICAL_PIPE, BaseTier.ULTIMATE, 8),
"TTT", "TAT", "TTT", Character.valueOf('A'), "alloyUltimate", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.MECHANICAL_PIPE, BaseTier.ELITE, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.PRESSURIZED_TUBE, BaseTier.BASIC, 8),
"SGS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), "blockGlass"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.PRESSURIZED_TUBE, BaseTier.ADVANCED, 8),
"TTT", "TET", "TTT", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.PRESSURIZED_TUBE, BaseTier.BASIC, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.PRESSURIZED_TUBE, BaseTier.ELITE, 8),
"TTT", "TRT", "TTT", Character.valueOf('R'), "alloyElite", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.PRESSURIZED_TUBE, BaseTier.ADVANCED, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.PRESSURIZED_TUBE, BaseTier.ULTIMATE, 8),
"TTT", "TAT", "TTT", Character.valueOf('A'), "alloyUltimate", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.PRESSURIZED_TUBE, BaseTier.ELITE, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.LOGISTICAL_TRANSPORTER, BaseTier.BASIC, 8),
"SCS", Character.valueOf('S'), "ingotSteel", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.LOGISTICAL_TRANSPORTER, BaseTier.ADVANCED, 8),
"TTT", "TET", "TTT", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.LOGISTICAL_TRANSPORTER, BaseTier.BASIC, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.LOGISTICAL_TRANSPORTER, BaseTier.ELITE, 8),
"TTT", "TRT", "TTT", Character.valueOf('R'), "alloyElite", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.LOGISTICAL_TRANSPORTER, BaseTier.ADVANCED, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.LOGISTICAL_TRANSPORTER, BaseTier.ULTIMATE, 8),
"TTT", "TAT", "TTT", Character.valueOf('A'), "alloyUltimate", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.LOGISTICAL_TRANSPORTER, BaseTier.ELITE, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.RESTRICTIVE_TRANSPORTER, BaseTier.BASIC, 2),
"SBS", Character.valueOf('S'), "ingotSteel", Character.valueOf('B'), Blocks.IRON_BARS
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.DIVERSION_TRANSPORTER, BaseTier.BASIC, 2),
"RRR", "SBS", "RRR", Character.valueOf('R'), "dustRedstone", Character.valueOf('S'), "ingotSteel", Character.valueOf('B'), Blocks.IRON_BARS
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.THERMODYNAMIC_CONDUCTOR, BaseTier.BASIC, 8),
"SCS", Character.valueOf('S'), "ingotSteel", Character.valueOf('C'), "ingotCopper"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.THERMODYNAMIC_CONDUCTOR, BaseTier.ADVANCED, 8),
"TTT", "TET", "TTT", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.THERMODYNAMIC_CONDUCTOR, BaseTier.BASIC, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.THERMODYNAMIC_CONDUCTOR, BaseTier.ELITE, 8),
"TTT", "TRT", "TTT", Character.valueOf('R'), "alloyElite", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.THERMODYNAMIC_CONDUCTOR, BaseTier.ADVANCED, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getTransmitter(TransmitterType.THERMODYNAMIC_CONDUCTOR, BaseTier.ULTIMATE, 8),
"TTT", "TAT", "TTT", Character.valueOf('A'), "alloyUltimate", Character.valueOf('T'), MekanismUtils.getTransmitter(TransmitterType.THERMODYNAMIC_CONDUCTOR, BaseTier.ELITE, 1)
));
//Plastic stuff
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Polyethene, 1, 1),
"PP", "PP", Character.valueOf('P'), new ItemStack(MekanismItems.Polyethene, 1, 0)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Polyethene, 1, 2),
"PPP", "P P", "PPP", Character.valueOf('P'), new ItemStack(MekanismItems.Polyethene, 1, 0)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.Polyethene, 1, 3),
"R", "R", Character.valueOf('R'), new ItemStack(MekanismItems.Polyethene, 1, 1)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.PlasticBlock, 4, 15),
"SSS", "S S", "SSS", Character.valueOf('S'), new ItemStack(MekanismItems.Polyethene, 1, 2)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.GlowPanel, 2, 15),
"PSP", "S S", "GSG", Character.valueOf('P'), "paneGlass", Character.valueOf('S'), new ItemStack(MekanismItems.Polyethene, 1, 2), Character.valueOf('G'), "dustGlowstone"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.PlasticFence, 3, 15),
"BSB", "BSB", Character.valueOf('B'), new ItemStack(MekanismBlocks.PlasticBlock, 1, 15), Character.valueOf('S'), new ItemStack(MekanismItems.Polyethene, 1, 3)
));
for(int i = 0; i < EnumColor.DYES.length-1; i++)
{
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.PlasticBlock, 4, i),
"SSS", "SDS", "SSS", Character.valueOf('S'), new ItemStack(MekanismItems.Polyethene, 1, 2), Character.valueOf('D'), "dye" + EnumColor.DYES[i].dyeName
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.GlowPanel, 2, i),
"PSP", "SDS", "GSG", Character.valueOf('P'), "paneGlass", Character.valueOf('S'), new ItemStack(MekanismItems.Polyethene, 1, 2), Character.valueOf('D'), "dye" + EnumColor.DYES[i].dyeName, Character.valueOf('G'), "dustGlowstone"
));
}
for(int i = 0; i < EnumColor.DYES.length; i++)
{
CraftingManager.getInstance().getRecipeList().add(new ShapelessMekanismRecipe(new ItemStack(MekanismItems.Balloon, 2, i),
Items.LEATHER, Items.STRING, "dye" + EnumColor.DYES[i].dyeName
));
for(int j = 0; j < EnumColor.DYES.length; j++)
{
CraftingManager.getInstance().getRecipeList().add(new ShapelessMekanismRecipe(new ItemStack(MekanismItems.Balloon, 1, i),
new ItemStack(MekanismItems.Balloon, 1, j), "dye" + EnumColor.DYES[i].dyeName
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.PlasticBlock, 4, i),
" P ", "PDP", " P ", Character.valueOf('P'), new ItemStack(MekanismBlocks.PlasticBlock, 1, j), Character.valueOf('D'), "dye" + EnumColor.DYES[i].dyeName
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.SlickPlasticBlock, 4, i),
" P ", "PDP", " P ", Character.valueOf('P'), new ItemStack(MekanismBlocks.SlickPlasticBlock, 1, j), Character.valueOf('D'), "dye" + EnumColor.DYES[i].dyeName
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.GlowPlasticBlock, 4, i),
" P ", "PDP", " P ", Character.valueOf('P'), new ItemStack(MekanismBlocks.GlowPlasticBlock, 1, j), Character.valueOf('D'), "dye" + EnumColor.DYES[i].dyeName
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.ReinforcedPlasticBlock, 4, i),
" P ", "PDP", " P ", Character.valueOf('P'), new ItemStack(MekanismBlocks.ReinforcedPlasticBlock, 1, j), Character.valueOf('D'), "dye" + EnumColor.DYES[i].dyeName
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.GlowPanel, 4, i),
" P ", "PDP", " P ", Character.valueOf('P'), new ItemStack(MekanismBlocks.GlowPanel, 1, j), Character.valueOf('D'), "dye" + EnumColor.DYES[i].dyeName
));
}
CraftingManager.getInstance().getRecipeList().add(new ShapelessMekanismRecipe(new ItemStack(MekanismBlocks.GlowPlasticBlock, 3, i),
new ItemStack(MekanismBlocks.PlasticBlock, 1, i), new ItemStack(MekanismBlocks.PlasticBlock, 1, i), new ItemStack(MekanismBlocks.PlasticBlock, 1, i), new ItemStack(Items.GLOWSTONE_DUST)
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.ReinforcedPlasticBlock, 4, i),
" P ", "POP", " P ", Character.valueOf('P'), new ItemStack(MekanismBlocks.PlasticBlock, 1, i), Character.valueOf('O'), "dustOsmium"
));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.RoadPlasticBlock, 3, i),
"SSS", "PPP", "SSS", Character.valueOf('S'), Blocks.SAND, Character.valueOf('P'), new ItemStack(MekanismBlocks.SlickPlasticBlock, 1, i)
));
}
// CraftingManager.getInstance().getRecipeList().add(new BinRecipe());
//Furnace Recipes
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MekanismBlocks.OreBlock, 1, 0), new ItemStack(MekanismItems.Ingot, 1, 1), 1.0F);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MekanismBlocks.OreBlock, 1, 1), new ItemStack(MekanismItems.Ingot, 1, 5), 1.0F);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MekanismBlocks.OreBlock, 1, 2), new ItemStack(MekanismItems.Ingot, 1, 6), 1.0F);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MekanismItems.Dust, 1, Resource.OSMIUM.ordinal()), new ItemStack(MekanismItems.Ingot, 1, 1), 0.0F);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MekanismItems.Dust, 1, Resource.IRON.ordinal()), new ItemStack(Items.IRON_INGOT), 0.0F);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MekanismItems.Dust, 1, Resource.GOLD.ordinal()), new ItemStack(Items.GOLD_INGOT), 0.0F);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MekanismItems.OtherDust, 1, 1), new ItemStack(MekanismItems.Ingot, 1, 4), 0.0F);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MekanismItems.Dust, 1, Resource.COPPER.ordinal()), new ItemStack(MekanismItems.Ingot, 1, 5), 0.0F);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MekanismItems.Dust, 1, Resource.TIN.ordinal()), new ItemStack(MekanismItems.Ingot, 1, 6), 0.0F);
GameRegistry.addSmelting(new ItemStack(MekanismBlocks.OreBlock, 1, 0), new ItemStack(MekanismItems.Ingot, 1, 1), 1.0F);
GameRegistry.addSmelting(new ItemStack(MekanismBlocks.OreBlock, 1, 1), new ItemStack(MekanismItems.Ingot, 1, 5), 1.0F);
GameRegistry.addSmelting(new ItemStack(MekanismBlocks.OreBlock, 1, 2), new ItemStack(MekanismItems.Ingot, 1, 6), 1.0F);
GameRegistry.addSmelting(new ItemStack(MekanismItems.Dust, 1, Resource.OSMIUM.ordinal()), new ItemStack(MekanismItems.Ingot, 1, 1), 0.0F);
GameRegistry.addSmelting(new ItemStack(MekanismItems.Dust, 1, Resource.IRON.ordinal()), new ItemStack(Items.IRON_INGOT), 0.0F);
GameRegistry.addSmelting(new ItemStack(MekanismItems.Dust, 1, Resource.GOLD.ordinal()), new ItemStack(Items.GOLD_INGOT), 0.0F);
GameRegistry.addSmelting(new ItemStack(MekanismItems.OtherDust, 1, 1), new ItemStack(MekanismItems.Ingot, 1, 4), 0.0F);
GameRegistry.addSmelting(new ItemStack(MekanismItems.Dust, 1, Resource.COPPER.ordinal()), new ItemStack(MekanismItems.Ingot, 1, 5), 0.0F);
GameRegistry.addSmelting(new ItemStack(MekanismItems.Dust, 1, Resource.TIN.ordinal()), new ItemStack(MekanismItems.Ingot, 1, 6), 0.0F);
//Enrichment Chamber Recipes
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.REDSTONE_ORE), new ItemStack(Items.REDSTONE, 12));
@@ -1039,9 +467,9 @@ public class Mekanism
FuelHandler.addGas(MekanismFluids.Hydrogen, 1, general.FROM_H2);
//RecipeSorter registrations
RecipeSorter.register("mekanism_shaped", ShapedMekanismRecipe.class, Category.SHAPED, "");
RecipeSorter.register("mekanism_shapeless", ShapelessMekanismRecipe.class, Category.SHAPELESS, "");
RecipeSorter.register("bin", BinRecipe.class, Category.SHAPELESS, "");
// RecipeSorter.register("mekanism_shaped", ShapedMekanismRecipe.class, Category.SHAPED, "");
// RecipeSorter.register("mekanism_shapeless", ShapelessMekanismRecipe.class, Category.SHAPELESS, "");
// RecipeSorter.register("bin", BinRecipe.class, Category.SHAPELESS, "");
}
/**
@@ -1,18 +1,18 @@
package mekanism.common.base;
import java.util.Collection;
//import java.util.Collection;
import mekanism.common.recipe.ShapedMekanismRecipe;
//import mekanism.common.recipe.ShapedMekanismRecipe;
public interface IBlockType
{
public String getBlockName();
public Collection<ShapedMekanismRecipe> getRecipes();
public void addRecipes(Collection<ShapedMekanismRecipe> recipes);
public void addRecipe(ShapedMekanismRecipe recipe);
// public Collection<ShapedMekanismRecipe> getRecipes();
//
// public void addRecipes(Collection<ShapedMekanismRecipe> recipes);
//
// public void addRecipe(ShapedMekanismRecipe recipe);
public boolean isEnabled();
}
@@ -13,7 +13,6 @@ import mekanism.common.base.IFactory.RecipeType;
import mekanism.common.block.BlockMachine;
import mekanism.common.config.MekanismConfig.general;
import mekanism.common.config.MekanismConfig.usage;
import mekanism.common.recipe.ShapedMekanismRecipe;
import mekanism.common.tile.TileEntityAdvancedFactory;
import mekanism.common.tile.TileEntityAmbientAccumulator;
import mekanism.common.tile.TileEntityChargepad;
@@ -169,7 +168,7 @@ public class BlockStateMachine extends ExtendedBlockState
public boolean isElectric;
public boolean hasModel;
public boolean supportsUpgrades;
public Collection<ShapedMekanismRecipe> blockRecipes = new HashSet<ShapedMekanismRecipe>();
// public Collection<ShapedMekanismRecipe> blockRecipes = new HashSet<ShapedMekanismRecipe>();
public Predicate<EnumFacing> facingPredicate;
public boolean activable;
@@ -199,23 +198,23 @@ public class BlockStateMachine extends ExtendedBlockState
return general.machinesManager.isEnabled(blockName);
}
@Override
public void addRecipes(Collection<ShapedMekanismRecipe> recipes)
{
blockRecipes.addAll(recipes);
}
@Override
public void addRecipe(ShapedMekanismRecipe recipe)
{
blockRecipes.add(recipe);
}
@Override
public Collection<ShapedMekanismRecipe> getRecipes()
{
return blockRecipes;
}
// @Override
// public void addRecipes(Collection<ShapedMekanismRecipe> recipes)
// {
// blockRecipes.addAll(recipes);
// }
//
// @Override
// public void addRecipe(ShapedMekanismRecipe recipe)
// {
// blockRecipes.add(recipe);
// }
//
// @Override
// public Collection<ShapedMekanismRecipe> getRecipes()
// {
// return blockRecipes;
// }
public static List<MachineType> getValidMachines()
{
@@ -29,11 +29,11 @@ public class TypeConfigManager
if(manager.isEnabled(type.getBlockName()))
{
CraftingManager.getInstance().getRecipeList().removeAll(type.getRecipes());
CraftingManager.getInstance().getRecipeList().addAll(type.getRecipes());
// CraftingManager.getInstance().getRecipeList().removeAll(type.getRecipes());
// CraftingManager.getInstance().getRecipeList().addAll(type.getRecipes());
}
else {
CraftingManager.getInstance().getRecipeList().removeAll(type.getRecipes());
// CraftingManager.getInstance().getRecipeList().removeAll(type.getRecipes());
}
}
}
@@ -5,15 +5,12 @@ import java.util.List;
import mekanism.common.Mekanism;
import mekanism.common.recipe.RecipeHandler;
import mekanism.common.recipe.RecipeHandler.Recipe;
import mekanism.common.recipe.ShapedMekanismRecipe;
import mekanism.common.recipe.ShapelessMekanismRecipe;
import mekanism.common.recipe.inputs.MachineInput;
import mekanism.common.recipe.machines.MachineRecipe;
import mekanism.common.util.RecipeUtils;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class IMCHandler
{
@@ -32,32 +29,32 @@ public class IMCHandler
if(message.equals("ShapedMekanismRecipe"))
{
ShapedMekanismRecipe recipe = ShapedMekanismRecipe.create(msg.getNBTValue());
if(recipe != null)
{
GameRegistry.addRecipe(recipe);
Mekanism.logger.info("[Mekanism] " + msg.getSender() + " added a shaped recipe to the recipe list.");
}
else {
Mekanism.logger.error("[Mekanism] " + msg.getSender() + " attempted to add an invalid shaped recipe.");
}
// ShapedMekanismRecipe recipe = ShapedMekanismRecipe.create(msg.getNBTValue());
//
// if(recipe != null)
// {
// GameRegistry.addRecipe(recipe);
// Mekanism.logger.info("[Mekanism] " + msg.getSender() + " added a shaped recipe to the recipe list.");
// }
// else {
// Mekanism.logger.error("[Mekanism] " + msg.getSender() + " attempted to add an invalid shaped recipe.");
// }
found = true;
}
else if(message.equals("ShapelessMekanismRecipe"))
{
ShapelessMekanismRecipe recipe = ShapelessMekanismRecipe.create(msg.getNBTValue());
if(recipe != null)
{
GameRegistry.addRecipe(recipe);
Mekanism.logger.info("[Mekanism] " + msg.getSender() + " added a shapeless recipe to the recipe list.");
}
else {
Mekanism.logger.error("[Mekanism] " + msg.getSender() + " attempted to add an invalid shapeless recipe.");
}
// ShapelessMekanismRecipe recipe = ShapelessMekanismRecipe.create(msg.getNBTValue());
//
// if(recipe != null)
// {
// GameRegistry.addRecipe(recipe);
// Mekanism.logger.info("[Mekanism] " + msg.getSender() + " added a shapeless recipe to the recipe list.");
// }
// else {
// Mekanism.logger.error("[Mekanism] " + msg.getSender() + " attempted to add an invalid shapeless recipe.");
// }
found = true;
}
else if(message.equals("DeleteMekanismRecipes") || message.equals("RemoveMekanismRecipes"))
@@ -1,196 +1,196 @@
package mekanism.common.recipe;
import mekanism.common.MekanismItems;
import mekanism.common.Tier.BinTier;
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
import mekanism.common.inventory.InventoryBin;
import mekanism.common.item.ItemProxy;
import mekanism.common.util.ItemDataUtils;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
public class BinRecipe implements IRecipe
{
private static boolean registered;
public BinRecipe()
{
if(!registered)
{
MinecraftForge.EVENT_BUS.register(this);
registered = true;
}
}
@Override
public boolean matches(InventoryCrafting inv, World world)
{
return !getCraftingResult(inv).isEmpty();
}
private boolean isBin(ItemStack itemStack)
{
if(itemStack.isEmpty())
{
return false;
}
return BasicBlockType.get(itemStack) == BasicBlockType.BIN && itemStack.getCount() <= 1;
}
@Override
public ItemStack getCraftingResult(InventoryCrafting inv)
{
return getResult(inv);
}
public ItemStack getResult(IInventory inv)
{
ItemStack bin = ItemStack.EMPTY;
for(int i = 0; i < inv.getSizeInventory(); i++)
{
ItemStack stack = inv.getStackInSlot(i);
if(isBin(stack))
{
if(!bin.isEmpty())
{
return ItemStack.EMPTY;
}
bin = stack.copy();
}
}
if(bin.isEmpty() || bin.getCount() > 1)
{
return ItemStack.EMPTY;
}
ItemStack addStack = ItemStack.EMPTY;
for(int i = 0; i < 9; i++)
{
ItemStack stack = inv.getStackInSlot(i);
if(!stack.isEmpty() && !isBin(stack))
{
if(!addStack.isEmpty())
{
return ItemStack.EMPTY;
}
addStack = stack.copy();
}
}
InventoryBin binInv = new InventoryBin(bin);
if(!addStack.isEmpty())
{
if(!(addStack.getItem() instanceof ItemProxy))
{
if(!binInv.getItemType().isEmpty() && !binInv.getItemType().isItemEqual(addStack))
{
return ItemStack.EMPTY;
}
binInv.add(addStack);
}
return bin;
}
else {
return binInv.removeStack();
}
}
@Override
public int getRecipeSize()
{
return 0;
}
@Override
public ItemStack getRecipeOutput()
{
return ItemStack.EMPTY;
}
@Override
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
@SubscribeEvent
public void onCrafting(ItemCraftedEvent event)
{
if(!getResult(event.craftMatrix).isEmpty())
{
if(!isBin(event.crafting))
{
for(int i = 0; i < event.craftMatrix.getSizeInventory(); i++)
{
if(isBin(event.craftMatrix.getStackInSlot(i)))
{
ItemStack bin = event.craftMatrix.getStackInSlot(i);
InventoryBin inv = new InventoryBin(bin.copy());
int size = inv.getItemCount();
ItemStack testRemove = inv.removeStack();
int newCount = size-(!testRemove.isEmpty() ? testRemove.getCount() : 0);
if(inv.getTier() == BinTier.CREATIVE)
{
newCount = size;
}
ItemDataUtils.setInt(bin, "newCount", newCount);
}
}
}
else {
int bin = -1;
int other = -1;
for(int i = 0; i < event.craftMatrix.getSizeInventory(); i++)
{
if(isBin(event.craftMatrix.getStackInSlot(i)))
{
bin = i;
}
else if(!isBin(event.craftMatrix.getStackInSlot(i)) && !event.craftMatrix.getStackInSlot(i).isEmpty())
{
other = i;
}
}
ItemStack binStack = event.craftMatrix.getStackInSlot(bin);
ItemStack otherStack = event.craftMatrix.getStackInSlot(other);
ItemStack testRemain = new InventoryBin(binStack.copy()).add(otherStack.copy());
if(!testRemain.isEmpty() && testRemain.getCount() > 0)
{
ItemStack proxy = new ItemStack(MekanismItems.ItemProxy);
((ItemProxy)proxy.getItem()).setSavedItem(proxy, testRemain.copy());
event.craftMatrix.setInventorySlotContents(other, proxy);
}
else {
event.craftMatrix.setInventorySlotContents(other, ItemStack.EMPTY);
}
}
}
}
}
//package mekanism.common.recipe;
//
//import mekanism.common.MekanismItems;
//import mekanism.common.Tier.BinTier;
//import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
//import mekanism.common.inventory.InventoryBin;
//import mekanism.common.item.ItemProxy;
//import mekanism.common.util.ItemDataUtils;
//import net.minecraft.inventory.IInventory;
//import net.minecraft.inventory.InventoryCrafting;
//import net.minecraft.item.ItemStack;
//import net.minecraft.item.crafting.IRecipe;
//import net.minecraft.util.NonNullList;
//import net.minecraft.world.World;
//import net.minecraftforge.common.ForgeHooks;
//import net.minecraftforge.common.MinecraftForge;
//import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
//import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
//
//public class BinRecipe implements IRecipe
//{
// private static boolean registered;
//
// public BinRecipe()
// {
// if(!registered)
// {
// MinecraftForge.EVENT_BUS.register(this);
// registered = true;
// }
// }
//
// @Override
// public boolean matches(InventoryCrafting inv, World world)
// {
// return !getCraftingResult(inv).isEmpty();
// }
//
// private boolean isBin(ItemStack itemStack)
// {
// if(itemStack.isEmpty())
// {
// return false;
// }
//
// return BasicBlockType.get(itemStack) == BasicBlockType.BIN && itemStack.getCount() <= 1;
// }
//
// @Override
// public ItemStack getCraftingResult(InventoryCrafting inv)
// {
// return getResult(inv);
// }
//
// public ItemStack getResult(IInventory inv)
// {
// ItemStack bin = ItemStack.EMPTY;
//
// for(int i = 0; i < inv.getSizeInventory(); i++)
// {
// ItemStack stack = inv.getStackInSlot(i);
//
// if(isBin(stack))
// {
// if(!bin.isEmpty())
// {
// return ItemStack.EMPTY;
// }
//
// bin = stack.copy();
// }
// }
//
// if(bin.isEmpty() || bin.getCount() > 1)
// {
// return ItemStack.EMPTY;
// }
//
// ItemStack addStack = ItemStack.EMPTY;
//
// for(int i = 0; i < 9; i++)
// {
// ItemStack stack = inv.getStackInSlot(i);
//
// if(!stack.isEmpty() && !isBin(stack))
// {
// if(!addStack.isEmpty())
// {
// return ItemStack.EMPTY;
// }
//
// addStack = stack.copy();
// }
// }
//
// InventoryBin binInv = new InventoryBin(bin);
//
// if(!addStack.isEmpty())
// {
// if(!(addStack.getItem() instanceof ItemProxy))
// {
// if(!binInv.getItemType().isEmpty() && !binInv.getItemType().isItemEqual(addStack))
// {
// return ItemStack.EMPTY;
// }
//
// binInv.add(addStack);
// }
//
// return bin;
// }
// else {
// return binInv.removeStack();
// }
// }
//
// @Override
// public int getRecipeSize()
// {
// return 0;
// }
//
// @Override
// public ItemStack getRecipeOutput()
// {
// return ItemStack.EMPTY;
// }
//
// @Override
// public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
// {
// return ForgeHooks.defaultRecipeGetRemainingItems(inv);
// }
//
// @SubscribeEvent
// public void onCrafting(ItemCraftedEvent event)
// {
// if(!getResult(event.craftMatrix).isEmpty())
// {
// if(!isBin(event.crafting))
// {
// for(int i = 0; i < event.craftMatrix.getSizeInventory(); i++)
// {
// if(isBin(event.craftMatrix.getStackInSlot(i)))
// {
// ItemStack bin = event.craftMatrix.getStackInSlot(i);
// InventoryBin inv = new InventoryBin(bin.copy());
//
// int size = inv.getItemCount();
//
// ItemStack testRemove = inv.removeStack();
// int newCount = size-(!testRemove.isEmpty() ? testRemove.getCount() : 0);
//
// if(inv.getTier() == BinTier.CREATIVE)
// {
// newCount = size;
// }
//
// ItemDataUtils.setInt(bin, "newCount", newCount);
// }
// }
// }
// else {
// int bin = -1;
// int other = -1;
//
// for(int i = 0; i < event.craftMatrix.getSizeInventory(); i++)
// {
// if(isBin(event.craftMatrix.getStackInSlot(i)))
// {
// bin = i;
// }
// else if(!isBin(event.craftMatrix.getStackInSlot(i)) && !event.craftMatrix.getStackInSlot(i).isEmpty())
// {
// other = i;
// }
// }
//
// ItemStack binStack = event.craftMatrix.getStackInSlot(bin);
// ItemStack otherStack = event.craftMatrix.getStackInSlot(other);
//
// ItemStack testRemain = new InventoryBin(binStack.copy()).add(otherStack.copy());
//
// if(!testRemain.isEmpty() && testRemain.getCount() > 0)
// {
// ItemStack proxy = new ItemStack(MekanismItems.ItemProxy);
// ((ItemProxy)proxy.getItem()).setSavedItem(proxy, testRemain.copy());
// event.craftMatrix.setInventorySlotContents(other, proxy);
// }
// else {
// event.craftMatrix.setInventorySlotContents(other, ItemStack.EMPTY);
// }
// }
// }
// }
//}
@@ -1,9 +1,12 @@
package mekanism.common.recipe;
import java.util.HashMap;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import mekanism.common.Mekanism;
import mekanism.common.MekanismItems;
import mekanism.common.util.InventoryUtils;
import mekanism.common.util.RecipeUtils;
import net.minecraft.block.Block;
@@ -11,297 +14,176 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.JsonUtils;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.common.crafting.IRecipeFactory;
import net.minecraftforge.common.crafting.JsonContext;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.oredict.ShapedOreRecipe;
/**
* Code originally from Eloraam and her work on the Ore Dictionary. Cleaned up and modified to work well with energized items.
* @author Eloraam, aidancbrady
*
*/
public class ShapedMekanismRecipe implements IRecipe
{
private static final int MAX_CRAFT_GRID_WIDTH = 3;
private static final int MAX_CRAFT_GRID_HEIGHT = 3;
import javax.annotation.Nonnull;
import java.util.Map;
import java.util.Set;
private ItemStack output = ItemStack.EMPTY;
private Object[] input = null;
public class ShapedMekanismRecipe extends ShapedOreRecipe {
public ShapedMekanismRecipe(ResourceLocation group, Block result, Object... recipe)
{
this(group, new ItemStack(result), recipe);
}
public int width = 0;
public int height = 0;
public ShapedMekanismRecipe(ResourceLocation group, Item result, Object... recipe)
{
this(group, new ItemStack(result), recipe);
}
private boolean mirrored = true;
public ShapedMekanismRecipe(ItemStack result, Object... recipe)
{
output = result.copy();
public ShapedMekanismRecipe(ResourceLocation group, @Nonnull ItemStack result, Object... recipe)
{
this(group, result, CraftingHelper.parseShaped(recipe));
}
String shape = "";
int idx = 0;
public ShapedMekanismRecipe(ResourceLocation group, @Nonnull ItemStack result, CraftingHelper.ShapedPrimer primer)
{
super(group, result, primer);
}
if(recipe[idx] instanceof Boolean)
{
mirrored = (Boolean)recipe[idx];
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull InventoryCrafting inv)
{
return RecipeUtils.getCraftingResult(inv, output);
}
if(recipe[idx+1] instanceof Object[])
{
recipe = (Object[])recipe[idx+1];
}
else {
idx = 1;
}
}
public static ShapedMekanismRecipe create(NBTTagCompound nbtTags)
{
if(!nbtTags.hasKey("result") || !nbtTags.hasKey("input"))
{
Mekanism.logger.error("[Mekanism] Shaped recipe parse error: missing input or result compound tag.");
return null;
}
if(recipe[idx] instanceof String[])
{
String[] parts = ((String[])recipe[idx++]);
ItemStack result = InventoryUtils.loadFromNBT(nbtTags.getCompoundTag("result"));
NBTTagList list = nbtTags.getTagList("input", Constants.NBT.TAG_COMPOUND);
for(String s : parts)
{
width = s.length();
shape += s;
}
if(result.isEmpty() || list.tagCount() == 0)
{
Mekanism.logger.error("[Mekanism] Shaped recipe parse error: invalid result stack or input data list.");
return null;
}
height = parts.length;
}
else {
while(recipe[idx] instanceof String)
{
String s = (String)recipe[idx++];
shape += s;
width = s.length();
height++;
}
}
Object[] ret = new Object[list.tagCount()];
if(width * height != shape.length())
{
String ret = "Invalid shaped Mekanism recipe: ";
for(int i = 0; i < list.tagCount(); i++)
{
NBTTagCompound compound = list.getCompoundTagAt(i);
for(Object tmp : recipe)
{
ret += tmp + ", ";
}
if(compound.hasKey("oredict"))
{
ret[i] = compound.getString("oredict");
}
else if(compound.hasKey("pattern"))
{
ret[i] = compound.getString("pattern");
}
else if(compound.hasKey("character"))
{
String s = compound.getString("character");
ret += output;
if(s.length() > 1)
{
Mekanism.logger.error("[Mekanism] Shaped recipe parse error: invalid pattern character data.");
return null;
}
throw new RuntimeException(ret);
}
ret[i] = compound.getString("character").toCharArray()[0];
}
else if(compound.hasKey("itemstack"))
{
ret[i] = InventoryUtils.loadFromNBT(compound.getCompoundTag("itemstack"));
}
else {
Mekanism.logger.error("[Mekanism] Shaped recipe parse error: invalid input tag data key.");
return null;
}
}
HashMap<Character, Object> itemMap = new HashMap<Character, Object>();
return new ShapedMekanismRecipe(null, result, ret); //TODO Find out correct value for group
}
for(; idx < recipe.length; idx += 2)
{
Character chr = (Character)recipe[idx];
Object in = recipe[idx + 1];
// Copy of net.minecraftforge.oredict.ShapedOreRecipe
public static ShapedOreRecipe factory(JsonContext context, JsonObject json)
{
String group = JsonUtils.getString(json, "group", "");
//if (!group.isEmpty() && group.indexOf(':') == -1)
// group = context.getModId() + ":" + group;
if(in instanceof ItemStack)
{
itemMap.put(chr, ((ItemStack)in).copy());
}
else if(in instanceof Item)
{
itemMap.put(chr, new ItemStack((Item)in));
}
else if(in instanceof Block)
{
itemMap.put(chr, new ItemStack((Block)in, 1, OreDictionary.WILDCARD_VALUE));
}
else if(in instanceof String)
{
itemMap.put(chr, OreDictionary.getOres((String)in));
}
else {
String ret = "Invalid shaped Mekanism recipe: ";
Map<Character, Ingredient> ingMap = Maps.newHashMap();
for (Map.Entry<String, JsonElement> entry : JsonUtils.getJsonObject(json, "key").entrySet())
{
if (entry.getKey().length() != 1)
throw new JsonSyntaxException("Invalid key entry: '" + entry.getKey() + "' is an invalid symbol (must be 1 character only).");
if (" ".equals(entry.getKey()))
throw new JsonSyntaxException("Invalid key entry: ' ' is a reserved symbol.");
for(Object tmp : recipe)
{
ret += tmp + ", ";
}
ingMap.put(entry.getKey().toCharArray()[0], CraftingHelper.getIngredient(entry.getValue(), context));
}
ret += output;
throw new RuntimeException(ret);
}
}
ingMap.put(' ', Ingredient.EMPTY);
input = new Object[width * height];
int x = 0;
JsonArray patternJ = JsonUtils.getJsonArray(json, "pattern");
for(char chr : shape.toCharArray())
{
input[x++] = itemMap.get(chr);
}
}
if (patternJ.size() == 0)
throw new JsonSyntaxException("Invalid pattern: empty pattern not allowed");
@Override
public ItemStack getCraftingResult(InventoryCrafting inv)
{
return RecipeUtils.getCraftingResult(inv, output.copy());
}
String[] pattern = new String[patternJ.size()];
for (int x = 0; x < pattern.length; ++x)
{
String line = JsonUtils.getString(patternJ.get(x), "pattern[" + x + "]");
if (x > 0 && pattern[0].length() != line.length())
throw new JsonSyntaxException("Invalid pattern: each row must be the same width");
pattern[x] = line;
}
@Override
public int getRecipeSize()
{
return input.length;
}
CraftingHelper.ShapedPrimer primer = new CraftingHelper.ShapedPrimer();
primer.width = pattern[0].length();
primer.height = pattern.length;
primer.mirrored = JsonUtils.getBoolean(json, "mirrored", true);
primer.input = NonNullList.withSize(primer.width * primer.height, Ingredient.EMPTY);
@Override
public ItemStack getRecipeOutput()
{
return output;
}
Set<Character> keys = Sets.newHashSet(ingMap.keySet());
keys.remove(' ');
@Override
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
int x = 0;
for (String line : pattern)
{
for (char chr : line.toCharArray())
{
Ingredient ing = ingMap.get(chr);
if (ing == null)
throw new JsonSyntaxException("Pattern references symbol '" + chr + "' but it's not defined in the key");
primer.input.set(x++, ing);
keys.remove(chr);
}
}
@Override
public boolean matches(InventoryCrafting inv, World world)
{
for(int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
{
for(int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
{
if(checkMatch(inv, x, y, true))
{
return true;
}
if (!keys.isEmpty())
throw new JsonSyntaxException("Key defines symbols that aren't used in pattern: " + keys);
if(mirrored && checkMatch(inv, x, y, false))
{
return true;
}
}
}
ItemStack result = CraftingHelper.getItemStack(JsonUtils.getJsonObject(json, "result"), context);
return new ShapedMekanismRecipe(group.isEmpty() ? null : new ResourceLocation(group), result, primer);
}
return false;
}
private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolean mirror)
{
for(int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++)
{
for(int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++)
{
int subX = x - startX;
int subY = y - startY;
Object target = null;
if(subX >= 0 && subY >= 0 && subX < width && subY < height)
{
if(mirror)
{
target = input[width - subX - 1 + subY * width];
}
else {
target = input[subX + subY * width];
}
}
ItemStack slot = inv.getStackInRowAndColumn(x, y);
if(target instanceof ItemStack)
{
if(!RecipeUtils.areItemsEqualForCrafting((ItemStack)target, slot))
{
return false;
}
}
else if(target instanceof Iterable)
{
boolean matched = false;
for(ItemStack item : (Iterable<ItemStack>)target)
{
matched = matched || RecipeUtils.areItemsEqualForCrafting(item, slot);
}
if(!matched)
{
return false;
}
}
else if(target == null && !slot.isEmpty())
{
return false;
}
}
}
return true;
}
public ShapedMekanismRecipe setMirrored(boolean mirror)
{
mirrored = mirror;
return this;
}
public Object[] getInput()
{
return input;
}
public static ShapedMekanismRecipe create(NBTTagCompound nbtTags)
{
if(!nbtTags.hasKey("result") || !nbtTags.hasKey("input"))
{
Mekanism.logger.error("[Mekanism] Shaped recipe parse error: missing input or result compound tag.");
return null;
}
ItemStack result = InventoryUtils.loadFromNBT(nbtTags.getCompoundTag("result"));
NBTTagList list = nbtTags.getTagList("input", NBT.TAG_COMPOUND);
if(result.isEmpty() || list.tagCount() == 0)
{
Mekanism.logger.error("[Mekanism] Shaped recipe parse error: invalid result stack or input data list.");
return null;
}
Object[] ret = new Object[list.tagCount()];
for(int i = 0; i < list.tagCount(); i++)
{
NBTTagCompound compound = list.getCompoundTagAt(i);
if(compound.hasKey("oredict"))
{
ret[i] = compound.getString("oredict");
}
else if(compound.hasKey("pattern"))
{
ret[i] = compound.getString("pattern");
}
else if(compound.hasKey("character"))
{
String s = compound.getString("character");
if(s.length() > 1)
{
Mekanism.logger.error("[Mekanism] Shaped recipe parse error: invalid pattern character data.");
return null;
}
ret[i] = compound.getString("character").toCharArray()[0];
}
else if(compound.hasKey("itemstack"))
{
ret[i] = InventoryUtils.loadFromNBT(compound.getCompoundTag("itemstack"));
}
else {
Mekanism.logger.error("[Mekanism] Shaped recipe parse error: invalid input tag data key.");
return null;
}
}
return new ShapedMekanismRecipe(result, ret);
}
// Used in _factories.json
public static class RecipeFactory implements IRecipeFactory
{
@Override
public IRecipe parse(JsonContext context, JsonObject json)
{
return ShapedMekanismRecipe.factory(context, json);
}
}
}
@@ -1,9 +1,8 @@
package mekanism.common.recipe;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import mekanism.common.Mekanism;
import mekanism.common.util.InventoryUtils;
import mekanism.common.util.RecipeUtils;
@@ -12,178 +11,112 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.JsonUtils;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.common.crafting.IRecipeFactory;
import net.minecraftforge.common.crafting.JsonContext;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.oredict.ShapelessOreRecipe;
public class ShapelessMekanismRecipe implements IRecipe
{
private ItemStack output = ItemStack.EMPTY;
private ArrayList<Object> input = new ArrayList<Object>();
import javax.annotation.Nonnull;
public ShapelessMekanismRecipe(Block result, Object... recipe){ this(new ItemStack(result), recipe); }
public ShapelessMekanismRecipe(Item result, Object... recipe){ this(new ItemStack(result), recipe); }
public ShapelessMekanismRecipe(ItemStack result, Object... recipe)
public class ShapelessMekanismRecipe extends ShapelessOreRecipe {
public ShapelessMekanismRecipe(ResourceLocation group, Block result, Object... recipe)
{
output = result.copy();
for(Object obj : recipe)
{
if(obj instanceof ItemStack)
{
input.add(((ItemStack)obj).copy());
}
else if(obj instanceof Item)
{
input.add(new ItemStack((Item)obj));
}
else if(obj instanceof Block)
{
input.add(new ItemStack((Block)obj));
}
else if(obj instanceof String)
{
input.add(OreDictionary.getOres((String)obj));
}
else {
String ret = "Invalid shapeless Mekanism recipe: ";
for(Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
this(group, new ItemStack(result), recipe);
}
@Override
public int getRecipeSize()
{
return input.size();
}
@Override
public ItemStack getRecipeOutput()
{
return output;
}
@Override
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
public ShapelessMekanismRecipe(ResourceLocation group, Item result, Object... recipe)
{
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
this(group, new ItemStack(result), recipe);
}
@Override
public ItemStack getCraftingResult(InventoryCrafting inv)
{
return RecipeUtils.getCraftingResult(inv, output.copy());
}
@SuppressWarnings("unchecked")
@Override
public boolean matches(InventoryCrafting inv, World world)
public ShapelessMekanismRecipe(ResourceLocation group, NonNullList<Ingredient> input, @Nonnull ItemStack result)
{
ArrayList<Object> required = new ArrayList<Object>(input);
for(int x = 0; x < inv.getSizeInventory(); x++)
{
ItemStack slot = inv.getStackInSlot(x);
if(!slot.isEmpty())
{
boolean inRecipe = false;
Iterator<Object> req = required.iterator();
while(req.hasNext())
{
boolean match = false;
Object next = req.next();
if(next instanceof ItemStack)
{
match = RecipeUtils.areItemsEqualForCrafting((ItemStack)next, slot);
}
else if(next instanceof List)
{
Iterator<ItemStack> itr = ((List<ItemStack>)next).iterator();
while(itr.hasNext() && !match)
{
match = RecipeUtils.areItemsEqualForCrafting(itr.next(), slot);
}
}
if(match)
{
inRecipe = true;
required.remove(next);
break;
}
}
if(!inRecipe)
{
return false;
}
}
}
return required.isEmpty();
super(group, input, result);
}
public ArrayList<Object> getInput()
public ShapelessMekanismRecipe(ResourceLocation group, @Nonnull ItemStack result, Object... recipe)
{
return input;
super(group, result, recipe);
}
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull InventoryCrafting inv)
{
return RecipeUtils.getCraftingResult(inv, output);
}
public static ShapelessMekanismRecipe create(NBTTagCompound nbtTags)
{
if(!nbtTags.hasKey("result") || !nbtTags.hasKey("input"))
{
Mekanism.logger.error("[Mekanism] Shapeless recipe parse error: missing input or result compound tag.");
return null;
}
ItemStack result = InventoryUtils.loadFromNBT(nbtTags.getCompoundTag("result"));
NBTTagList list = nbtTags.getTagList("input", NBT.TAG_COMPOUND);
if(result.isEmpty() || list.tagCount() == 0)
{
Mekanism.logger.error("[Mekanism] Shapeless recipe parse error: invalid result stack or input data list.");
return null;
}
Object[] ret = new Object[list.tagCount()];
for(int i = 0; i < list.tagCount(); i++)
{
NBTTagCompound compound = list.getCompoundTagAt(i);
if(compound.hasKey("oredict"))
{
ret[i] = compound.getString("oredict");
}
else if(compound.hasKey("itemstack"))
{
ret[i] = InventoryUtils.loadFromNBT(compound.getCompoundTag("itemstack"));
}
else {
Mekanism.logger.error("[Mekanism] Shapeless recipe parse error: invalid input tag data key.");
return null;
}
}
return new ShapelessMekanismRecipe(result, ret);
if(!nbtTags.hasKey("result") || !nbtTags.hasKey("input"))
{
Mekanism.logger.error("[Mekanism] Shapeless recipe parse error: missing input or result compound tag.");
return null;
}
ItemStack result = InventoryUtils.loadFromNBT(nbtTags.getCompoundTag("result"));
NBTTagList list = nbtTags.getTagList("input", Constants.NBT.TAG_COMPOUND);
if(result.isEmpty() || list.tagCount() == 0)
{
Mekanism.logger.error("[Mekanism] Shapeless recipe parse error: invalid result stack or input data list.");
return null;
}
Object[] ret = new Object[list.tagCount()];
for(int i = 0; i < list.tagCount(); i++)
{
NBTTagCompound compound = list.getCompoundTagAt(i);
if(compound.hasKey("oredict"))
{
ret[i] = compound.getString("oredict");
}
else if(compound.hasKey("itemstack"))
{
ret[i] = InventoryUtils.loadFromNBT(compound.getCompoundTag("itemstack"));
}
else {
Mekanism.logger.error("[Mekanism] Shapeless recipe parse error: invalid input tag data key.");
return null;
}
}
return new ShapelessMekanismRecipe(null, result, ret); //TODO Find out correct value for group
}
// Copy of net.minecraftforge.oredict.ShapelessOreRecipe
public static ShapelessMekanismRecipe factory(JsonContext context, JsonObject json)
{
String group = JsonUtils.getString(json, "group", "");
NonNullList<Ingredient> ings = NonNullList.create();
for (JsonElement ele : JsonUtils.getJsonArray(json, "ingredients"))
ings.add(CraftingHelper.getIngredient(ele, context));
if (ings.isEmpty())
throw new JsonParseException("No ingredients for shapeless recipe");
ItemStack itemstack = ShapedRecipes.deserializeItem(JsonUtils.getJsonObject(json, "result"), true);
return new ShapelessMekanismRecipe(group.isEmpty() ? null : new ResourceLocation(group), ings, itemstack);
}
// Used in _factories.json
public static class RecipeFactory implements IRecipeFactory
{
@Override
public IRecipe parse(JsonContext context, JsonObject json)
{
return ShapelessMekanismRecipe.factory(context, json);
}
}
}
@@ -93,7 +93,6 @@ import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import cofh.api.item.IToolHammer;
/**
@@ -280,7 +279,7 @@ public final class MekanismUtils
*/
public static void addRecipe(ItemStack output, Object[] params)
{
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(output, params));
// CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(output, params));
}
/**
@@ -966,23 +965,23 @@ public final class MekanismUtils
{
boolean didRemove = false;
for(Iterator itr = CraftingManager.getInstance().getRecipeList().iterator(); itr.hasNext();)
{
Object obj = itr.next();
if(obj instanceof IRecipe && ((IRecipe)obj).getRecipeOutput() != null)
{
for(ItemStack itemStack : itemStacks)
{
if(((IRecipe)obj).getRecipeOutput().isItemEqual(itemStack))
{
itr.remove();
didRemove = true;
break;
}
}
}
}
// for(Iterator itr = CraftingManager.getInstance().getRecipeList().iterator(); itr.hasNext();)
// {
// Object obj = itr.next();
//
// if(obj instanceof IRecipe && ((IRecipe)obj).getRecipeOutput() != null)
// {
// for(ItemStack itemStack : itemStacks)
// {
// if(((IRecipe)obj).getRecipeOutput().isItemEqual(itemStack))
// {
// itr.remove();
// didRemove = true;
// break;
// }
// }
// }
// }
return didRemove;
}
@@ -1351,15 +1350,15 @@ public final class MekanismUtils
return new ItemStack(dmgItems.get(0).getItem(), 1, solve);
}
List<IRecipe> list = (List<IRecipe>)((ArrayList<IRecipe>)CraftingManager.getInstance().getRecipeList()).clone();
for(IRecipe recipe : list)
{
if(recipe.matches(inv, world))
{
return recipe.getCraftingResult(inv);
}
}
// List<IRecipe> list = (List<IRecipe>)((ArrayList<IRecipe>)CraftingManager.getInstance().getRecipeList()).clone();
//
// for(IRecipe recipe : list)
// {
// if(recipe.matches(inv, world))
// {
// return recipe.getCraftingResult(inv);
// }
// }
return ItemStack.EMPTY;
}
@@ -15,14 +15,11 @@ import mekanism.common.base.ITierItem;
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
import mekanism.common.block.states.BlockStateMachine;
import mekanism.common.inventory.InventoryBin;
import mekanism.common.recipe.ShapedMekanismRecipe;
import mekanism.common.recipe.ShapelessMekanismRecipe;
import mekanism.common.security.ISecurityItem;
import net.minecraft.block.Block;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
@@ -298,37 +295,37 @@ public class RecipeUtils
public static boolean removeRecipes(ItemStack stack)
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for(Iterator<IRecipe> iter = recipes.iterator(); iter.hasNext();)
{
IRecipe iterRecipe = iter.next();
if(iterRecipe instanceof ShapedMekanismRecipe || iterRecipe instanceof ShapelessMekanismRecipe)
{
if(StackUtils.equalsWildcard(stack, iterRecipe.getRecipeOutput()))
{
iter.remove();
}
}
}
// List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
//
// for(Iterator<IRecipe> iter = recipes.iterator(); iter.hasNext();)
// {
// IRecipe iterRecipe = iter.next();
//
// if(iterRecipe instanceof ShapedMekanismRecipe || iterRecipe instanceof ShapelessMekanismRecipe)
// {
// if(StackUtils.equalsWildcard(stack, iterRecipe.getRecipeOutput()))
// {
// iter.remove();
// }
// }
// }
return false;
}
public static IRecipe getRecipeFromGrid(InventoryCrafting inv, World world)
{
List<IRecipe> list = new ArrayList<IRecipe>(CraftingManager.getInstance().getRecipeList());
for(Iterator<IRecipe> iter = list.iterator(); iter.hasNext();)
{
IRecipe recipe = iter.next();
if(recipe.matches(inv, world))
{
return recipe;
}
}
// List<IRecipe> list = new ArrayList<IRecipe>(CraftingManager.getInstance().getRecipeList());
//
// for(Iterator<IRecipe> iter = list.iterator(); iter.hasNext();)
// {
// IRecipe recipe = iter.next();
//
// if(recipe.matches(inv, world))
// {
// return recipe;
// }
// }
return null;
}
@@ -1,18 +0,0 @@
package mekanism.generators.client.jei;
import mekanism.client.jei.MekanismJEI;
import mekanism.generators.common.GeneratorsBlocks;
import mezz.jei.api.BlankModPlugin;
import mezz.jei.api.ISubtypeRegistry;
import mezz.jei.api.JEIPlugin;
import net.minecraft.item.Item;
@JEIPlugin
public class GeneratorsJEI extends BlankModPlugin
{
@Override
public void registerItemSubtypes(ISubtypeRegistry registry)
{
registry.registerSubtypeInterpreter(Item.getItemFromBlock(GeneratorsBlocks.Generator), MekanismJEI.NBT_INTERPRETER);
}
}
@@ -7,6 +7,7 @@ import java.io.IOException;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasRegistry;
import mekanism.api.infuse.InfuseRegistry;
import mekanism.common.Foo;
import mekanism.common.FuelHandler;
import mekanism.common.Mekanism;
import mekanism.common.MekanismBlocks;
@@ -22,7 +23,6 @@ import mekanism.common.config.MekanismConfig.generators;
import mekanism.common.multiblock.MultiblockManager;
import mekanism.common.network.PacketSimpleGui;
import mekanism.common.recipe.RecipeHandler;
import mekanism.common.recipe.ShapedMekanismRecipe;
import mekanism.common.util.MekanismUtils;
import mekanism.generators.common.block.states.BlockStateGenerator.GeneratorType;
import mekanism.generators.common.block.states.BlockStateReactor.ReactorBlockType;
@@ -30,7 +30,6 @@ import mekanism.generators.common.content.turbine.SynchronizedTurbineData;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
@@ -121,72 +120,6 @@ public class MekanismGenerators implements IModule
public void addRecipes()
{
GeneratorType.HEAT_GENERATOR.addRecipe(new ShapedMekanismRecipe(GeneratorType.HEAT_GENERATOR.getStack(), new Object[] {
"III", "WOW", "CFC", Character.valueOf('I'), "ingotIron", Character.valueOf('C'), "ingotCopper", Character.valueOf('O'), "ingotOsmium", Character.valueOf('F'), Blocks.FURNACE, Character.valueOf('W'), "plankWood"
}));
GeneratorType.SOLAR_GENERATOR.addRecipe(new ShapedMekanismRecipe(GeneratorType.SOLAR_GENERATOR.getStack(), new Object[] {
"SSS", "AIA", "PEP", Character.valueOf('S'), GeneratorsItems.SolarPanel, Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('I'), "ingotIron", Character.valueOf('P'), "dustOsmium", Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem()
}));
GeneratorType.ADVANCED_SOLAR_GENERATOR.addRecipe(new ShapedMekanismRecipe(GeneratorType.ADVANCED_SOLAR_GENERATOR.getStack(), new Object[] {
"SES", "SES", "III", Character.valueOf('S'), GeneratorType.SOLAR_GENERATOR.getStack(), Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('I'), "ingotIron"
}));
GeneratorType.BIO_GENERATOR.addRecipe(new ShapedMekanismRecipe(GeneratorType.BIO_GENERATOR.getStack(), new Object[] {
"RER", "BCB", "NEN", Character.valueOf('R'), "dustRedstone", Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('B'), MekanismItems.BioFuel, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('N'), "ingotIron"
}));
GeneratorType.GAS_GENERATOR.addRecipe(new ShapedMekanismRecipe(GeneratorType.GAS_GENERATOR.getStack(), new Object[] {
"PEP", "ICI", "PEP", Character.valueOf('P'), "ingotOsmium", Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('C'), MekanismItems.ElectrolyticCore
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(GeneratorsItems.SolarPanel), new Object[] {
"GGG", "RAR", "PPP", Character.valueOf('G'), "paneGlass", Character.valueOf('R'), "dustRedstone", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('P'), "ingotOsmium"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(GeneratorsBlocks.Generator, 1, 6), new Object[] {
" O ", "OAO", "ECE", Character.valueOf('O'), "ingotOsmium", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(GeneratorsItems.TurbineBlade), new Object[] {
" S ", "SAS", " S ", Character.valueOf('S'), "ingotSteel", Character.valueOf('A'), MekanismItems.EnrichedAlloy
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(GeneratorsBlocks.Generator, 1, 7), new Object[] {
"SAS", "SAS", "SAS", Character.valueOf('S'), "ingotSteel", Character.valueOf('A'), MekanismItems.EnrichedAlloy
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(GeneratorsBlocks.Generator, 1, 8), new Object[] {
"SAS", "CAC", "SAS", Character.valueOf('S'), "ingotSteel", Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(GeneratorsBlocks.Generator, 1, 9), new Object[] {
"SGS", "GEG", "SGS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), "ingotGold", Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem()
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(GeneratorsBlocks.Generator, 4, 10), new Object[] {
" S ", "SOS", " S ", Character.valueOf('S'), "ingotSteel", Character.valueOf('O'), "ingotOsmium"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(GeneratorsBlocks.Generator, 2, 11), new Object[] {
" I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(GeneratorsBlocks.Generator, 1, 10), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(GeneratorsBlocks.Generator, 2, 12), new Object[] {
" I ", "IFI", " I ", Character.valueOf('I'), new ItemStack(GeneratorsBlocks.Generator, 1, 10), Character.valueOf('F'), Blocks.IRON_BARS
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(GeneratorsBlocks.Generator, 1, 13), new Object[] {
"STS", "TBT", "STS", Character.valueOf('S'), "ingotSteel", Character.valueOf('T'), "ingotTin", Character.valueOf('B'), Items.BUCKET
}));
//Reactor Recipes
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(ReactorBlockType.REACTOR_FRAME.getStack(4), new Object[] {
" C ", "CAC", " C ", Character.valueOf('C'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('A'), "alloyUltimate"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(ReactorBlockType.REACTOR_PORT.getStack(2), new Object[] {
" I ", "ICI", " I ", Character.valueOf('I'), ReactorBlockType.REACTOR_FRAME.getStack(1), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ULTIMATE)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(ReactorBlockType.REACTOR_GLASS.getStack(4), new Object[] {
" I ", "IGI", " I ", Character.valueOf('I'), ReactorBlockType.REACTOR_FRAME.getStack(1), Character.valueOf('G'), "blockGlass"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(ReactorBlockType.REACTOR_CONTROLLER.getStack(1), new Object[] {
"CGC", "ITI", "III", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ULTIMATE), Character.valueOf('G'), "paneGlass", Character.valueOf('I'), ReactorBlockType.REACTOR_FRAME.getStack(1), Character.valueOf('T'), MekanismUtils.getEmptyGasTank(GasTankTier.BASIC)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(ReactorBlockType.LASER_FOCUS_MATRIX.getStack(2), new Object[] {
" I ", "ILI", " I ", Character.valueOf('I'), ReactorBlockType.REACTOR_GLASS.getStack(1), Character.valueOf('L'), "blockRedstone"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(ReactorBlockType.REACTOR_LOGIC_ADAPTER.getStack(1), new Object[] {
" R ", "RFR", " R ", Character.valueOf('R'), "dustRedstone", Character.valueOf('F'), ReactorBlockType.REACTOR_FRAME.getStack(1)
}));
FuelHandler.addGas(MekanismFluids.Ethene, general.ETHENE_BURN_TIME, general.FROM_H2 + generators.bioGeneration * 2 * general.ETHENE_BURN_TIME); //1mB hydrogen + 2*bioFuel/tick*200ticks/100mB * 20x efficiency bonus
}
@@ -11,7 +11,6 @@ import mekanism.common.block.states.BlockStateBasic;
import mekanism.common.block.states.BlockStateFacing;
import mekanism.common.config.MekanismConfig.general;
import mekanism.common.config.MekanismConfig.generators;
import mekanism.common.recipe.ShapedMekanismRecipe;
import mekanism.common.util.LangUtils;
import mekanism.generators.common.GeneratorsBlocks;
import mekanism.generators.common.block.BlockGenerator;
@@ -123,7 +122,7 @@ public class BlockStateGenerator extends ExtendedBlockState
public double maxEnergy;
public Class<? extends TileEntity> tileEntityClass;
public boolean hasModel;
public Collection<ShapedMekanismRecipe> blockRecipes = new HashSet<ShapedMekanismRecipe>();
// public Collection<ShapedMekanismRecipe> blockRecipes = new HashSet<ShapedMekanismRecipe>();
public Predicate<EnumFacing> facingPredicate;
public boolean activable;
@@ -172,24 +171,24 @@ public class BlockStateGenerator extends ExtendedBlockState
return generators.generatorsManager.isEnabled(blockName);
}
@Override
public void addRecipes(Collection<ShapedMekanismRecipe> recipes)
{
blockRecipes.addAll(recipes);
}
// @Override
// public void addRecipes(Collection<ShapedMekanismRecipe> recipes)
// {
// blockRecipes.addAll(recipes);
// }
//
// @Override
// public void addRecipe(ShapedMekanismRecipe recipe)
// {
// blockRecipes.add(recipe);
// }
//
// @Override
// public Collection<ShapedMekanismRecipe> getRecipes()
// {
// return blockRecipes;
// }
@Override
public void addRecipe(ShapedMekanismRecipe recipe)
{
blockRecipes.add(recipe);
}
@Override
public Collection<ShapedMekanismRecipe> getRecipes()
{
return blockRecipes;
}
public static GeneratorType get(IBlockState state)
{
if(state.getBlock() instanceof BlockGenerator)
@@ -6,11 +6,11 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import mekanism.common.Foo;
import mekanism.common.Mekanism;
import mekanism.common.Version;
import mekanism.common.base.IModule;
import mekanism.common.config.MekanismConfig.tools;
import mekanism.common.recipe.ShapedMekanismRecipe;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.init.Items;
@@ -19,7 +19,6 @@ import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
@@ -87,226 +86,10 @@ public class MekanismTools implements IModule
//Load the proxy
proxy.loadConfiguration();
//Load this module
addRecipes();
//Finalization
Mekanism.logger.info("Loaded MekanismTools module.");
}
public void addRecipes()
{
//Crafting Recipes
//Base
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.WoodPaxel, 1), new Object[] {
"XYZ", " T ", " T ", Character.valueOf('X'), Items.WOODEN_AXE, Character.valueOf('Y'), Items.WOODEN_PICKAXE, Character.valueOf('Z'), Items.WOODEN_SHOVEL, Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.StonePaxel, 1), new Object[] {
"XYZ", " T ", " T ", Character.valueOf('X'), Items.STONE_AXE, Character.valueOf('Y'), Items.STONE_PICKAXE, Character.valueOf('Z'), Items.STONE_SHOVEL, Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.IronPaxel, 1), new Object[] {
"XYZ", " T ", " T ", Character.valueOf('X'), Items.IRON_AXE, Character.valueOf('Y'), Items.IRON_PICKAXE, Character.valueOf('Z'), Items.IRON_SHOVEL, Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.DiamondPaxel, 1), new Object[] {
"XYZ", " T ", " T ", Character.valueOf('X'), Items.DIAMOND_AXE, Character.valueOf('Y'), Items.DIAMOND_PICKAXE, Character.valueOf('Z'), Items.DIAMOND_SHOVEL, Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GoldPaxel, 1), new Object[] {
"XYZ", " T ", " T ", Character.valueOf('X'), Items.GOLDEN_AXE, Character.valueOf('Y'), Items.GOLDEN_PICKAXE, Character.valueOf('Z'), Items.GOLDEN_SHOVEL, Character.valueOf('T'), Items.STICK
}));
//Obsidian
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.ObsidianHelmet, 1), new Object[] {
"***", "* *", Character.valueOf('*'), "ingotRefinedObsidian"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.ObsidianChestplate, 1), new Object[] {
"* *", "***", "***", Character.valueOf('*'), "ingotRefinedObsidian"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.ObsidianLeggings, 1), new Object[] {
"***", "* *", "* *", Character.valueOf('*'), "ingotRefinedObsidian"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.ObsidianBoots, 1), new Object[] {
"* *", "* *", Character.valueOf('*'), "ingotRefinedObsidian"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.ObsidianPaxel, 1), new Object[] {
"XYZ", " T ", " T ", Character.valueOf('X'), ToolsItems.ObsidianAxe, Character.valueOf('Y'), ToolsItems.ObsidianPickaxe, Character.valueOf('Z'), ToolsItems.ObsidianShovel, Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.ObsidianPickaxe, 1), new Object[] {
"XXX", " T ", " T ", Character.valueOf('X'), "ingotRefinedObsidian", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.ObsidianAxe, 1), new Object[] {
"XX", "XT", " T", Character.valueOf('X'), "ingotRefinedObsidian", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.ObsidianShovel, 1), new Object[] {
"X", "T", "T", Character.valueOf('X'), "ingotRefinedObsidian", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.ObsidianHoe, 1), new Object[] {
"XX", " T", " T", Character.valueOf('X'), "ingotRefinedObsidian", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.ObsidianSword, 1), new Object[] {
"X", "X", "T", Character.valueOf('X'), "ingotRefinedObsidian", Character.valueOf('T'), Items.STICK
}));
//Glowstone
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GlowstonePaxel, 1), new Object[] {
"XYZ", " T ", " T ", Character.valueOf('X'), ToolsItems.GlowstoneAxe, Character.valueOf('Y'), ToolsItems.GlowstonePickaxe, Character.valueOf('Z'), ToolsItems.GlowstoneShovel, Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GlowstonePickaxe, 1), new Object[] {
"XXX", " T ", " T ", Character.valueOf('X'), "ingotRefinedGlowstone", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GlowstoneAxe, 1), new Object[] {
"XX", "XT", " T", Character.valueOf('X'), "ingotRefinedGlowstone", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GlowstoneShovel, 1), new Object[] {
"X", "T", "T", Character.valueOf('X'), "ingotRefinedGlowstone", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GlowstoneHoe, 1), new Object[] {
"XX", " T", " T", Character.valueOf('X'), "ingotRefinedGlowstone", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GlowstoneSword, 1), new Object[] {
"X", "X", "T", Character.valueOf('X'), "ingotRefinedGlowstone", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GlowstoneHelmet, 1), new Object[] {
"***", "* *", Character.valueOf('*'), "ingotRefinedGlowstone"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GlowstoneChestplate, 1), new Object[] {
"* *", "***", "***", Character.valueOf('*'), "ingotRefinedGlowstone"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GlowstoneLeggings, 1), new Object[] {
"***", "* *", "* *", Character.valueOf('*'), "ingotRefinedGlowstone"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.GlowstoneBoots, 1), new Object[] {
"* *", "* *", Character.valueOf('*'), "ingotRefinedGlowstone"
}));
//Lazuli
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.LazuliHelmet, 1), new Object[] {
"***", "* *", Character.valueOf('*'), new ItemStack(Items.DYE, 1, 4)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.LazuliChestplate, 1), new Object[] {
"* *", "***", "***", Character.valueOf('*'), new ItemStack(Items.DYE, 1, 4)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.LazuliLeggings, 1), new Object[] {
"***", "* *", "* *", Character.valueOf('*'), new ItemStack(Items.DYE, 1, 4)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.LazuliBoots, 1), new Object[] {
"* *", "* *", Character.valueOf('*'), new ItemStack(Items.DYE, 1, 4)
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.LazuliPaxel, 1), new Object[] {
"XYZ", " T ", " T ", Character.valueOf('X'), ToolsItems.LazuliAxe, Character.valueOf('Y'), ToolsItems.LazuliPickaxe, Character.valueOf('Z'), ToolsItems.LazuliShovel, Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.LazuliPickaxe, 1), new Object[] {
"XXX", " T ", " T ", Character.valueOf('X'), new ItemStack(Items.DYE, 1, 4), Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.LazuliAxe, 1), new Object[] {
"XX", "XT", " T", Character.valueOf('X'), new ItemStack(Items.DYE, 1, 4), Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.LazuliShovel, 1), new Object[] {
"X", "T", "T", Character.valueOf('X'), new ItemStack(Items.DYE, 1, 4), Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.LazuliHoe, 1), new Object[] {
"XX", " T", " T", Character.valueOf('X'), new ItemStack(Items.DYE, 1, 4), Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.LazuliSword, 1), new Object[] {
"X", "X", "T", Character.valueOf('X'), new ItemStack(Items.DYE, 1, 4), Character.valueOf('T'), Items.STICK
}));
//Osmium
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.OsmiumPaxel, 1), new Object[] {
"XYZ", " T ", " T ", Character.valueOf('X'), ToolsItems.OsmiumAxe, Character.valueOf('Y'), ToolsItems.OsmiumPickaxe, Character.valueOf('Z'), ToolsItems.OsmiumShovel, Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.OsmiumPickaxe, 1), new Object[] {
"XXX", " T ", " T ", Character.valueOf('X'), "ingotOsmium", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.OsmiumAxe, 1), new Object[] {
"XX", "XT", " T", Character.valueOf('X'), "ingotOsmium", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.OsmiumShovel, 1), new Object[] {
"X", "T", "T", Character.valueOf('X'), "ingotOsmium", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.OsmiumHoe, 1), new Object[] {
"XX", " T", " T", Character.valueOf('X'), "ingotOsmium", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.OsmiumSword, 1), new Object[] {
"X", "X", "T", Character.valueOf('X'), "ingotOsmium", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.OsmiumHelmet, 1), new Object[] {
"***", "* *", Character.valueOf('*'), "ingotOsmium"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.OsmiumChestplate, 1), new Object[] {
"* *", "***", "***", Character.valueOf('*'), "ingotOsmium"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.OsmiumLeggings, 1), new Object[] {
"***", "* *", "* *", Character.valueOf('*'), "ingotOsmium"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.OsmiumBoots, 1), new Object[] {
"* *", "* *", Character.valueOf('*'), "ingotOsmium"
}));
//Bronze
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.BronzePaxel, 1), new Object[] {
"XYZ", " T ", " T ", Character.valueOf('X'), ToolsItems.BronzeAxe, Character.valueOf('Y'), ToolsItems.BronzePickaxe, Character.valueOf('Z'), ToolsItems.BronzeShovel, Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.BronzePickaxe, 1), new Object[] {
"XXX", " T ", " T ", Character.valueOf('X'), "ingotBronze", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.BronzeAxe, 1), new Object[] {
"XX", "XT", " T", Character.valueOf('X'), "ingotBronze", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.BronzeShovel, 1), new Object[] {
"X", "T", "T", Character.valueOf('X'), "ingotBronze", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.BronzeHoe, 1), new Object[] {
"XX", " T", " T", Character.valueOf('X'), "ingotBronze", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.BronzeSword, 1), new Object[] {
"X", "X", "T", Character.valueOf('X'), "ingotBronze", Character.valueOf('T'), Items.STICK
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.BronzeHelmet, 1), new Object[] {
"***", "* *", Character.valueOf('*'), "ingotBronze"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.BronzeChestplate, 1), new Object[] {
"* *", "***", "***", Character.valueOf('*'), "ingotBronze"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.BronzeLeggings, 1), new Object[] {
"***", "* *", "* *", Character.valueOf('*'), "ingotBronze"
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.BronzeBoots, 1), new Object[] {
"* *", "* *", Character.valueOf('*'), "ingotBronze"
}));
//Steel
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.SteelPaxel, 1), new Object[] {
"XYZ", " I ", " I ", Character.valueOf('X'), ToolsItems.SteelAxe, Character.valueOf('Y'), ToolsItems.SteelPickaxe, Character.valueOf('Z'), ToolsItems.SteelShovel, Character.valueOf('I'), Items.IRON_INGOT
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.SteelPickaxe, 1), new Object[] {
"XXX", " I ", " I ", Character.valueOf('X'), "ingotSteel", Character.valueOf('I'), Items.IRON_INGOT
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.SteelAxe, 1), new Object[] {
"XX", "XI", " I", Character.valueOf('X'), "ingotSteel", Character.valueOf('I'), Items.IRON_INGOT
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.SteelShovel, 1), new Object[] {
"X", "I", "I", Character.valueOf('X'), "ingotSteel", Character.valueOf('I'), Items.IRON_INGOT
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.SteelHoe, 1), new Object[] {
"XX", " I", " I", Character.valueOf('X'), "ingotSteel", Character.valueOf('I'), Items.IRON_INGOT
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.SteelSword, 1), new Object[] {
"X", "X", "I", Character.valueOf('X'), "ingotSteel", Character.valueOf('I'), Items.IRON_INGOT
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.SteelHelmet, 1), new Object[] {
"***", "I I", Character.valueOf('*'), "ingotSteel", Character.valueOf('I'), Items.IRON_INGOT
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.SteelChestplate, 1), new Object[] {
"I I", "*I*", "***", Character.valueOf('*'), "ingotSteel", Character.valueOf('I'), Items.IRON_INGOT
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.SteelLeggings, 1), new Object[] {
"I*I", "* *", "* *", Character.valueOf('*'), "ingotSteel", Character.valueOf('I'), Items.IRON_INGOT
}));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(ToolsItems.SteelBoots, 1), new Object[] {
"I *", "* I", Character.valueOf('*'), "ingotSteel", Character.valueOf('I'), Items.IRON_INGOT
}));
}
public void addItems()
{
//Tools