This commit is contained in:
Modmuss50 2015-11-23 14:49:35 +00:00
parent fa9cd98b5a
commit abb9b5102f
65 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,158 @@
package techreborn.compat.nei;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import reborncore.common.util.ItemUtils;
import techreborn.api.reactor.FusionReactorRecipe;
import techreborn.api.reactor.FusionReactorRecipeHelper;
import techreborn.client.gui.GuiFusionReactor;
import java.awt.*;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class FustionReacorRecipeHandler extends TemplateRecipeHandler {
public class CachedReactorRecipe extends CachedRecipe {
private List<PositionedStack> input = new ArrayList<PositionedStack>();
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
public Point focus;
public FusionReactorRecipe recipe;
public CachedReactorRecipe(FusionReactorRecipe recipe) {
this.recipe = recipe;
addPositionedStacks(input, outputs, recipe);
}
@Override
public List<PositionedStack> getIngredients() {
return this.getCycledIngredients(cycleticks / 20, this.input);
}
@Override
public List<PositionedStack> getOtherStacks() {
return this.outputs;
}
@Override
public PositionedStack getResult() {
return null;
}
}
@Override
public void drawBackground(int recipeIndex) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(0, 0, 4, 4, 166, 78);
GuiDraw.drawTooltipBox(10, 80, 145, 50);
GuiDraw.drawString("Info:", 14, 84, -1);
CachedRecipe recipe = arecipes.get(recipeIndex);
if (recipe instanceof CachedReactorRecipe) {
CachedReactorRecipe genericRecipe = (CachedReactorRecipe) recipe;
float scale = 0.9F;
GL11.glScalef(scale, scale, scale);
DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);
DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols();
symbols.setGroupingSeparator('.');
formatter.setDecimalFormatSymbols(symbols);
GuiDraw.drawString("Start: " + formatter.format(genericRecipe.recipe.getStartEU()) + "EU", 16, 105, -1);
GuiDraw.drawString("EU/t: " + genericRecipe.recipe.getEuTick() , 16, 115, -1);
GuiDraw.drawString("Ticks to process: " + genericRecipe.recipe.getTickTime(), 14, 125, -1);
GuiDraw.drawString("Time to process: " + genericRecipe.recipe.getTickTime() / 20 + " seconds", 14, 135, -1);
}
}
@Override
public int recipiesPerPage() {
return 1;
}
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals(getRecipeName())) {
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
addCached(recipeType);
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
if (ItemUtils.isItemEqual(recipeType.getOutput(), result, true, false, true)) {
addCached(recipeType);
}
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
if (ItemUtils.isItemEqual(ingredient, recipeType.getTopInput(), true, false, true)) {
addCached(recipeType);
}
if (ItemUtils.isItemEqual(ingredient, recipeType.getBottomInput(), true, false, true)) {
addCached(recipeType);
}
}
}
private void addCached(FusionReactorRecipe recipie) {
this.arecipes.add(new CachedReactorRecipe(recipie));
}
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, FusionReactorRecipe recipeType) {
int offset = 4;
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getTopInput()), 88 - offset, 17 - offset, false);
input.add(pStack);
if(recipeType.getBottomInput() != null){
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getBottomInput()), 88 - offset, 53 - offset, false);
input.add(pStack2);
}
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(), 148 - offset, 35 - offset, false);
outputs.add(pStack3);
}
@Override
public String getRecipeName() {
return "Fustion Reactor";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/fusion_reactor.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiFusionReactor.class;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(82, 23, 52, 18), getRecipeName(), new Object[0]));
}
}

View file

