Improved the way we handle other mods

This commit is contained in:
modmuss50 2015-06-12 18:40:08 +01:00
parent 0d20ba6d55
commit 6deb0b1d32
27 changed files with 2074 additions and 1969 deletions

View file

@ -21,138 +21,138 @@ import java.util.List;
*/
public class BlastFurnaceRecipeHandler extends TemplateRecipeHandler {
public class CachedBlastFurnaceRecipe extends CachedRecipe {
public class CachedBlastFurnaceRecipe extends CachedRecipe {
private List<PositionedStack> input = new ArrayList<PositionedStack>();
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
public Point focus;
public BlastFurnaceRecipe centrifugeRecipie;
private List<PositionedStack> input = new ArrayList<PositionedStack>();
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
public Point focus;
public BlastFurnaceRecipe centrifugeRecipie;
public CachedBlastFurnaceRecipe(BlastFurnaceRecipe recipie) {
this.centrifugeRecipie = recipie;
int offset = 4;
PositionedStack pStack = new PositionedStack(
recipie.getInput1(), 56 - offset, 25 - offset);
public CachedBlastFurnaceRecipe(BlastFurnaceRecipe recipie) {
this.centrifugeRecipie = recipie;
int offset = 4;
PositionedStack pStack = new PositionedStack(
recipie.getInput1(), 56 - offset, 25 - offset);
pStack.setMaxSize(1);
this.input.add(pStack);
pStack.setMaxSize(1);
this.input.add(pStack);
PositionedStack pStack2 = new PositionedStack(
recipie.getInput2(), 56 - offset, 43 - offset);
PositionedStack pStack2 = new PositionedStack(
recipie.getInput2(), 56 - offset, 43 - offset);
pStack.setMaxSize(1);
this.input.add(pStack2);
pStack.setMaxSize(1);
this.input.add(pStack2);
if (recipie.getOutput1() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput1(),
116 - offset, 35 - offset));
}
if (recipie.getOutput2() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput2(),
116 - offset, 53 - offset));
}
}
if (recipie.getOutput1() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput1(),
116 - offset, 35 - offset));
}
if (recipie.getOutput2() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput2(),
116 - offset, 53 - offset));
}
}
@Override
public List<PositionedStack> getIngredients() {
return this.getCycledIngredients(cycleticks / 20, this.input);
}
@Override
public List<PositionedStack> getIngredients() {
return this.getCycledIngredients(cycleticks / 20, this.input);
}
@Override
public List<PositionedStack> getOtherStacks() {
return this.outputs;
}
@Override
public List<PositionedStack> getOtherStacks() {
return this.outputs;
}
@Override
public PositionedStack getResult() {
return null;
}
}
@Override
public PositionedStack getResult() {
return null;
}
}
@Override
public String getRecipeName() {
return "Blast Furnace";
}
@Override
public String getRecipeName() {
return "Blast Furnace";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_blast_furnace.png";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_blast_furnace.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiBlastFurnace.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiBlastFurnace.class;
}
@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 CachedBlastFurnaceRecipe) {
CachedBlastFurnaceRecipe centrifugeRecipie = (CachedBlastFurnaceRecipe) recipe;
GuiDraw.drawString(
"EU needed: "
+ (ConfigTechReborn.CentrifugeInputTick * centrifugeRecipie.centrifugeRecipie
.getTickTime()), 14, 94, -1);
GuiDraw.drawString("Ticks to smelt: "
+ centrifugeRecipie.centrifugeRecipie.getTickTime(), 14,
104, -1);
GuiDraw.drawString("Time to smelt: "
+ centrifugeRecipie.centrifugeRecipie.getTickTime() / 20
+ " seconds", 14, 114, -1);
}
}
@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 CachedBlastFurnaceRecipe) {
CachedBlastFurnaceRecipe centrifugeRecipie = (CachedBlastFurnaceRecipe) recipe;
GuiDraw.drawString(
"EU needed: "
+ (ConfigTechReborn.CentrifugeInputTick * centrifugeRecipie.centrifugeRecipie
.getTickTime()), 14, 94, -1);
GuiDraw.drawString("Ticks to smelt: "
+ centrifugeRecipie.centrifugeRecipie.getTickTime(), 14,
104, -1);
GuiDraw.drawString("Time to smelt: "
+ centrifugeRecipie.centrifugeRecipie.getTickTime() / 20
+ " seconds", 14, 114, -1);
}
}
@Override
public int recipiesPerPage() {
return 1;
}
@Override
public int recipiesPerPage() {
return 1;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(0, 0, 20, 20), "tr.blast", new Object[0]));
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
new Rectangle(0, 0, 20, 20), "tr.blast", new Object[0]));
}
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("tr.blast")) {
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
addCached(centrifugeRecipie);
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("tr.blast")) {
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
addCached(centrifugeRecipie);
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
if (NEIServerUtils.areStacksSameTypeCrafting(
centrifugeRecipie.getOutput1(), result)) {
addCached(centrifugeRecipie);
}
if (NEIServerUtils.areStacksSameTypeCrafting(
centrifugeRecipie.getOutput2(), result)) {
addCached(centrifugeRecipie);
}
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
if (NEIServerUtils.areStacksSameTypeCrafting(
centrifugeRecipie.getOutput1(), result)) {
addCached(centrifugeRecipie);
}
if (NEIServerUtils.areStacksSameTypeCrafting(
centrifugeRecipie.getOutput2(), result)) {
addCached(centrifugeRecipie);
}
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInput1(), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInput2(), ingredient)) {
addCached(centrifugeRecipie);
}
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInput1(), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInput2(), ingredient)) {
addCached(centrifugeRecipie);
}
}
}
private void addCached(BlastFurnaceRecipe recipie) {
this.arecipes.add(new CachedBlastFurnaceRecipe(recipie));
}
private void addCached(BlastFurnaceRecipe recipie) {
this.arecipes.add(new CachedBlastFurnaceRecipe(recipie));
}
}

