summaryrefslogtreecommitdiff
path: root/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java
diff options
context:
space:
mode:
authorFoghrye4 <foghrye4@gmail.com>2017-02-07 20:16:24 +0300
committerFoghrye4 <foghrye4@gmail.com>2017-02-07 20:16:24 +0300
commit2636ccdd67b5f33421ab7f9152021bc4ebc147b3 (patch)
treebae55386c0a830ac74eeb5cd09ed7fa27ecc90dc /ihl/processing/metallurgy/AchesonFurnanceTileEntity.java
parent2db8e30b1d2151fdde5d08a6c06aef55f0c397d2 (diff)
Fixed an ore dictionary recipes of Iron workbench which using wrong set of items. Fixed wire recipe input. All recipes of Iron workbench now use fluid container input and will drop an empty container.
Diffstat (limited to 'ihl/processing/metallurgy/AchesonFurnanceTileEntity.java')
-rw-r--r--ihl/processing/metallurgy/AchesonFurnanceTileEntity.java123
1 files changed, 53 insertions, 70 deletions
diff --git a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java
index 0c1b75f..5709cb9 100644
--- a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java
+++ b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java
@@ -20,28 +20,28 @@ import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{
+public class AchesonFurnanceTileEntity extends MachineBaseTileEntity {
- public final ApparatusProcessableInvSlot inputElectrode;
+ public final ApparatusProcessableInvSlot inputElectrode;
protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("achesonfurnace");
- private final RecipeInputOreDict[] validElectrodeTypes=new RecipeInputOreDict[] {new RecipeInputOreDict("stickCoal"),new RecipeInputOreDict("stickGraphite"),new RecipeInputOreDict("plateCoal"),new RecipeInputOreDict("plateGraphite")};
-
- public AchesonFurnanceTileEntity()
- {
+ private final RecipeInputOreDict[] validElectrodeTypes = new RecipeInputOreDict[] {
+ new RecipeInputOreDict("stickCoal"), new RecipeInputOreDict("stickGraphite"),
+ new RecipeInputOreDict("plateCoal"), new RecipeInputOreDict("plateGraphite") };
+
+ public AchesonFurnanceTileEntity() {
super(2);
inputElectrode = new ApparatusProcessableInvSlot(this, "inputElectrode", 1, Access.IO, 2, 1);
}
-
- public static void addRecipe(IRecipeInput input1, IRecipeInput input2, String output1)
- {
- recipeManager.addRecipe(new UniversalRecipeInput(null,new IRecipeInput [] {input1,input2}),new UniversalRecipeOutput(null,new ItemStack [] {IHLUtils.getThisModItemStack(output1)},20));
+
+ public static void addRecipe(IRecipeInput input1, IRecipeInput input2, String output1) {
+ recipeManager.addRecipe(new UniversalRecipeInput(null, new IRecipeInput[] { input1, input2 }),
+ new UniversalRecipeOutput(null, new ItemStack[] { IHLUtils.getThisModItemStack(output1) }, 20));
}
@Override
- public String getStartSoundFile()
- {
- return "Machines/Electro Furnace/ElectroFurnaceLoop.ogg";
- }
+ public String getStartSoundFile() {
+ return "Machines/Electro Furnace/ElectroFurnaceLoop.ogg";
+ }
@Override
public String getLoopSoundFile() {
@@ -68,80 +68,63 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity{
public ContainerBase<?> getGuiContainer(EntityPlayer player) {
return new AchesonFurnanceContainer(player, this);
}
-
+
@Override
- public void operate()
- {
- List<RecipeOutputItemStack> output = AchesonFurnanceTileEntity.recipeManager.getOutputFor(getInput(), true, true).getItemOutputs();
- for(int i=0; i<this.inputElectrode.size();i++)
- {
+ public void operate() {
+ List<RecipeOutputItemStack> output = AchesonFurnanceTileEntity.recipeManager
+ .getOutputFor(getInput(), true, true).getItemOutputs();
+ for (int i = 0; i < this.inputElectrode.size(); i++) {
ItemStack electrodeIS = this.inputElectrode.get(i);
- if(this.validElectrodeTypes[0].matches(electrodeIS))
- {
+ if (this.validElectrodeTypes[0].matches(electrodeIS)) {
this.inputElectrode.put(i, IHLUtils.getThisModItemStack("stickGraphite"));
- }
- else if(this.validElectrodeTypes[2].matches(electrodeIS))
- {
+ } else if (this.validElectrodeTypes[2].matches(electrodeIS)) {
this.inputElectrode.put(i, IHLUtils.getThisModItemStack("plateGraphite"));
}
}
- for(int i=0; i<this.input.size();i++)
- {
- if(output.size()>i)
- {
+ for (int i = 0; i < this.input.size(); i++) {
+ if (output.size() > i) {
ItemStack stack = output.get(i).itemStack.copy();
- stack.stackSize=Math.round(output.get(i).quantity);
- this.input.put(i,stack);
+ stack.stackSize = Math.round(output.get(i).quantity);
+ this.input.put(i, stack);
}
- if(this.input.get(i)!=null && this.input.get(i).stackSize<=0)
- {
+ if (this.input.get(i) != null && this.input.get(i).stackSize <= 0) {
this.input.put(i, null);
}
}
- ItemStack crucible = input.getItemStack(IHLMod.crucible);
- if(crucible!=null)
- {
- ((Crucible)crucible.getItem()).processContent(crucible, this);
- }
+ ItemStack crucible = input.getItemStack(IHLMod.crucible);
+ if (crucible != null) {
+ ((Crucible) crucible.getItem()).processContent(crucible, this);
+ }
}
-
+
@Override
- public boolean canOperate()
- {
- return this.isValidElectrode(this.inputElectrode.get(0)) &&
- this.isValidElectrode(this.inputElectrode.get(1)) &&
- this.getOutput()!=null;
+ public boolean canOperate() {
+ return this.isValidElectrode(this.inputElectrode.get(0)) && this.isValidElectrode(this.inputElectrode.get(1))
+ && this.getOutput() != null;
}
-
+
@Override
- public List<?>[] getInput()
- {
- return new List[] {null, this.input.getItemStackList()};
+ public List<?>[] getInput() {
+ return new List[] { null, this.input.getItemStackList() };
}
-
public static Map<UniversalRecipeInput, UniversalRecipeOutput> getRecipes() {
return recipeManager.getRecipes();
}
-
- @Override
- public UniversalRecipeOutput getOutput()
- {
- return AchesonFurnanceTileEntity.recipeManager.getOutputFor(this.getInput(), false, false);
- }
-
- private boolean isValidElectrode(ItemStack stack)
- {
- if(stack!=null)
- {
- for(int i=0;i<this.validElectrodeTypes.length;i++)
- {
- if(validElectrodeTypes[i].matches(stack))
- {
- return true;
- }
- }
- }
- return false;
- }
+
+ @Override
+ public UniversalRecipeOutput getOutput() {
+ return AchesonFurnanceTileEntity.recipeManager.getOutputFor(this.getInput(), false, false);
+ }
+
+ private boolean isValidElectrode(ItemStack stack) {
+ if (stack != null) {
+ for (int i = 0; i < this.validElectrodeTypes.length; i++) {
+ if (validElectrodeTypes[i].matches(stack)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
}