@ -0,0 +1,82 @@
package techreborn.compat.nei;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
import techreborn.compat.nei.recipes.*;
import techreborn.lib.ModInfo;
public class NEIConfig implements IConfigureNEI {
@Override
public String getName() {
return ModInfo.MOD_ID;
}
@Override
public String getVersion() {
return ModInfo.MOD_VERSION;
}
@Override
public void loadConfig() {
ShapedRollingMachineHandler shapedRollingMachineHandler = new ShapedRollingMachineHandler();
ShapelessRollingMachineHandler shapelessRollingMachineHandler = new ShapelessRollingMachineHandler();
ImplosionCompressorRecipeHandler implosion = new ImplosionCompressorRecipeHandler();
API.registerUsageHandler(implosion);
API.registerRecipeHandler(implosion);
AlloySmelterRecipeHandler alloy = new AlloySmelterRecipeHandler();
API.registerUsageHandler(alloy);
API.registerRecipeHandler(alloy);
IronAlloySmelterRecipeHandler ironAlloy = new IronAlloySmelterRecipeHandler();
API.registerUsageHandler(ironAlloy);
API.registerRecipeHandler(ironAlloy);
IndustrialSawmillRecipeHandler sawmill = new IndustrialSawmillRecipeHandler();
API.registerUsageHandler(sawmill);
API.registerRecipeHandler(sawmill);
ChemicalReactorRecipeHandler chem = new ChemicalReactorRecipeHandler();
API.registerUsageHandler(chem);
API.registerRecipeHandler(chem);
CentrifugeRecipeHandler cent = new CentrifugeRecipeHandler();
API.registerUsageHandler(cent);
API.registerRecipeHandler(cent);
GrinderRecipeHandler grind = new GrinderRecipeHandler();
API.registerUsageHandler(grind);
API.registerRecipeHandler(grind);
IndustrialElectrolyzerRecipeHandler elec = new IndustrialElectrolyzerRecipeHandler();
API.registerUsageHandler(elec);
API.registerRecipeHandler(elec);
BlastFurnaceRecipeHandler blast = new BlastFurnaceRecipeHandler();
API.registerUsageHandler(blast);
API.registerRecipeHandler(blast);
API.registerUsageHandler(shapedRollingMachineHandler);
API.registerRecipeHandler(shapedRollingMachineHandler);
API.registerUsageHandler(shapelessRollingMachineHandler);
API.registerRecipeHandler(shapelessRollingMachineHandler);
AssemblingMachineRecipeHandler assemblingMachineRecipe = new AssemblingMachineRecipeHandler();
API.registerUsageHandler(assemblingMachineRecipe);
API.registerRecipeHandler(assemblingMachineRecipe);
FustionReacorRecipeHandler fustionReacorRecipeHandler = new FustionReacorRecipeHandler();
API.registerUsageHandler(fustionReacorRecipeHandler);
API.registerRecipeHandler(fustionReacorRecipeHandler);
VacuumFreezerRecipeHandler vacuumFreezerRecipe = new VacuumFreezerRecipeHandler();
API.registerUsageHandler(vacuumFreezerRecipe);
API.registerRecipeHandler(vacuumFreezerRecipe);
}
}

View file

@ -0,0 +1,111 @@
//Copy and pasted from https://github.com/Chicken-Bones/NotEnoughItems/blob/master/src/codechicken/nei/recipe/ShapedRecipeHandler.java
package techreborn.compat.nei;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.recipe.ShapedRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraftforge.oredict.ShapedOreRecipe;
import techreborn.api.RollingMachineRecipe;
import techreborn.client.gui.GuiRollingMachine;
import java.awt.*;
import java.util.List;
public class ShapedRollingMachineHandler extends ShapedRecipeHandler {
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiRollingMachine.class;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24,
18), "rollingcrafting", new Object[0]));
}
@Override
public String getRecipeName() {
return "Shaped Rolling Machine";
}
@Override
public String getOverlayIdentifier() {
return "rollingcrafting";
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("rollingcrafting")
&& getClass() == ShapedRollingMachineHandler.class) {
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
.getRecipeList()) {
CachedShapedRecipe recipe = null;
if (irecipe instanceof ShapedRecipes)
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
else if (irecipe instanceof ShapedOreRecipe)
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
if (recipe == null)
continue;
recipe.computeVisuals();
arecipes.add(recipe);
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
.getRecipeList()) {
if (NEIServerUtils.areStacksSameTypeCrafting(
irecipe.getRecipeOutput(), result)) {
CachedShapedRecipe recipe = null;
if (irecipe instanceof ShapedRecipes)
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
else if (irecipe instanceof ShapedOreRecipe)
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
if (recipe == null)
continue;
recipe.computeVisuals();
arecipes.add(recipe);
}
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
.getRecipeList()) {
CachedShapedRecipe recipe = null;
if (irecipe instanceof ShapedRecipes)
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
else if (irecipe instanceof ShapedOreRecipe)
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
if (recipe == null
|| !recipe.contains(recipe.ingredients,
ingredient.getItem()))
continue;
recipe.computeVisuals();
if (recipe.contains(recipe.ingredients, ingredient)) {
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
arecipes.add(recipe);
}
}
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/rolling_machine.png";
}
}

View file