View file

@ -2,74 +2,81 @@ package techreborn.compat.nei;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import techreborn.api.recipe.machines.GrinderRecipe;
import techreborn.compat.nei.recipes.*;
import techreborn.compat.nei.recipes.AlloySmelterRecipeHandler;
import techreborn.compat.nei.recipes.AssemblingMachineRecipeHandler;
import techreborn.compat.nei.recipes.CentrifugeRecipeHandler;
import techreborn.compat.nei.recipes.ChemicalReactorRecipeHandler;
import techreborn.compat.nei.recipes.GrinderRecipeHandler;
import techreborn.compat.nei.recipes.ImplosionCompressorRecipeHandler;
import techreborn.compat.nei.recipes.IndustrialSawmillRecipeHandler;
import techreborn.compat.nei.recipes.LatheRecipeHandler;
import techreborn.compat.nei.recipes.PlateCuttingMachineRecipeHandler;
import techreborn.lib.ModInfo;
public class NEIConfig implements IConfigureNEI {
@Override
public String getName() {
return ModInfo.MOD_ID;
}
@Override
public String getName() {
return ModInfo.MOD_ID;
}
@Override
public String getVersion() {
return ModInfo.MOD_VERSION;
}
@Override
public String getVersion() {
return ModInfo.MOD_VERSION;
}
public static BlastFurnaceRecipeHandler blastFurnaceRecipeHandle;
public static BlastFurnaceRecipeHandler blastFurnaceRecipeHandle;
@Override
public void loadConfig() {
ShapedRollingMachineHandler shapedRollingMachineHandler = new ShapedRollingMachineHandler();
ShapelessRollingMachineHandler shapelessRollingMachineHandler = new ShapelessRollingMachineHandler();
NEIConfig.blastFurnaceRecipeHandle = new BlastFurnaceRecipeHandler();
@Override
public void loadConfig() {
ShapedRollingMachineHandler shapedRollingMachineHandler = new ShapedRollingMachineHandler();
ShapelessRollingMachineHandler shapelessRollingMachineHandler = new ShapelessRollingMachineHandler();
NEIConfig.blastFurnaceRecipeHandle = new BlastFurnaceRecipeHandler();
ImplosionCompressorRecipeHandler implosion = new ImplosionCompressorRecipeHandler();
API.registerUsageHandler(implosion);
API.registerRecipeHandler(implosion);
ImplosionCompressorRecipeHandler implosion = new ImplosionCompressorRecipeHandler();
API.registerUsageHandler(implosion);
API.registerRecipeHandler(implosion);
AlloySmelterRecipeHandler alloy = new AlloySmelterRecipeHandler();
API.registerUsageHandler(alloy);
API.registerRecipeHandler(alloy);
AlloySmelterRecipeHandler alloy = new AlloySmelterRecipeHandler();
API.registerUsageHandler(alloy);
API.registerRecipeHandler(alloy);
AssemblingMachineRecipeHandler assembling = new AssemblingMachineRecipeHandler();
API.registerUsageHandler(assembling);
API.registerRecipeHandler(assembling);
AssemblingMachineRecipeHandler assembling = new AssemblingMachineRecipeHandler();
API.registerUsageHandler(assembling);
API.registerRecipeHandler(assembling);
LatheRecipeHandler lathe = new LatheRecipeHandler();
API.registerUsageHandler(lathe);
API.registerRecipeHandler(lathe);
LatheRecipeHandler lathe = new LatheRecipeHandler();
API.registerUsageHandler(lathe);
API.registerRecipeHandler(lathe);
IndustrialSawmillRecipeHandler sawmill = new IndustrialSawmillRecipeHandler();
API.registerUsageHandler(sawmill);
API.registerRecipeHandler(sawmill);
IndustrialSawmillRecipeHandler sawmill = new IndustrialSawmillRecipeHandler();
API.registerUsageHandler(sawmill);
API.registerRecipeHandler(sawmill);
PlateCuttingMachineRecipeHandler plate = new PlateCuttingMachineRecipeHandler();
API.registerUsageHandler(plate);
API.registerRecipeHandler(plate);
PlateCuttingMachineRecipeHandler plate = new PlateCuttingMachineRecipeHandler();
API.registerUsageHandler(plate);
API.registerRecipeHandler(plate);
ChemicalReactorRecipeHandler chem = new ChemicalReactorRecipeHandler();
API.registerUsageHandler(chem);
API.registerRecipeHandler(chem);
ChemicalReactorRecipeHandler chem = new ChemicalReactorRecipeHandler();
API.registerUsageHandler(chem);
API.registerRecipeHandler(chem);
CentrifugeRecipeHandler cent = new CentrifugeRecipeHandler();
API.registerUsageHandler(cent);
API.registerRecipeHandler(cent);
CentrifugeRecipeHandler cent = new CentrifugeRecipeHandler();
API.registerUsageHandler(cent);
API.registerRecipeHandler(cent);
GrinderRecipeHandler grind = new GrinderRecipeHandler();
API.registerUsageHandler(grind);
API.registerRecipeHandler(grind);
API.registerUsageHandler(shapedRollingMachineHandler);
API.registerRecipeHandler(shapedRollingMachineHandler);
API.registerUsageHandler(shapedRollingMachineHandler);
API.registerRecipeHandler(shapedRollingMachineHandler);
API.registerUsageHandler(shapelessRollingMachineHandler);
API.registerRecipeHandler(shapelessRollingMachineHandler);
API.registerUsageHandler(shapelessRollingMachineHandler);
API.registerRecipeHandler(shapelessRollingMachineHandler);
API.registerUsageHandler(NEIConfig.blastFurnaceRecipeHandle);
API.registerRecipeHandler(NEIConfig.blastFurnaceRecipeHandle);
}
API.registerUsageHandler(NEIConfig.blastFurnaceRecipeHandle);
API.registerRecipeHandler(NEIConfig.blastFurnaceRecipeHandle);
}
}

