Added Industrial Sawmill pokes @modmuss50 to look at the nei handler crash issue bet I did it wrong

This commit is contained in:
Gig 2015-05-11 17:04:27 +01:00
parent 3fe5605de3
commit a8a46352c8
10 changed files with 417 additions and 0 deletions

View file

@ -10,8 +10,10 @@ import techreborn.compat.nei.recipes.AlloySmelterRecipeHandler;
import techreborn.compat.nei.recipes.AssemblingMachineRecipeHandler;
import techreborn.compat.nei.recipes.GenericRecipeHander;
import techreborn.compat.nei.recipes.ImplosionCompressorRecipeHandler;
import techreborn.compat.nei.recipes.IndustrialSawmillRecipeHandler;
import techreborn.compat.nei.recipes.LatheRecipeHandler;
import techreborn.lib.ModInfo;
import techreborn.recipes.IndustrialSawmillRecipe;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
@ -53,6 +55,10 @@ public class NEIConfig implements IConfigureNEI {
LatheRecipeHandler lathe = new LatheRecipeHandler();
API.registerUsageHandler(lathe);
API.registerRecipeHandler(lathe);
IndustrialSawmillRecipeHandler sawmill = new IndustrialSawmillRecipeHandler();
API.registerUsageHandler(sawmill);
API.registerRecipeHandler(sawmill);
API.registerRecipeHandler(centrifugeRecipeHandler);
API.registerUsageHandler(centrifugeRecipeHandler);

View file

@ -0,0 +1,53 @@
package techreborn.compat.nei.recipes;
import codechicken.nei.PositionedStack;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraftforge.oredict.OreDictionary;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiAlloySmelter;
import techreborn.client.gui.GuiImplosionCompressor;
import techreborn.client.gui.GuiIndustrialSawmill;
import techreborn.util.ItemUtils;
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;
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 32 - offset, 26 - offset);
input.add(pStack);
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 32 - offset, 44 - offset);
input.add(pStack2);
PositionedStack pStack3 = new PositionedStack(recipeType.getOutputs().get(0), 84 - offset, 35 - offset);
outputs.add(pStack3);
PositionedStack pStack4 = new PositionedStack(recipeType.getOutputs().get(1), 102 - offset, 35 - offset);
outputs.add(pStack4);
PositionedStack pStack5 = new PositionedStack(recipeType.getOutputs().get(2), 120 - offset, 35 - offset);
outputs.add(pStack5);
}
@Override
public String getRecipeName() {
return "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;
}
}