@ -0,0 +1,116 @@
//Copy and pasted from https://github.com/Chicken-Bones/NotEnoughItems/blob/master/src/codechicken/nei/recipe/ShapelessRecipeHandler.java
package techreborn.compat.nei;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.recipe.ShapelessRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import techreborn.api.RollingMachineRecipe;
import techreborn.client.gui.GuiRollingMachine;
import java.awt.*;
import java.util.List;
public class ShapelessRollingMachineHandler extends ShapelessRecipeHandler {
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiRollingMachine.class;
}
public String getRecipeName() {
return "Shapeless Rolling Machine";
}
@Override
public void loadTransferRects() {
transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18),
"rollingcraftingnoshape"));
}
@Override
public String getOverlayIdentifier() {
return "rollingcraftingnoshape";
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("rollingcraftingnoshape")
&& getClass() == ShapelessRollingMachineHandler.class) {
List<IRecipe> allrecipes = RollingMachineRecipe.instance
.getRecipeList();
for (IRecipe irecipe : allrecipes) {
CachedShapelessRecipe recipe = null;
if (irecipe instanceof ShapelessRecipes)
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
else if (irecipe instanceof ShapelessOreRecipe)
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
if (recipe == null)
continue;
arecipes.add(recipe);
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
List<IRecipe> allrecipes = RollingMachineRecipe.instance
.getRecipeList();
for (IRecipe irecipe : allrecipes) {
if (NEIServerUtils.areStacksSameTypeCrafting(
irecipe.getRecipeOutput(), result)) {
CachedShapelessRecipe recipe = null;
if (irecipe instanceof ShapelessRecipes)
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
else if (irecipe instanceof ShapelessOreRecipe)
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
if (recipe == null)
continue;
arecipes.add(recipe);
}
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
List<IRecipe> allrecipes = RollingMachineRecipe.instance
.getRecipeList();
for (IRecipe irecipe : allrecipes) {
CachedShapelessRecipe recipe = null;
if (irecipe instanceof ShapelessRecipes)
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
else if (irecipe instanceof ShapelessOreRecipe)
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
if (recipe == null)
continue;
if (recipe.contains(recipe.ingredients, ingredient)) {
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
arecipes.add(recipe);
}
}
}
private CachedShapelessRecipe shapelessRecipe(ShapelessRecipes recipe) {
if (recipe.recipeItems == null)
return null;
return new CachedShapelessRecipe(recipe.recipeItems,
recipe.getRecipeOutput());
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/rolling_machine.png";
}
}

View file

@ -0,0 +1,54 @@
package techreborn.compat.nei.recipes;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiAlloySmelter;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.List;
public class AlloySmelterRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 47 - offset, 17 - offset, false);
input.add(pStack);
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset, false);
input.add(pStack2);
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset, false);
outputs.add(pStack3);
}
@Override
public String getRecipeName() {
return Reference.alloySmelteRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/electric_alloy_furnace.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiAlloySmelter.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(75, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
}
}

View file

@ -0,0 +1,59 @@
package techreborn.compat.nei.recipes;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiAssemblingMachine;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.List;
public class AssemblingMachineRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
if (recipeType.getInputs().size() > 0) {
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 47 - offset, 17 - offset, false);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset, false);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset, false);
outputs.add(pStack3);
}
}
@Override
public String getRecipeName() {
return Reference.assemblingMachineRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/assembling_machine.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiAssemblingMachine.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(80, 20, 20, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
}
}

View file

@ -0,0 +1,79 @@
package techreborn.compat.nei.recipes;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
import techreborn.client.gui.GuiBlastFurnace;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.List;
public class BlastFurnaceRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
if (recipeType.getInputs().size() > 0) {
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 40 - offset, 25 - offset, false);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 40 - offset, 43 - offset, false);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 100 - offset, 35 - offset, false);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 118 - offset, 35 - offset, false);
outputs.add(pStack4);
}
}
@Override
public String getRecipeName() {
return Reference.blastFurnaceRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_blast_furnace.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiBlastFurnace.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(55, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
}
@Override
public void drawBackground(int recipeIndex) {
super.drawBackground(recipeIndex);
CachedRecipe recipe = arecipes.get(recipeIndex);
if (recipe instanceof CachedGenericRecipe) {
if (((CachedGenericRecipe) recipe).recipie instanceof BlastFurnaceRecipe) {
BlastFurnaceRecipe blastFurnaceRecipeHandler = (BlastFurnaceRecipe) ((CachedGenericRecipe) recipe).recipie;
GuiDraw.drawString("Requires " + blastFurnaceRecipeHandler.neededHeat + " heat", 14, 135, -1);
}
}
}
}