View file

@ -16,91 +16,91 @@ import java.util.List;
public class ShapedRollingMachineHandler extends ShapedRecipeHandler {
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiRollingMachine.class;
}
@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 void loadTransferRects() {
this.transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24,
18), "rollingcrafting", new Object[0]));
}
@Override
public String getRecipeName() {
return "rollingcrafting";
}
@Override
public String getRecipeName() {
return "rollingcrafting";
}
@Override
public String getOverlayIdentifier() {
return "rollingcrafting";
}
@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);
@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;
if (recipe == null)
continue;
recipe.computeVisuals();
arecipes.add(recipe);
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
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);
@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;
if (recipe == null)
continue;
recipe.computeVisuals();
arecipes.add(recipe);
}
}
}
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);
@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;
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);
}
}
}
recipe.computeVisuals();
if (recipe.contains(recipe.ingredients, ingredient)) {
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
arecipes.add(recipe);
}
}
}
}

View file

@ -16,96 +16,96 @@ import java.util.List;
public class ShapelessRollingMachineHandler extends ShapelessRecipeHandler {
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiRollingMachine.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiRollingMachine.class;
}
public String getRecipeName() {
return "Shapeless Rolling Machine";
}
public String getRecipeName() {
return "Shapeless Rolling Machine";
}
@Override
public void loadTransferRects() {
transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18),
"rollingcraftingnoshape"));
}
@Override
public void loadTransferRects() {
transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18),
"rollingcraftingnoshape"));
}
@Override
public String getOverlayIdentifier() {
return "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);
@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;
if (recipe == null)
continue;
arecipes.add(recipe);
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
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);
@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;
if (recipe == null)
continue;
arecipes.add(recipe);
}
}
}
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);
@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 == null)
continue;
if (recipe.contains(recipe.ingredients, ingredient)) {
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
arecipes.add(recipe);
}
}
}
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;
private CachedShapelessRecipe shapelessRecipe(ShapelessRecipes recipe) {
if (recipe.recipeItems == null)
return null;
return new CachedShapelessRecipe(recipe.recipeItems,
recipe.getRecipeOutput());
}
return new CachedShapelessRecipe(recipe.recipeItems,
recipe.getRecipeOutput());
}
}

