TechReborn/ToAddBack/compat/nei/recipes/ImplosionCompressorRecipeHandler.java

65 lines
2.2 KiB
Java
Raw Normal View History

2015-05-08 21:29:13 +02:00
package techreborn.compat.nei.recipes;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
2015-05-08 21:29:13 +02:00
import net.minecraft.client.gui.inventory.GuiContainer;
2015-11-08 13:15:45 +01:00
import reborncore.common.util.ItemUtils;
2015-05-08 21:29:13 +02:00
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiImplosionCompressor;
2015-07-24 23:29:00 +02:00
import techreborn.lib.Reference;
2015-07-02 20:51:24 +02:00
import java.awt.*;
import java.util.List;
2015-05-08 21:29:13 +02:00
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) {
2015-09-11 14:34:20 +02:00
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 37 - offset, 26 - offset, false);
input.add(pStack);
}
2015-06-12 19:40:08 +02:00
if (recipeType.getInputs().size() > 1) {
2015-09-11 14:34:20 +02:00
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 37 - offset, 44 - offset, false);
input.add(pStack2);
}
2015-06-12 19:40:08 +02:00
if (recipeType.getOutputsSize() > 0) {
2015-09-11 14:34:20 +02:00
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 93 - offset, 35 - offset, false);
outputs.add(pStack3);
}
2015-06-12 19:40:08 +02:00
if (recipeType.getOutputsSize() > 1) {
2015-09-11 14:34:20 +02:00
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 111 - offset, 35 - offset, false);
outputs.add(pStack4);
}
}
2015-06-12 19:40:08 +02:00
@Override
public String getRecipeName() {
return Reference.implosionCompressorRecipe;
}
2015-06-12 19:40:08 +02:00
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/implosion_compressor.png";
}
2015-06-12 19:40:08 +02:00
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiImplosionCompressor.class;
}
2015-06-12 19:40:08 +02:00
@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]));
}
2015-05-08 21:29:13 +02:00
}