View file

@ -0,0 +1,75 @@
package techreborn.compat.nei.recipes;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiCentrifuge;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.List;
public class CentrifugeRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
if (recipeType.getInputs().size() > 0) {
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 80 - offset, 35 - offset, false);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 50 - offset, 5 - offset, false);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 5 - offset, false);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 110 - offset, 35 - offset, false);
outputs.add(pStack4);
}
if (recipeType.getOutputsSize() > 2) {
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 80 - offset, 65 - offset, false);
outputs.add(pStack5);
}
if (recipeType.getOutputsSize() > 3) {
PositionedStack pStack6 = new PositionedStack(recipeType.getOutput(3), 50 - offset, 35 - offset, false);
outputs.add(pStack6);
}
}
@Override
public String getRecipeName() {
return Reference.centrifugeRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_centrifuge.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiCentrifuge.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(64, 25, 10, 10), getNeiBaseRecipe().getRecipeName(), new Object[0]));
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(94, 25, 10, 10), getNeiBaseRecipe().getRecipeName(), new Object[0]));
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(78, 15, 10, 10), getNeiBaseRecipe().getRecipeName(), new Object[0]));
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(78, 40, 10, 10), getNeiBaseRecipe().getRecipeName(), new Object[0]));
}
}

View file

@ -0,0 +1,59 @@
package techreborn.compat.nei.recipes;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiChemicalReactor;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.List;
public class ChemicalReactorRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
if (recipeType.getInputs().size() > 0) {
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 70 - offset, 21 - offset, false);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 90 - offset, 21 - offset, false);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 51 - offset, false);
outputs.add(pStack3);
}
}
@Override
public String getRecipeName() {
return Reference.chemicalReactorRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/chemical_reactor.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiChemicalReactor.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(70, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
}
}

View file

@ -0,0 +1,141 @@
package techreborn.compat.nei.recipes;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.RecipeHandler;
import java.awt.*;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public abstract class GenericRecipeHander extends TemplateRecipeHandler {
public INeiBaseRecipe getNeiBaseRecipe() {
return null;
}
public class CachedGenericRecipe extends CachedRecipe {
private List<PositionedStack> input = new ArrayList<PositionedStack>();
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
public Point focus;
public IBaseRecipeType recipie;
public INeiBaseRecipe neiBaseRecipe;
public CachedGenericRecipe(IBaseRecipeType recipe, INeiBaseRecipe neiBaseRecipe) {
this.recipie = recipe;
this.neiBaseRecipe = neiBaseRecipe;
neiBaseRecipe.addPositionedStacks(input, outputs, recipe);
}
@Override
public List<PositionedStack> getIngredients() {
return this.getCycledIngredients(cycleticks / 20, this.input);
}
@Override
public List<PositionedStack> getOtherStacks() {
return this.outputs;
}
@Override
public PositionedStack getResult() {
return null;
}
}
@Override
public String getRecipeName() {
return RecipeHandler.getUserFreindlyName(getNeiBaseRecipe().getRecipeName());
}
@Override
public String getGuiTexture() {
return getNeiBaseRecipe().getGuiTexture();
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return getNeiBaseRecipe().getGuiClass();
}
@Override
public void drawBackground(int recipeIndex) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(0, 0, 4, 4, 166, 78);
GuiDraw.drawTooltipBox(10, 80, 145, 50);
GuiDraw.drawString("Info:", 14, 84, -1);
CachedRecipe recipe = arecipes.get(recipeIndex);
if (recipe instanceof CachedGenericRecipe) {
CachedGenericRecipe genericRecipe = (CachedGenericRecipe) recipe;
float scale = 0.9F;
GL11.glScalef(scale, scale, scale);
DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);
DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols();
symbols.setGroupingSeparator('.');
formatter.setDecimalFormatSymbols(symbols);
GuiDraw.drawString("EU needed: " + formatter.format(new Integer(genericRecipe.recipie.euPerTick() * genericRecipe.recipie.tickTime()).longValue()), 16, 105, -1);
GuiDraw.drawString("Ticks to process: " + genericRecipe.recipie.tickTime(), 14, 115, -1);
GuiDraw.drawString("Time to process: " + genericRecipe.recipie.tickTime() / 20 + " seconds", 14, 125, -1);
}
}
@Override
public int recipiesPerPage() {
return 1;
}
// public void loadTransferRects() {
// this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
// new Rectangle(0, 0, 20, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
// }
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals(getNeiBaseRecipe().getRecipeName())) {
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
addCached(recipeType);
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
for (int i = 0; i < recipeType.getOutputsSize(); i++) {
if (ItemUtils.isItemEqual(recipeType.getOutput(i), result, true, false, true)) {
addCached(recipeType);
}
}
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
for (ItemStack input : recipeType.getInputs()) {
if (ItemUtils.isItemEqual(ingredient, input, true, false, true)) {
addCached(recipeType);
}
}
}
}
private void addCached(IBaseRecipeType recipie) {
this.arecipes.add(new CachedGenericRecipe(recipie, getNeiBaseRecipe()));
}
}