View file

@ -9,36 +9,36 @@ import techreborn.util.ItemUtils;
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);
input.add(pStack);
@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);
input.add(pStack);
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset);
input.add(pStack2);
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset);
input.add(pStack2);
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
outputs.add(pStack3);
}
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
outputs.add(pStack3);
}
@Override
public String getRecipeName() {
return "alloySmelterRecipe";
}
@Override
public String getRecipeName() {
return "alloySmelterRecipe";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/electric_alloy_furnace.png";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/electric_alloy_furnace.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiAlloySmelter.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiAlloySmelter.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
}

View file

@ -9,42 +9,42 @@ import techreborn.util.ItemUtils;
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);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset);
input.add(pStack2);
}
@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);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
outputs.add(pStack3);
}
}
}
@Override
public String getRecipeName() {
return "assemblingMachineRecipe";
}
@Override
public String getRecipeName() {
return "assemblingMachineRecipe";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/assembling_machine.png";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/assembling_machine.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiAssemblingMachine.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiAssemblingMachine.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
}

View file

@ -9,56 +9,56 @@ import techreborn.util.ItemUtils;
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);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 50 - offset, 5 - offset);
input.add(pStack2);
}
@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);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 50 - offset, 5 - offset);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 5 - offset);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 5 - offset);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 110 - offset, 35 - offset);
outputs.add(pStack4);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 110 - offset, 35 - offset);
outputs.add(pStack4);
}
if (recipeType.getOutputsSize() > 2) {
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 80 - offset, 65 - offset);
outputs.add(pStack5);
}
if (recipeType.getOutputsSize() > 2) {
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 80 - offset, 65 - offset);
outputs.add(pStack5);
}
if (recipeType.getOutputsSize() > 3) {
PositionedStack pStack6 = new PositionedStack(recipeType.getOutput(3), 50 - offset, 35 - offset);
outputs.add(pStack6);
}
}
if (recipeType.getOutputsSize() > 3) {
PositionedStack pStack6 = new PositionedStack(recipeType.getOutput(3), 50 - offset, 35 - offset);
outputs.add(pStack6);
}
}
@Override
public String getRecipeName() {
return "centrifugeRecipe";
}
@Override
public String getRecipeName() {
return "centrifugeRecipe";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_centrifuge.png";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_centrifuge.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiCentrifuge.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiCentrifuge.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
}

View file

