diff options
Diffstat (limited to 'ihl/processing/metallurgy/MuffleFurnanceTileEntity.java')
| -rw-r--r-- | ihl/processing/metallurgy/MuffleFurnanceTileEntity.java | 121 |
1 files changed, 56 insertions, 65 deletions
diff --git a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java index c5a54c7..55db3db 100644 --- a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java +++ b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java @@ -1,6 +1,5 @@ package ihl.processing.metallurgy;
-import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -17,15 +16,15 @@ import net.minecraft.item.ItemStack; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-public class MuffleFurnanceTileEntity extends MachineBaseTileEntity{
+public class MuffleFurnanceTileEntity extends MachineBaseTileEntity {
protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("mufflefurnace");
-
- public MuffleFurnanceTileEntity()
- {
+
+ public MuffleFurnanceTileEntity() {
super(2);
+ this.input.setStackSizeLimit(32);
}
-
+
@Override
public String getStartSoundFile() {
return null;
@@ -56,80 +55,72 @@ public class MuffleFurnanceTileEntity extends MachineBaseTileEntity{ public ContainerBase<?> getGuiContainer(EntityPlayer player) {
return new MuffleFurnanceContainer(player, this);
}
-
- @Override
- public boolean canOperate()
- {
- ItemStack crucible = input.getItemStack(IHLMod.crucible);
- if(crucible!=null)
- {
- return true;
- }
- ItemStack mold = input.getItemStack(IHLUtils.getThisModItem("injectionMold"));
- if(mold!=null)
- {
- return true;
- }
- return getOutput()!=null;
- }
-
+
+ @Override
+ public boolean canOperate() {
+ ItemStack crucible = input.getItemStack(IHLMod.crucible);
+ if (crucible != null) {
+ return true;
+ }
+ ItemStack mold = input.getItemStack(IHLUtils.getThisModItem("injectionMold"));
+ if (mold != null) {
+ return true;
+ }
+ return getOutput() != null;
+ }
+
@Override
- public void operate()
- {
- ItemStack crucible = input.getItemStack(IHLMod.crucible);
- if(crucible!=null)
- {
- ((Crucible)crucible.getItem()).processContent(crucible, this);
- return;
- }
- ItemStack mold = input.getItemStack(IHLUtils.getThisModItem("injectionMold"));
- if(mold!=null)
- {
- mold.stackTagCompound.setBoolean("isContainStearin", false);
- return;
- }
- if(this.getOutput()!=null)
- {
- List<RecipeOutputItemStack> output = MuffleFurnanceTileEntity.recipeManager.getOutputFor(null,this.input.getItemStackList(), true, true).getItemOutputs();
- for(int i=0; i<this.input.size();i++)
- {
- if(i<output.size() && output.get(i)!=null)
- {
+ public void operate() {
+ ItemStack crucible = input.getItemStack(IHLMod.crucible);
+ if (crucible != null) {
+ ((Crucible) crucible.getItem()).processContent(crucible, this);
+ return;
+ }
+ ItemStack mold = input.getItemStack(IHLUtils.getThisModItem("injectionMold"));
+ if (mold != null) {
+ mold.stackTagCompound.setBoolean("isContainStearin", false);
+ return;
+ }
+ if (this.getOutput() != null) {
+ UniversalRecipeOutput routput = recipeManager
+ .getOutputFor(null, this.input.getItemStackList(), true, true);
+ List<RecipeOutputItemStack> output = routput.getItemOutputs();
+ for (int i = 0; i < this.input.size(); i++) {
+ if (i < output.size() && output.get(i) != null) {
ItemStack outStack = output.get(i).itemStack.copy();
- outStack.stackSize=Math.round(output.get(i).quantity);
- if(this.input.get(i)!=null)
- {
- outStack.stackTagCompound=this.input.get(i).stackTagCompound;
+ outStack.stackSize = Math.round(output.get(i).quantity);
+ if (this.input.get(i) != null) {
+ outStack.stackTagCompound = this.input.get(i).stackTagCompound;
}
- this.input.put(i,outStack);
+ this.input.put(i, outStack);
}
- if(this.input.get(i)!=null && this.input.get(i).stackSize<=0)this.input.put(i, null);
+ if (this.input.get(i) != null && this.input.get(i).stackSize <= 0)
+ this.input.put(i, null);
}
}
}
-
- public static void addRecipe(ItemStack input1, ItemStack output)
- {
- recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input1})),new UniversalRecipeOutput(null, (new ItemStack [] {output}),20));
+
+ public static void addRecipe(ItemStack input1, ItemStack output) {
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] { input1 })),
+ new UniversalRecipeOutput(null, (new ItemStack[] { output }), 20));
}
-
public static Map<UniversalRecipeInput, UniversalRecipeOutput> getRecipes() {
return recipeManager.getRecipes();
}
-
- @Override
- public UniversalRecipeOutput getOutput()
- {
- return MuffleFurnanceTileEntity.recipeManager.getOutputFor(null,this.input.getItemStackList(), false, false);
- }
-
- public static void addRecipe(UniversalRecipeInput universalRecipeInput, UniversalRecipeOutput universalRecipeOutput)
- {
+
+ @Override
+ public UniversalRecipeOutput getOutput() {
+ return MuffleFurnanceTileEntity.recipeManager.getOutputFor(null, this.input.getItemStackList(), false, false);
+ }
+
+ public static void addRecipe(UniversalRecipeInput universalRecipeInput,
+ UniversalRecipeOutput universalRecipeOutput) {
recipeManager.addRecipe(universalRecipeInput, universalRecipeOutput);
}
public static void addRecipe(ItemStack input1, ItemStack output, float f) {
- recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack [] {input1})),new UniversalRecipeOutput(null, (new RecipeOutputItemStack [] {new RecipeOutputItemStack(output,f)}),20));
+ recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] { input1 })), new UniversalRecipeOutput(
+ null, (new RecipeOutputItemStack[] { new RecipeOutputItemStack(output, f) }), 20));
}
}
|