View file

@ -0,0 +1,104 @@
package techreborn.compat.nei.recipes;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
import reborncore.client.gui.GuiUtil;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.machines.GrinderRecipe;
import techreborn.client.gui.GuiGrinder;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.List;
public class GrinderRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
if (recipeType.getInputs().size() > 0) {
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 32 - offset, 26 - offset, false);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 32 - offset, 44 - offset, false);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 77 - offset, 35 - offset, false);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 95 - offset, 35 - offset, false);
outputs.add(pStack4);
}
if (recipeType.getOutputsSize() > 2) {
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 113 - offset, 35 - offset, false);
outputs.add(pStack5);
}
if (recipeType.getOutputsSize() > 3) {
PositionedStack pStack6 = new PositionedStack(recipeType.getOutput(3), 131 - offset, 35 - offset, false);
outputs.add(pStack6);
}
}
@Override
public String getRecipeName() {
return Reference.grinderRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_grinder.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiGrinder.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(44, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
}
@Override
public void drawBackground(int recipeIndex) {
super.drawBackground(recipeIndex);
CachedRecipe recipe = arecipes.get(recipeIndex);
if (recipe instanceof CachedGenericRecipe) {
if (((CachedGenericRecipe) recipe).recipie instanceof GrinderRecipe) {
GrinderRecipe grinderRecipe = (GrinderRecipe) ((CachedGenericRecipe) recipe).recipie;
if (grinderRecipe.fluidStack != null) {
IIcon fluidIcon = grinderRecipe.fluidStack.getFluid().getIcon();
if (fluidIcon != null) {
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
int liquidHeight = grinderRecipe.fluidStack.amount * 100 / 16000;
GuiUtil.drawRepeated(fluidIcon, 7, 22 + 47 - liquidHeight, 14.0D, liquidHeight, GuiDraw.gui.getZLevel());
}
GuiDraw.drawString(grinderRecipe.fluidStack.amount + "mb of " + grinderRecipe.fluidStack.getLocalizedName(), 14, 135, -1);
}
}
}
}
}

View file

@ -0,0 +1,36 @@
package techreborn.compat.nei.recipes;
import codechicken.nei.PositionedStack;
import net.minecraft.client.gui.inventory.GuiContainer;
import techreborn.api.recipe.IBaseRecipeType;
import java.util.List;
/**
* Use this to make your neiHandler
*/
public interface INeiBaseRecipe {
/**
* Add the inputs and the outputs
*
* @param input add the input stacks to this
* @param outputs add this output stacks to this
*/
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType);
/**
* @return the recipe name that is used for the recipe
*/
public String getRecipeName();
/**
* @return the guiTexture location
*/
public String getGuiTexture();
/**
* @return the gui class for the recipe
*/
public Class<? extends GuiContainer> getGuiClass();
}

View file

@ -0,0 +1,64 @@
package techreborn.compat.nei.recipes;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiImplosionCompressor;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.List;
public class ImplosionCompressorRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
if (recipeType.getInputs().size() > 0) {
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 37 - offset, 26 - offset, false);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 37 - offset, 44 - offset, false);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 93 - offset, 35 - offset, false);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 111 - offset, 35 - offset, false);
outputs.add(pStack4);
}
}
@Override
public String getRecipeName() {
return Reference.implosionCompressorRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/implosion_compressor.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiImplosionCompressor.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(50, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
}
}

View file