@ -9,42 +9,42 @@ import techreborn.util.ItemUtils;
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);
input.add(pStack);
}
@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);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 90 - offset, 21 - offset);
input.add(pStack2);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 90 - offset, 21 - offset);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 51 - offset);
outputs.add(pStack3);
}
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 51 - offset);
outputs.add(pStack3);
}
}
@Override
public String getRecipeName() {
return "chemicalReactorRecipe";
}
@Override
public String getRecipeName() {
return "chemicalReactorRecipe";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/chemical_reactor.png";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/chemical_reactor.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiChemicalReactor.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiChemicalReactor.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
}

View file

@ -17,123 +17,123 @@ import java.util.List;
public abstract class GenericRecipeHander extends TemplateRecipeHandler {
public INeiBaseRecipe getNeiBaseRecipe() {
return null;
}
public INeiBaseRecipe getNeiBaseRecipe() {
return null;
}
public class CachedGenericRecipe extends CachedRecipe {
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;
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);
}
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> getIngredients() {
return this.getCycledIngredients(cycleticks / 20, this.input);
}
@Override
public List<PositionedStack> getOtherStacks() {
return this.outputs;
}
@Override
public List<PositionedStack> getOtherStacks() {
return this.outputs;
}
@Override
public PositionedStack getResult() {
return null;
}
}
@Override
public PositionedStack getResult() {
return null;
}
}
@Override
public String getRecipeName() {
return getNeiBaseRecipe().getRecipeName();
}
@Override
public String getRecipeName() {
return getNeiBaseRecipe().getRecipeName();
}
@Override
public String getGuiTexture() {
return getNeiBaseRecipe().getGuiTexture();
}
@Override
public String getGuiTexture() {
return getNeiBaseRecipe().getGuiTexture();
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return getNeiBaseRecipe().getGuiClass();
}
@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;
GuiDraw.drawString(
"EU needed: "
+ (ConfigTechReborn.CentrifugeInputTick * genericRecipe.recipie
.tickTime()), 14, 94, -1);
GuiDraw.drawString("Ticks to smelt: "
+ genericRecipe.recipie.tickTime(), 14,
104, -1);
GuiDraw.drawString("Time to smelt: "
+ genericRecipe.recipie.tickTime() / 20
+ " seconds", 14, 114, -1);
}
@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;
GuiDraw.drawString(
"EU needed: "
+ (ConfigTechReborn.CentrifugeInputTick * genericRecipe.recipie
.tickTime()), 14, 94, -1);
GuiDraw.drawString("Ticks to smelt: "
+ genericRecipe.recipie.tickTime(), 14,
104, -1);
GuiDraw.drawString("Time to smelt: "
+ genericRecipe.recipie.tickTime() / 20
+ " seconds", 14, 114, -1);
}
}
}
@Override
public int recipiesPerPage() {
return 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 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);
}
}
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())) {
@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);
}
}
}
}
@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()));
}
private void addCached(IBaseRecipeType recipie) {
this.arecipes.add(new CachedGenericRecipe(recipie, getNeiBaseRecipe()));
}
}

View file

