From 5cb4c6e24033cf337812390d99a6817d24d21eab Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Sun, 12 Feb 2017 20:43:03 +0300 Subject: Removed explosion radius limitations. Explosion calculation optimized (reduced memory usage). One more detonator and explosive pack recipe. GT6 recipes for both chemical reactors and cryogenic distiller. Max stack size of muffle furnace is limited to 32. A lot of old features are removed. --- .../metallurgy/MuffleFurnanceTileEntity.java | 121 ++++++++++----------- 1 file changed, 56 insertions(+), 65 deletions(-) (limited to 'ihl/processing/metallurgy/MuffleFurnanceTileEntity.java') 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 output = MuffleFurnanceTileEntity.recipeManager.getOutputFor(null,this.input.getItemStackList(), true, true).getItemOutputs(); - for(int i=0; i 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 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)); } } -- cgit v1.2.3