From 553e3e9cd7f3093ccc297b1091483755db471149 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Mon, 24 Jul 2017 14:58:11 +0200 Subject: cherry pick https://github.com/Blood-Asp/GT5-Unofficial/pull/1170 4995bc3a4e9a60987d121a09a91e856a9d97be82 beaa54eb4153e11935f6107d53272c88453e3e3d 8fa91db261def5087ff4dcf25de899de36457a98 f95d89a5e6b1ab6b3e7fab5e56f9b51e21ae78e3 f816fbbd97e8440b346e73f266ec4c452d518e77 a687bcd24ee1ff97ad6d86f84f1748e1cd0129a4 306160fb69b41376644d793803c67b85bc125af3 480f2f1413989cd155fa19310d5b6f8871c8ce6e a0c6ec45daf3203b32f0d31baef93217eb2feaf0 --- .../GT_MetaTileEntity_ElectricBlastFurnace.java | 62 +++++++++++++++++++--- 1 file changed, 56 insertions(+), 6 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities/machines/multi') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index bd63350319..71e4418faa 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -1,6 +1,7 @@ package gregtech.common.tileentities.machines.multi; import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; @@ -8,8 +9,10 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; @@ -23,6 +26,9 @@ import java.util.ArrayList; public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_MultiBlockBase { private int mHeatingCapacity = 0; + private int controllerY; + private FluidStack[] pollutionFluidStacks = new FluidStack[]{Materials.CarbonDioxide.getGas(1000), + Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000)}; public GT_MetaTileEntity_ElectricBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -46,6 +52,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace "1x Energy Hatch (Any bottom layer casing)", "1x Maintenance Hatch (Any bottom layer casing)", "1x Muffler Hatch (Top middle)", + "1x Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),", + " Recovery scales with Muffler Hatch tier", "Heat Proof Machine Casings for the rest", "Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)", "Each 1800K over the min. Heat Capacity allows for one upgraded overclock", @@ -133,6 +141,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; updateSlots(); return true; } @@ -141,6 +150,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace } private boolean checkMachineFunction(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + controllerY = aBaseMetaTileEntity.getYCoord(); int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; @@ -196,11 +206,13 @@ public class GT_MetaTileEntity_ElectricBlastFurnace if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) { return false; } - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) { - return false; + if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), 11)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) { + return false; + } } } } @@ -267,7 +279,45 @@ public class GT_MetaTileEntity_ElectricBlastFurnace } } } - + @Override + public boolean addOutput(FluidStack aLiquid) { + if (aLiquid == null) return false; + int targetHeight; + FluidStack tLiquid = aLiquid.copy(); + boolean isOutputPollution = false; + for (FluidStack pollutionFluidStack : pollutionFluidStacks) { + if (pollutionFluidStack.isFluidEqual(pollutionFluidStack)) { + isOutputPollution = true; + break; + } + } + if (isOutputPollution) { + targetHeight = this.controllerY + 3; + int pollutionReduction = 0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); + break; + } + } + tLiquid.amount = tLiquid.amount * (pollutionReduction + 5) / 100; + } else { + targetHeight = this.controllerY; + } + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) { + if (tHatch.getBaseMetaTileEntity().getYCoord() == targetHeight) { + int tAmount = tHatch.fill(tLiquid, false); + if (tAmount >= tLiquid.amount) { + return tHatch.fill(tLiquid, true) >= tLiquid.amount; + } else if (tAmount > 0) { + tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true); + } + } + } + } + return false; + } @Override public String[] getInfoData() { -- cgit From 8fad362ece3ff5777304f5afd59977b10265ad3c Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Tue, 25 Jul 2017 00:28:41 +0200 Subject: Adapted GT5U Pyrolyse Oven changes for GTNH The Pyrolyse Oven accepts all Coils. Processing speed scales linearly with Coil tier. --- .../multi/GT_MetaTileEntity_PyrolyseOven.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities/machines/multi') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index 88c03bca9b..894242bbce 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -24,6 +24,8 @@ import java.util.ArrayList; import java.util.Arrays; public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlockBase { + + private int coilMetaID; public GT_MetaTileEntity_PyrolyseOven(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -38,13 +40,16 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock "Controller Block for the Pyrolyse Oven", "Industrial Charcoal producer and Oil from Plants", "Size(WxHxD): 5x4x5, Controller (Bottom center)", - "3x1x3 Cupronickel or Kanthal Heating Coils (At the center of the bottom layer)", + "3x1x3 of Heating Coils (At the center of the bottom layer)", "1x Input Hatch/Bus (Centered 3x1x3 area in Top layer)", "1x Output Hatch/Bus (Any bottom layer casing)", "1x Maintenance Hatch (Any bottom layer casing)", "1x Muffler Hatch (Centered 3x1x3 area in Top layer)", "1x Energy Hatch (Any bottom layer casing)", "Pyrolyse Oven Casings for the rest (60 at least!)", + "Processing speed scales linearly with Coil tier:", + "CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.", + "EU/t is not affected by Coil tier", "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; } @@ -120,6 +125,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock if (this.mEUt > 0) { this.mEUt = (-this.mEUt); } + this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + coilMetaID), 1); if (tRecipe.mOutputs.length > 0) this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; if (tRecipe.mFluidOutputs.length > 0) this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; @@ -139,6 +145,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock int CasingMeta= Loader.isModLoaded("dreamcraft")?2:0; replaceDeprecatedCoils(aBaseMetaTileEntity); + boolean firstCoil = true; for (int i = -2; i < 3; i++) { for (int j = -2; j < 3; j++) { for (int h = 0; h < 4; h++) { @@ -148,8 +155,16 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings5) { return false; } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0 && aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) { + int metaID = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); + if (metaID > 6) { return false; + } else { + if (firstCoil) { + this.coilMetaID = metaID; + firstCoil = false; + } else if (metaID != this.coilMetaID) { + return false; + } } } else if (h == 3) {// innen decke (ulv casings + input + muffler) if ((!addInputToMachineList(tTileEntity, 111)) && (!addMufflerToMachineList(tTileEntity, 111))) { -- cgit From 09c132319451ea125ca4069dc1bfbfde10b48f42 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Fri, 28 Jul 2017 19:57:49 +0200 Subject: cherry pick af36dd30991f55e6589c8024cc6c2580f949895d Fixed a bug where every Fluid was put out at the top of the EBF --- .../machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/tileentities/machines/multi') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index 71e4418faa..3913d8a0f3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -286,7 +286,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace FluidStack tLiquid = aLiquid.copy(); boolean isOutputPollution = false; for (FluidStack pollutionFluidStack : pollutionFluidStacks) { - if (pollutionFluidStack.isFluidEqual(pollutionFluidStack)) { + if (tLiquid.isFluidEqual(pollutionFluidStack)) { isOutputPollution = true; break; } -- cgit