@ -74,10 +74,10 @@ public class GrinderRecipeHandler extends GenericRecipeHander implements INeiBas
public void drawBackground(int recipeIndex) {
super.drawBackground(recipeIndex);
CachedRecipe recipe = arecipes.get(recipeIndex);
if(recipe instanceof CachedGenericRecipe){
if(((CachedGenericRecipe) recipe).recipie instanceof GrinderRecipe){
if (recipe instanceof CachedGenericRecipe) {
if (((CachedGenericRecipe) recipe).recipie instanceof GrinderRecipe) {
GrinderRecipe grinderRecipe = (GrinderRecipe) ((CachedGenericRecipe) recipe).recipie;
if(grinderRecipe.fluidStack != null){
if (grinderRecipe.fluidStack != null) {
IIcon fluidIcon = grinderRecipe.fluidStack.getFluid().getIcon();
if (fluidIcon != null) {
// GuiDraw.drawRect(7, 16, 176, 31, 0);

View file

@ -11,26 +11,26 @@ import java.util.List;
*/
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);
/**
* 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 recipe name that is used for the recipe
*/
public String getRecipeName();
/**
* @return the guiTexture location
*/
public String getGuiTexture();
/**
* @return the guiTexture location
*/
public String getGuiTexture();
/**
* @return the gui class for the recipe
*/
public Class<? extends GuiContainer> getGuiClass();
/**
* @return the gui class for the recipe
*/
public Class<? extends GuiContainer> getGuiClass();
}

View file

@ -9,47 +9,47 @@ import techreborn.util.ItemUtils;
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);
input.add(pStack);
}
@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);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 37 - offset, 44 - offset);
input.add(pStack2);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 37 - offset, 44 - offset);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 93 - offset, 35 - offset);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 93 - offset, 35 - offset);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 111 - offset, 35 - offset);
outputs.add(pStack4);
}
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 111 - offset, 35 - offset);
outputs.add(pStack4);
}
}
@Override
public String getRecipeName() {
return "implosionCompressorRecipe";
}
@Override
public String getRecipeName() {
return "implosionCompressorRecipe";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/implosion_compressor.png";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/implosion_compressor.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiImplosionCompressor.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiImplosionCompressor.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
}

View file

@ -4,57 +4,56 @@ import codechicken.nei.PositionedStack;
import net.minecraft.client.gui.inventory.GuiContainer;
import techreborn.api.recipe.IBaseRecipeType;
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;
if (recipeType.getInputs().size() > 0) {
PositionedStack pStack = new PositionedStack(recipeType.getInputs().get(0), 32 - offset, 26 - offset);
input.add(pStack);
}
@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);
input.add(pStack);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(recipeType.getInputs().get(1), 32 - offset, 44 - offset);
input.add(pStack2);
}
if (recipeType.getInputs().size() > 1) {
PositionedStack pStack2 = new PositionedStack(recipeType.getInputs().get(1), 32 - offset, 44 - offset);
input.add(pStack2);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 84 - offset, 35 - offset);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 84 - offset, 35 - offset);
outputs.add(pStack3);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 102 - offset, 35 - offset);
outputs.add(pStack4);
}
if (recipeType.getOutputsSize() > 1) {
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 102 - offset, 35 - offset);
outputs.add(pStack4);
}
if (recipeType.getOutputsSize() > 2) {
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 120 - offset, 35 - offset);
outputs.add(pStack5);
}
}
if (recipeType.getOutputsSize() > 2) {
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 120 - offset, 35 - offset);
outputs.add(pStack5);
}
}
@Override
public String getRecipeName() {
return "industrialSawmillRecipe";
}
@Override
public String getRecipeName() {
return "industrialSawmillRecipe";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_sawmill.png";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/industrial_sawmill.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiIndustrialSawmill.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiIndustrialSawmill.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
}

View file

@ -9,37 +9,37 @@ import techreborn.util.ItemUtils;
import java.util.List;
public class LatheRecipeHandler 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)), 56 - offset, 17 - offset);
input.add(pStack);
}
@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)), 56 - offset, 17 - offset);
input.add(pStack);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
outputs.add(pStack3);
}
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
outputs.add(pStack3);
}
}
@Override
public String getRecipeName() {
return "latheRecipe";
}
@Override
public String getRecipeName() {
return "latheRecipe";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/lathe.png";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/lathe.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiLathe.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiLathe.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
}

View file

@ -9,36 +9,36 @@ import techreborn.util.ItemUtils;
import java.util.List;
public class PlateCuttingMachineRecipeHandler 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)), 56 - offset, 17 - offset);
input.add(pStack);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
outputs.add(pStack3);
}
}
@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)), 56 - offset, 17 - offset);
input.add(pStack);
}
if (recipeType.getOutputsSize() > 0) {
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
outputs.add(pStack3);
}
}
@Override
public String getRecipeName() {
return "plateCuttingMachineRecipe";
}
@Override
public String getRecipeName() {
return "plateCuttingMachineRecipe";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/plate_cutting_machine.png";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/plate_cutting_machine.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiPlateCuttingMachine.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiPlateCuttingMachine.class;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
@Override
public INeiBaseRecipe getNeiBaseRecipe() {
return this;
}
}