@ -0,0 +1,73 @@
package techreborn.compat.nei.recipes;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiIndustrialElectrolyzer;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.List;
public class IndustrialElectrolyzerRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
if (recipeType.getInputs().size() > 0) {
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 80 - offset, 51 - offset, false);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 50 - offset, 51 - offset, false);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 50 - offset, 19 - offset, false);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 70 - offset, 19 - offset, false);
outputs.add(pStack4);
}
if (recipeType.getOutputsSize() > 2) {
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 90 - offset, 19 - offset, false);
outputs.add(pStack5);
}
if (recipeType.getOutputsSize() > 3) {
PositionedStack pStack6 = new PositionedStack(recipeType.getOutput(3), 110 - offset, 19 - offset, false);
outputs.add(pStack6);
}
}
@Override
public String getRecipeName() {
return Reference.industrialElectrolyzerRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_electrolyzer.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiIndustrialElectrolyzer.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(80, 20, 15, 15), getNeiBaseRecipe().getRecipeName(), new Object[0]));
}
}

View file

@ -0,0 +1,97 @@
package techreborn.compat.nei.recipes;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
import reborncore.client.gui.GuiUtil;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.client.gui.GuiIndustrialSawmill;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.List;
public class IndustrialSawmillRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
if (recipeType.getInputs().size() > 0) {
PositionedStack pStack = new PositionedStack(recipeType.getInputs().get(0), 32 - offset, 26 - offset, false);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(recipeType.getInputs().get(1), 32 - offset, 44 - offset, false);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 84 - offset, 35 - offset, false);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 102 - offset, 35 - offset, false);
outputs.add(pStack4);
}
if (recipeType.getOutputsSize() > 2) {
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 120 - offset, 35 - offset, false);
outputs.add(pStack5);
}
}
@Override
public String getRecipeName() {
return Reference.industrialSawmillRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_sawmill.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiIndustrialSawmill.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(50, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
}
@Override
public void drawBackground(int recipeIndex) {
super.drawBackground(recipeIndex);
CachedRecipe recipe = arecipes.get(recipeIndex);
if (recipe instanceof CachedGenericRecipe) {
if (((CachedGenericRecipe) recipe).recipie instanceof IndustrialSawmillRecipe) {
IndustrialSawmillRecipe grinderRecipe = (IndustrialSawmillRecipe) ((CachedGenericRecipe) recipe).recipie;
if (grinderRecipe.fluidStack != null) {
IIcon fluidIcon = grinderRecipe.fluidStack.getFluid().getIcon();
if (fluidIcon != null) {
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
int liquidHeight = grinderRecipe.fluidStack.amount * 100 / 16000;
GuiUtil.drawRepeated(fluidIcon, 7, 22 + 47 - liquidHeight, 14.0D, liquidHeight, GuiDraw.gui.getZLevel());
}
GuiDraw.drawString(grinderRecipe.fluidStack.amount + "mb of " + grinderRecipe.fluidStack.getLocalizedName(), 14, 135, -1);
}
}
}
}
}

View file

@ -0,0 +1,86 @@
package techreborn.compat.nei.recipes;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.ItemList;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityFurnace;
import org.lwjgl.opengl.GL11;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiAlloyFurnace;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* Created by MrBretzel on 01/11/2015.
*/
public class IronAlloySmelterRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 46 - offset, 9 - offset, false);
input.add(pStack);
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 64 - offset, 9 - offset, false);
input.add(pStack2);
Iterator i = ItemList.items.iterator();
List<ItemStack> fuels = new ArrayList<ItemStack>();
while(i.hasNext()) {
ItemStack item = (ItemStack) i.next();
if(!fuels.contains(new ItemStack(item.getItem()))) {
int burnTime = TileEntityFurnace.getItemBurnTime(item);
if(burnTime > 0) {
fuels.add(new ItemStack(item.getItem()));
}
}
}
PositionedStack pStack3 = new PositionedStack(fuels, 51, 42, false);
input.add(pStack3);
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(0), 115 - offset, 28 - offset, false);
outputs.add(pStack4);
}
@Override
public String getRecipeName() {
return Reference.ironalloySmelteRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/alloy_furnace.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiAlloyFurnace.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(75, 20, 25, 20), Reference.alloySmelteRecipe, new Object[0]));
}
@Override
public void drawBackground(int recipeIndex) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 166, 65);
}
}

View file

@ -0,0 +1,51 @@
package techreborn.compat.nei.recipes;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiVacuumFreezer;
import techreborn.lib.Reference;
import java.awt.*;
import java.util.List;
public class VacuumFreezerRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 56 - offset, 34 - offset, false);
input.add(pStack);
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset, false);
outputs.add(pStack3);
}
@Override
public String getRecipeName() {
return Reference.vacuumFreezerRecipe;
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/vacuum_freezer.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiVacuumFreezer.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(75, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
}
}