From 7305ba719930ea3fbf8aa987aeec48b33cdbd82e Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Tue, 21 Mar 2017 17:34:07 +0300 Subject: Oregen --- ihl/processing/metallurgy/AchesonFurnaceGui.java | 7 +- .../metallurgy/AchesonFurnanceContainer.java | 7 +- .../metallurgy/AchesonFurnanceTileEntity.java | 57 +++-------- .../metallurgy/BasicElectricMotorTileEntity.java | 2 + .../metallurgy/BigMachineFrameTileEntity.java | 109 --------------------- ihl/processing/metallurgy/Crucible.java | 2 +- .../DetonationSprayingMachineTileEntity.java | 12 +-- .../metallurgy/ElectricEngineInvSlot.java | 54 ---------- ihl/processing/metallurgy/ExtruderTileEntity.java | 6 +- .../metallurgy/GasWeldingStationTileEntity.java | 4 +- .../metallurgy/ImpregnatingMachineTileEntity.java | 6 +- .../metallurgy/InjectionMoldTileEntity.java | 9 +- ihl/processing/metallurgy/MuffleFurnaceGui.java | 12 +-- .../metallurgy/MuffleFurnanceContainer.java | 7 +- .../metallurgy/MuffleFurnanceTileEntity.java | 38 +++---- .../metallurgy/RollingMachinePart1TileEntity.java | 8 +- .../VulcanizationExtrudingMoldTileEntity.java | 3 +- ihl/processing/metallurgy/WireMillTileEntity.java | 4 +- .../WoodenRollingMachinePart1TileEntity.java | 6 +- 19 files changed, 73 insertions(+), 280 deletions(-) delete mode 100644 ihl/processing/metallurgy/BigMachineFrameTileEntity.java delete mode 100644 ihl/processing/metallurgy/ElectricEngineInvSlot.java (limited to 'ihl/processing/metallurgy') diff --git a/ihl/processing/metallurgy/AchesonFurnaceGui.java b/ihl/processing/metallurgy/AchesonFurnaceGui.java index 70e9d05..7665635 100644 --- a/ihl/processing/metallurgy/AchesonFurnaceGui.java +++ b/ihl/processing/metallurgy/AchesonFurnaceGui.java @@ -6,11 +6,10 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; public class AchesonFurnaceGui extends GuiContainer { - protected static final ResourceLocation achesonFurnaceBackground = new ResourceLocation("ihl", "textures/gui/GUIAchesonFurnance.png"); + protected static final ResourceLocation achesonFurnaceBackground = new ResourceLocation("ihl", "textures/gui/GUIAchesonFurnace.png"); private MachineBaseContainer container; public AchesonFurnaceGui(MachineBaseContainer machineBaseContainer) { - //the container is instanciated and passed to the superclass for handling super(machineBaseContainer); this.container=machineBaseContainer; } @@ -27,8 +26,8 @@ public class AchesonFurnaceGui extends GuiContainer { } if (this.container.tileEntity.progress > 0) { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50); - this.drawTexturedModalRect(64, 63, 197, 0, i1 + 1, 13); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(17),17); + this.drawTexturedModalRect(70,34, 197, 0, i1 + 1, 13); } fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("ihl.gui.achesonFurnance"), 40, 12, 16768125); } diff --git a/ihl/processing/metallurgy/AchesonFurnanceContainer.java b/ihl/processing/metallurgy/AchesonFurnanceContainer.java index 140ec97..2580c6c 100644 --- a/ihl/processing/metallurgy/AchesonFurnanceContainer.java +++ b/ihl/processing/metallurgy/AchesonFurnanceContainer.java @@ -8,10 +8,9 @@ public class AchesonFurnanceContainer extends MachineBaseContainer { public AchesonFurnanceContainer(EntityPlayer entityPlayer, AchesonFurnanceTileEntity tileEntity1) { super(entityPlayer, tileEntity1); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.inputElectrode, 0, 63, 40)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.inputElectrode, 1, 99, 40)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 81, 40)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 81, 22)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 40, 22)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 40, 40)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 98, 32)); } } diff --git a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java index 5709cb9..1692e62 100644 --- a/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java +++ b/ihl/processing/metallurgy/AchesonFurnanceTileEntity.java @@ -4,11 +4,9 @@ import java.util.List; import java.util.Map; import ic2.api.recipe.IRecipeInput; -import ic2.api.recipe.RecipeInputOreDict; import ic2.core.ContainerBase; -import ic2.core.block.invslot.InvSlot.Access; import ihl.IHLMod; -import ihl.processing.chemistry.ApparatusProcessableInvSlot; +import ihl.processing.invslots.IHLInvSlotOutput; import ihl.recipes.RecipeOutputItemStack; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; @@ -22,15 +20,12 @@ import cpw.mods.fml.relauncher.SideOnly; public class AchesonFurnanceTileEntity extends MachineBaseTileEntity { - 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") }; + protected static final UniversalRecipeManager recipeManager = new UniversalRecipeManager("achesonfurnace"); + public final IHLInvSlotOutput outputSlot; public AchesonFurnanceTileEntity() { super(2); - inputElectrode = new ApparatusProcessableInvSlot(this, "inputElectrode", 1, Access.IO, 2, 1); + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); } public static void addRecipe(IRecipeInput input1, IRecipeInput input2, String output1) { @@ -71,36 +66,23 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity { @Override public void operate() { - List 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)) { - this.inputElectrode.put(i, IHLUtils.getThisModItemStack("stickGraphite")); - } 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) { - ItemStack stack = output.get(i).itemStack.copy(); - 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) { - this.input.put(i, null); - } - } ItemStack crucible = input.getItemStack(IHLMod.crucible); if (crucible != null) { ((Crucible) crucible.getItem()).processContent(crucible, this); + return; + } + List output = recipeManager + .getOutputFor(getInput()).getItemOutputs(); + List rinput = recipeManager.getRecipeInput(getInput()).getItemInputs(); + for (int i = 0; i < rinput.size(); i++) { + this.input.consume(rinput.get(i)); } + this.outputSlot.add(output); } @Override public boolean canOperate() { - return this.isValidElectrode(this.inputElectrode.get(0)) && this.isValidElectrode(this.inputElectrode.get(1)) - && this.getOutput() != null; + return this.getOutput() != null; } @Override @@ -114,17 +96,6 @@ public class AchesonFurnanceTileEntity extends MachineBaseTileEntity { @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; + return AchesonFurnanceTileEntity.recipeManager.getOutputFor(this.getInput()); } } diff --git a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java index a2fa219..7f82532 100644 --- a/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java +++ b/ihl/processing/metallurgy/BasicElectricMotorTileEntity.java @@ -11,6 +11,7 @@ import ic2.core.IC2; import ic2.core.IHasGui; import ic2.core.block.invslot.InvSlot; import ic2.core.block.invslot.InvSlot.Access; +import ihl.IHLMod; import ihl.flexible_cable.FlexibleCableHolderBaseTileEntity; import ihl.flexible_cable.NodeEntity; import ihl.utils.IHLInvSlotDischarge; @@ -34,6 +35,7 @@ public abstract class BasicElectricMotorTileEntity extends FlexibleCableHolderBa public BasicElectricMotorTileEntity() { super(); + energyConsume = IHLMod.config.machineryEnergyConsume/100d; dischargeSlot = new IHLInvSlotDischarge(this, 1, Access.IO, 4, InvSlot.InvSide.BOTTOM); } diff --git a/ihl/processing/metallurgy/BigMachineFrameTileEntity.java b/ihl/processing/metallurgy/BigMachineFrameTileEntity.java deleted file mode 100644 index 0922355..0000000 --- a/ihl/processing/metallurgy/BigMachineFrameTileEntity.java +++ /dev/null @@ -1,109 +0,0 @@ -package ihl.processing.metallurgy; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import ihl.interfaces.IWorkspaceElement; -import ihl.utils.IHLUtils; - -public class BigMachineFrameTileEntity extends TileEntity implements IWorkspaceElement { - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) - { - return false; - } - - @Override - public short getFacing() - { - return 0; - } - - @Override - public void setFacing(short facing) {} - - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) - { - return true; - } - - @Override - public float getWrenchDropRate() - { - return 1.0f; - } - - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) - { - return IHLUtils.getThisModItemStack("frameSteel"); - } - - @Override - public boolean canBeUsed() - { - int ix,iy,iz; - int x = xCoord; - int y = yCoord; - int z = zCoord; - int x0 = xCoord; - int y0 = yCoord; - int z0 = zCoord; - for(ix=x;ix>x-3;ix--) - { - for(iy=y;iy>y-3;iy--) - { - for(iz=z;iz>z-3;iz--) - { - TileEntity te = worldObj.getTileEntity(ix, iy, iz); - if(te instanceof BigMachineFrameTileEntity) - { - x0=ix+1; - y0=iy+1; - z0=iz+1; - } - } - } - } - for(ix=x0-1;ix[] getInput() @@ -126,7 +124,8 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp //file tags - "GT.ToolStats"->"MaxDamage" & "Damage" if(this.canOperate()) { - List output1 = DetonationSprayingMachineTileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); + List input1 = DetonationSprayingMachineTileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); + List output1 = DetonationSprayingMachineTileEntity.recipeManager.getOutputFor(getInput()).getItemOutputs(); ItemStack resultStack = output1.get(0).itemStack.copy(); resultStack.stackSize=this.input.get(0).stackSize; if(resultStack.stackTagCompound==null) @@ -162,9 +161,10 @@ public class DetonationSprayingMachineTileEntity extends TileEntityInventory imp } } } + for(IRecipeInput stack:input1){ + this.input.consume(stack); + } this.input.put(0,resultStack); - this.input.consume(1,1); - this.input.consume(2,1); ExplosionIC2 explosion = new ExplosionIC2(worldObj, null, this.xCoord+0.5D, this.yCoord+0.5D, this.zCoord+0.5D, 0.5F, 0.3F, ExplosionIC2.Type.Normal, null, 0); explosion.doExplosion(); IC2.network.get().initiateTileEntityEvent(this, 0, true); diff --git a/ihl/processing/metallurgy/ElectricEngineInvSlot.java b/ihl/processing/metallurgy/ElectricEngineInvSlot.java deleted file mode 100644 index c89c50f..0000000 --- a/ihl/processing/metallurgy/ElectricEngineInvSlot.java +++ /dev/null @@ -1,54 +0,0 @@ -package ihl.processing.metallurgy; - -import ic2.core.Ic2Items; -import ic2.core.block.TileEntityInventory; -import ic2.core.block.invslot.InvSlot; -import net.minecraft.item.ItemStack; - -public class ElectricEngineInvSlot extends InvSlot { - - public ElectricEngineInvSlot(TileEntityInventory base1, String name1, - int oldStartIndex1, Access access1, int count, int stackSizeLimit1) { - super(base1, name1, oldStartIndex1, access1, count); - this.setStackSizeLimit(stackSizeLimit1); - } - - public float getEfficiency() - { - if(this.isEmpty()) - { - return 0F; - } - else if(this.get().getItem() instanceof ElectricEngineItem) - { - return ((ElectricEngineItem)this.get().getItem()).type.efficiency; - } - else if(this.get().getItem() == Ic2Items.elemotor.getItem() && this.get().getItemDamage() == Ic2Items.elemotor.getItemDamage()) - { - return 0.2f; - } - else - { - return 0f; - } - } - - @Override - public boolean accepts(ItemStack stack) - { - if(stack!=null && stack.getItem() == Ic2Items.elemotor.getItem() && stack.getItemDamage() == Ic2Items.elemotor.getItemDamage()) - { - return true; - } - else - { - return stack==null?true:stack.getItem() instanceof ElectricEngineItem; - } - } - - public boolean correctContent() - { - return this.get()==null?false:this.get().stackSize==1 && ((this.get().getItem() instanceof ElectricEngineItem) || (this.get().getItem() == Ic2Items.elemotor.getItem() && this.get().getItemDamage() == Ic2Items.elemotor.getItemDamage())); - } - -} diff --git a/ihl/processing/metallurgy/ExtruderTileEntity.java b/ihl/processing/metallurgy/ExtruderTileEntity.java index a654bfc..53447b4 100644 --- a/ihl/processing/metallurgy/ExtruderTileEntity.java +++ b/ihl/processing/metallurgy/ExtruderTileEntity.java @@ -89,13 +89,13 @@ public class ExtruderTileEntity extends BasicElectricMotorTileEntity{ { UniversalRecipeInput ri = ExtruderTileEntity.recipeManager.getRecipeInput(getInput()); this.fluidTank.fill(getOutput().getFluidOutputs().get(0), true); - this.input.consume(0,ri.getItemInputs().get(0).getAmount()); - this.input2.consume(0,ri.getItemInputs().get(1).getAmount()); + this.input.consume(ri.getItemInputs().get(0)); + this.input2.consume(ri.getItemInputs().get(1)); } public UniversalRecipeOutput getOutput() { - return ExtruderTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); + return ExtruderTileEntity.recipeManager.getOutputFor(this.getInput()); } @SuppressWarnings({ "unchecked", "rawtypes" }) diff --git a/ihl/processing/metallurgy/GasWeldingStationTileEntity.java b/ihl/processing/metallurgy/GasWeldingStationTileEntity.java index ff15f5a..54f4177 100644 --- a/ihl/processing/metallurgy/GasWeldingStationTileEntity.java +++ b/ihl/processing/metallurgy/GasWeldingStationTileEntity.java @@ -148,7 +148,7 @@ public class GasWeldingStationTileEntity extends TileEntityInventory implements public boolean canProduceGas() { - UniversalRecipeOutput rOutput = GasWeldingStationTileEntity.acetyleneRecipeManager.getOutputFor(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()}), false, false); + UniversalRecipeOutput rOutput = GasWeldingStationTileEntity.acetyleneRecipeManager.getOutputFor(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()})); return rOutput!=null; } @@ -157,7 +157,7 @@ public class GasWeldingStationTileEntity extends TileEntityInventory implements if(canProduceGas()) { UniversalRecipeInput rInput = GasWeldingStationTileEntity.acetyleneRecipeManager.getRecipeInput(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()})); - UniversalRecipeOutput rOutput = GasWeldingStationTileEntity.acetyleneRecipeManager.getOutputFor(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()}), false, false); + UniversalRecipeOutput rOutput = GasWeldingStationTileEntity.acetyleneRecipeManager.getOutputFor(Arrays.asList(new FluidStack[]{this.flammableGasTank.getFluid()}), Arrays.asList(new ItemStack[]{this.input.get()})); FluidStack output1 = rOutput.getFluidOutputs().get(0).copy(); FluidStack output2 = rOutput.getFluidOutputs().get(1).copy(); this.flammableGasTank.drain(rInput.getFluidInputs().get(0), true); diff --git a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java index 2ea5d2e..1a15f06 100644 --- a/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java +++ b/ihl/processing/metallurgy/ImpregnatingMachineTileEntity.java @@ -216,7 +216,7 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement public UniversalRecipeOutput getOutput() { - return ImpregnatingMachineTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); + return ImpregnatingMachineTileEntity.recipeManager.getOutputFor(this.getInput()); } @SuppressWarnings("rawtypes") @@ -229,7 +229,7 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement if(i!=i1) { List[] rInput = new List[]{Arrays.asList(new FluidStack[]{fluidTank.getFluid(i),fluidTank.getFluid(i1)}), this.input.getItemStackList()}; - if(ImpregnatingMachineTileEntity.recipeManager.getOutputFor(rInput, false, false)!=null) + if(ImpregnatingMachineTileEntity.recipeManager.getOutputFor(rInput)!=null) { return rInput; } @@ -245,7 +245,7 @@ public class ImpregnatingMachineTileEntity extends TileEntityInventory implement UniversalRecipeOutput output1 = getOutput(); for(int i=0; i resultList = OreDictionary.getOres(this.resultSuffix+formattedFluidName); if(resultList.isEmpty() || fluidAmountPerItem<=0) { -// IHLMod.log.info("Injection mold: resultList.isEmpty() || fluidAmountPerItem<=0"); resultList=new ArrayList(); List fi = Arrays.asList(new FluidStack[] {this.fluidTank.getFluid()}); List ii = Arrays.asList(new ItemStack[] {IHLUtils.getThisModItemStackWithDamage("injectionMold", this.resultSuffix.hashCode() & Integer.MAX_VALUE)}); - UniversalRecipeOutput ro = recipeManager.getOutputFor(fi, ii, false, false); + UniversalRecipeOutput ro = recipeManager.getOutputFor(fi, ii); if(ro!=null) { - // IHLMod.log.info("Injection mold: ro not null"); ItemStack stack = ro.getItemOutputs().get(0).itemStack.copy(); stack.stackSize=Math.round(ro.getItemOutputs().get(0).quantity); resultList.add(stack); UniversalRecipeInput ri = recipeManager.getRecipeInput(fi, ii); fluidAmountPerItem = ri.getFluidInputs().get(0).getAmount(); - // IHLMod.log.info("fluidAmountPerItem="+fluidAmountPerItem); - } - else - { - // IHLMod.log.info("Injection mold: ro is null. Input stack: "+ii.get(0).toString()); } } int fluidAmountPerItem2 = Details.getMeltingFluidAmount("nugget"); diff --git a/ihl/processing/metallurgy/MuffleFurnaceGui.java b/ihl/processing/metallurgy/MuffleFurnaceGui.java index ffd664d..bf0df24 100644 --- a/ihl/processing/metallurgy/MuffleFurnaceGui.java +++ b/ihl/processing/metallurgy/MuffleFurnaceGui.java @@ -6,7 +6,7 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; public class MuffleFurnaceGui extends GuiContainer { - protected static final ResourceLocation muffleFurnaceBackground = new ResourceLocation("ihl", "textures/gui/GUIMuffleFurnace.png"); + protected static final ResourceLocation muffleFurnaceBackground = new ResourceLocation("ihl", "textures/gui/GUIAchesonFurnace.png"); private MachineBaseContainer container; public MuffleFurnaceGui(MachineBaseContainer machineBaseContainer) { @@ -17,22 +17,18 @@ public class MuffleFurnaceGui extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - int xOffset = (this.width - xSize) / 2; - int yOffset = (this.height - ySize) / 2; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(muffleFurnaceBackground); int i1; if (this.container.tileEntity.getEnergy() > 0D) { i1 = Math.min(this.container.tileEntity.getGUIEnergy(12),12); - this.drawTexturedModalRect(8, 14 + 12 - i1, 179, 12 - i1, 14, i1 + 2); + this.drawTexturedModalRect(8, 6 + 12 - i1, 179, 12 - i1, 14, i1 + 2); } if (this.container.tileEntity.progress > 0) { - i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(50),50); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - this.drawTexturedModalRect(44, 57, 197, 0, i1 + 1, 13); + i1 = Math.min(this.container.tileEntity.gaugeProgressScaled(17),17); + this.drawTexturedModalRect(70,34, 197, 0, i1 + 1, 13); } fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("ihl.gui.muffleFurnace"), 40, 12, 16768125); diff --git a/ihl/processing/metallurgy/MuffleFurnanceContainer.java b/ihl/processing/metallurgy/MuffleFurnanceContainer.java index a36ac3c..1ae7203 100644 --- a/ihl/processing/metallurgy/MuffleFurnanceContainer.java +++ b/ihl/processing/metallurgy/MuffleFurnanceContainer.java @@ -6,10 +6,11 @@ import net.minecraft.entity.player.EntityPlayer; public class MuffleFurnanceContainer extends MachineBaseContainer { public MuffleFurnanceContainer(EntityPlayer entityPlayer, - MachineBaseTileEntity tileEntity1) { + MuffleFurnanceTileEntity tileEntity1) { super(entityPlayer, tileEntity1); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 51, 34)); - this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 69, 34)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 0, 40, 22)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.input, 1, 40, 40)); + this.addSlotToContainer(new SlotInvSlot(tileEntity1.outputSlot, 0, 98, 32)); } } diff --git a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java index 55db3db..3994bd7 100644 --- a/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java +++ b/ihl/processing/metallurgy/MuffleFurnanceTileEntity.java @@ -3,8 +3,11 @@ package ihl.processing.metallurgy; import java.util.List; import java.util.Map; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputOreDict; import ic2.core.ContainerBase; import ihl.IHLMod; +import ihl.processing.invslots.IHLInvSlotOutput; import ihl.recipes.RecipeOutputItemStack; import ihl.recipes.UniversalRecipeInput; import ihl.recipes.UniversalRecipeManager; @@ -19,10 +22,11 @@ import cpw.mods.fml.relauncher.SideOnly; public class MuffleFurnanceTileEntity extends MachineBaseTileEntity { protected static UniversalRecipeManager recipeManager = new UniversalRecipeManager("mufflefurnace"); + public final IHLInvSlotOutput outputSlot; public MuffleFurnanceTileEntity() { super(2); - this.input.setStackSizeLimit(32); + this.outputSlot = new IHLInvSlotOutput(this, "output", 0, 1); } @Override @@ -81,27 +85,17 @@ public class MuffleFurnanceTileEntity extends MachineBaseTileEntity { mold.stackTagCompound.setBoolean("isContainStearin", false); return; } - if (this.getOutput() != null) { - UniversalRecipeOutput routput = recipeManager - .getOutputFor(null, this.input.getItemStackList(), true, true); - List 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; - } - this.input.put(i, outStack); - } - if (this.input.get(i) != null && this.input.get(i).stackSize <= 0) - this.input.put(i, null); - } + List output = recipeManager + .getOutputFor(getInput()).getItemOutputs(); + List rinput = recipeManager.getRecipeInput(getInput()).getItemInputs(); + for (int i = 0; i < rinput.size(); i++) { + this.input.consume(rinput.get(i)); } + this.outputSlot.add(output); } - public static void addRecipe(ItemStack input1, ItemStack output) { - recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] { input1 })), + public static void addRecipe(IRecipeInput recipeInputOreDict, ItemStack output) { + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] { recipeInputOreDict })), new UniversalRecipeOutput(null, (new ItemStack[] { output }), 20)); } @@ -111,7 +105,7 @@ public class MuffleFurnanceTileEntity extends MachineBaseTileEntity { @Override public UniversalRecipeOutput getOutput() { - return MuffleFurnanceTileEntity.recipeManager.getOutputFor(null, this.input.getItemStackList(), false, false); + return MuffleFurnanceTileEntity.recipeManager.getOutputFor(null, this.input.getItemStackList()); } public static void addRecipe(UniversalRecipeInput universalRecipeInput, @@ -119,8 +113,8 @@ public class MuffleFurnanceTileEntity extends MachineBaseTileEntity { recipeManager.addRecipe(universalRecipeInput, universalRecipeOutput); } - public static void addRecipe(ItemStack input1, ItemStack output, float f) { - recipeManager.addRecipe(new UniversalRecipeInput(null, (new ItemStack[] { input1 })), new UniversalRecipeOutput( + public static void addRecipe(IRecipeInput recipeInputOreDict, ItemStack output, float f) { + recipeManager.addRecipe(new UniversalRecipeInput(null, (new IRecipeInput[] { recipeInputOreDict })), new UniversalRecipeOutput( null, (new RecipeOutputItemStack[] { new RecipeOutputItemStack(output, f) }), 20)); } } diff --git a/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java b/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java index a3d6ae6..dc2d293 100644 --- a/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java +++ b/ihl/processing/metallurgy/RollingMachinePart1TileEntity.java @@ -4,6 +4,7 @@ import java.util.Arrays; import java.util.List; import java.util.Map; +import ic2.api.recipe.IRecipeInput; import ic2.core.ContainerBase; import ic2.core.IC2; import ic2.core.block.invslot.InvSlot.Access; @@ -38,7 +39,7 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ public UniversalRecipeOutput getOutput() { - return RollingMachinePart1TileEntity.recipeManager.getOutputFor(this.getInput(), false, false); + return RollingMachinePart1TileEntity.recipeManager.getOutputFor(this.getInput()); } @Override @@ -101,9 +102,10 @@ public class RollingMachinePart1TileEntity extends BasicElectricMotorTileEntity{ @Override public void operate() { - List output = RollingMachinePart1TileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); + List rinput = recipeManager.getRecipeInput(getInput()).getItemInputs(); + List output = RollingMachinePart1TileEntity.recipeManager.getOutputFor(getInput()).getItemOutputs(); this.output.add(output); - this.input.consume(0, 1); + this.input.consume(rinput.get(0)); } @SuppressWarnings({ "rawtypes", "unchecked" }) diff --git a/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java b/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java index e052ad7..bb51ced 100644 --- a/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java +++ b/ihl/processing/metallurgy/VulcanizationExtrudingMoldTileEntity.java @@ -175,8 +175,7 @@ public class VulcanizationExtrudingMoldTileEntity extends TileEntity private ItemStack processWire(ItemStack wire, boolean doProcess) { UniversalRecipeOutput rOutput = VulcanizationExtrudingMoldTileEntity.recipeManager.getOutputFor( - Arrays.asList(new FluidStack[] { this.fluidTank.getFluid() }), Arrays.asList(new ItemStack[] { wire }), - false, false); + Arrays.asList(new FluidStack[] { this.fluidTank.getFluid() }), Arrays.asList(new ItemStack[] { wire })); if (rOutput == null || this.energy < this.energyConsume) { return wire; } diff --git a/ihl/processing/metallurgy/WireMillTileEntity.java b/ihl/processing/metallurgy/WireMillTileEntity.java index 4216960..f69ea9a 100644 --- a/ihl/processing/metallurgy/WireMillTileEntity.java +++ b/ihl/processing/metallurgy/WireMillTileEntity.java @@ -124,7 +124,7 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements } else { - dice.consume(0, 1); + dice.consume(rInputDice); } } if(this.drainInputSlot.get()!=null && !rInput.getItemInputs().isEmpty() && rInput.getItemInputs().get(0).matches(this.drainInputSlot.get())) @@ -157,7 +157,7 @@ public class WireMillTileEntity extends BasicElectricMotorTileEntity implements public UniversalRecipeOutput getOutput() { - return WireMillTileEntity.recipeManager.getOutputFor(this.getInput(), false, false); + return WireMillTileEntity.recipeManager.getOutputFor(this.getInput()); } public static void addRecipe(FluidStack moltenMetal, IRecipeInput inputDice,ItemStack output1) diff --git a/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java b/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java index 5c786c5..4dd1f1c 100644 --- a/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java +++ b/ihl/processing/metallurgy/WoodenRollingMachinePart1TileEntity.java @@ -40,7 +40,7 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE public UniversalRecipeOutput getOutput() { - return WoodenRollingMachinePart1TileEntity.recipeManager.getOutputFor(this.getInput(), false, false); + return WoodenRollingMachinePart1TileEntity.recipeManager.getOutputFor(this.getInput()); } @Override @@ -104,11 +104,11 @@ public class WoodenRollingMachinePart1TileEntity extends BasicElectricMotorTileE public void operate() { List rInput = WoodenRollingMachinePart1TileEntity.recipeManager.getRecipeInput(getInput()).getItemInputs(); - List rOutput = WoodenRollingMachinePart1TileEntity.recipeManager.getOutputFor(getInput(), false, false).getItemOutputs(); + List rOutput = WoodenRollingMachinePart1TileEntity.recipeManager.getOutputFor(getInput()).getItemOutputs(); this.output.add(rOutput); for(int i=0;i