2015-05-12 01:17:17 +02:00
|
|
|
package techreborn.compat.nei.recipes;
|
|
|
|
|
2015-05-23 14:54:12 +02:00
|
|
|
import codechicken.nei.PositionedStack;
|
2015-06-27 11:01:39 +02:00
|
|
|
import codechicken.nei.recipe.TemplateRecipeHandler;
|
2015-05-12 01:17:17 +02:00
|
|
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
2015-11-08 13:15:45 +01:00
|
|
|
import reborncore.common.util.ItemUtils;
|
2015-05-12 01:17:17 +02:00
|
|
|
import techreborn.api.recipe.IBaseRecipeType;
|
|
|
|
import techreborn.client.gui.GuiChemicalReactor;
|
2015-07-24 23:29:00 +02:00
|
|
|
import techreborn.lib.Reference;
|
2015-05-23 14:54:12 +02:00
|
|
|
|
2015-07-02 20:51:24 +02:00
|
|
|
import java.awt.*;
|
2015-05-23 14:54:12 +02:00
|
|
|
import java.util.List;
|
2015-05-12 01:17:17 +02:00
|
|
|
|
|
|
|
public class ChemicalReactorRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
2015-08-09 12:05:32 +02:00
|
|
|
@Override
|
|
|
|
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
|
|
|
int offset = 4;
|
|
|
|
if (recipeType.getInputs().size() > 0) {
|
2015-09-11 14:34:20 +02:00
|
|
|
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 70 - offset, 21 - offset, false);
|
2015-08-09 12:05:32 +02:00
|
|
|
input.add(pStack);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (recipeType.getInputs().size() > 1) {
|
2015-09-11 14:34:20 +02:00
|
|
|
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 90 - offset, 21 - offset, false);
|
2015-08-09 12:05:32 +02:00
|
|
|
input.add(pStack2);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (recipeType.getOutputsSize() > 0) {
|
2015-09-11 14:34:20 +02:00
|
|
|
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 51 - offset, false);
|
2015-08-09 12:05:32 +02:00
|
|
|
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]));
|
|
|
|
}
|
2015-05-12 01:17:17 +02:00
|
|
|
}
|