From 0ebbaf88ecce9a0e6fcd84498a0e4f1bcf387331 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 31 Dec 2019 15:22:02 +0000 Subject: + Added the Adv. DT. (Locked to T1 for now) + Added 10 new casing blocks, with assembler recipes. - Removed obsolete Chunkloading classes. --- ...egtechMetaTileEntity_Adv_DistillationTower.java | 374 +++++++++++++++++++++ 1 file changed, 374 insertions(+) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java new file mode 100644 index 0000000000..9bed1846b7 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java @@ -0,0 +1,374 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +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 gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.ArrayList; + +public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_MultiBlockBase { + + private static final int CASING_INDEX = 49; + + private short mControllerY = 0; + + private byte mMode = 0; + + public GregtechMetaTileEntity_Adv_DistillationTower(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_Adv_DistillationTower(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_Adv_DistillationTower(this.mName); + } + + public String[] getTooltip() { + String s = "Max parallel dictated by tower tier and mode"; + String s1 = "DTower Mode: T1=4, T2=12"; + String s2 = "Distilery Mode: Tower Tier * (4*InputTier)"; + return new String[]{ + "Controller Block for the Advanced Distillation Tower", + "T1 constructed identical to standard DT", + "T2 is not variable height", + "Size(WxHxD): 3x26x3", + "Controller (Front bottom)", + "1x Input Hatch (Any bottom layer casing)", + "24x Output Hatch (One per layer except bottom/top layer)", + "1x Output Bus (Any bottom layer casing)", + "1x Maintenance Hatch (Any casing)", + "1x Energy Hatch (Any casing)", + "Clean Stainless Steel Machine Casings for the rest ((7 x 25) - 5 at least!)", + s, + s1, + s2}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX]}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return mMode == 0 ? GT_Recipe.GT_Recipe_Map.sDistillationRecipes : GT_Recipe.GT_Recipe_Map.sDistilleryRecipes; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return this.mMode == 1 ? 12 : 24; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setByte("mMode", mMode); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mMode = aNBT.getByte("mMode"); + super.loadNBTData(aNBT); + } + + @Override + public String getSound() { + return GregTech_API.sSoundList.get(Integer.valueOf(203)); + } + + @Override + public void startProcess() { + this.sendLoopStart((byte) 1); + } + + @Override + public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + mMode++; + if (mMode > 1){ + mMode = 0; + PlayerUtils.messagePlayer(aPlayer, "Now running in Distillation Tower Mode."); + } + else { + PlayerUtils.messagePlayer(aPlayer, "Now running in Distillery Mode."); + } + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public boolean addOutput(FluidStack aLiquid) { + if (aLiquid == null) return false; + FluidStack tLiquid = aLiquid.copy(); + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) { + if (tHatch.getBaseMetaTileEntity().getYCoord() == this.mControllerY + 1) { + 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 + protected void addFluidOutputs(FluidStack[] mOutputFluids2) { + for (int i = 0; i < mOutputFluids2.length; i++) { + if (mOutputHatches.size() > i && mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity(mOutputHatches.get(i))) { + if (mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord() == this.mControllerY + 1 + i) { + mOutputHatches.get(i).fill(mOutputFluids2[i], true); + } + } + } + + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + + @Override + public String getCustomGUIResourceName() { + return "DistillationTower"; + } + + @Override + public String getMachineType() { + return "Distillery, Distillation Tower"; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) { + ArrayList tBusItems = new ArrayList(); + tBus.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tBus)) { + for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) + tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + ItemStack[] inputs = new ItemStack[tBusItems.size()]; + int slot = 0; + for (ItemStack g : tBusItems) { + inputs[slot++] = g; + } + if (inputs.length > 0) { + int para = (4* GT_Utility.getTier(this.getMaxInputVoltage())); + log("Recipe. ["+inputs.length+"]["+para+"]"); + if (checkRecipeGeneric(inputs, new FluidStack[]{}, para, 100, 250, 10000)) { + log("Recipe 2."); + return true; + } + } + + } + return false; + } + + @Override + public int getMaxParallelRecipes() { + if (this.mMode == 0) { + return getTierOfTower() == 1 ? 4 : getTierOfTower() == 2 ? 12 : 0; + } + else if (this.mMode == 1) { + return getTierOfTower() * (4 * GT_Utility.getTier(this.getMaxInputVoltage())); + } + return 0; + } + + @Override + public int getEuDiscountForParallelism() { + return 15; + } + + @Override + public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int aTier = getTierOfTower(); + if (aTier > 0) { + if (aTier == 1) { + return checkTierOneTower(aBaseMetaTileEntity, aStack); + } + else if (aTier == 2) { + return checkTierTwoTower(aBaseMetaTileEntity, aStack); + } + } + return false; + } + + private int getTierOfTower() { + return 1; + } + + private boolean checkTierOneTower(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mControllerY = aBaseMetaTileEntity.getYCoord(); + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + int y = 0; //height + int casingAmount = 0; + boolean reachedTop = false; + + for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width + for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth + if (x != 0 || z != 0) { + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (!addInputToMachineList(tileEntity, CASING_INDEX) + && !addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + casingAmount++; + } else { + return false; + } + } + } + } + } + y++; + + while (y < 12 && !reachedTop) { + for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width + for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (aBaseMetaTileEntity.getAirOffset(x, y, z)) { + if (x != xDir || z != zDir) { + return false; + } + } else { + if (x == xDir && z == zDir) { + reachedTop = true; + } + if (!addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + casingAmount++; + } else { + return false; + } + } + } + } + } + y++; + } + return casingAmount >= 7 * y - 5 && y >= 3 && y <= 12 && reachedTop; + } + + private boolean checkTierTwoTower(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mControllerY = aBaseMetaTileEntity.getYCoord(); + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + int y = 0; //height + int casingAmount = 0; + boolean reachedTop = false; + + for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width + for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth + if (x != 0 || z != 0) { + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (!addInputToMachineList(tileEntity, CASING_INDEX) + && !addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + casingAmount++; + } else { + return false; + } + } + } + } + } + y++; + + while (y < 12 && !reachedTop) { + for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width + for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (aBaseMetaTileEntity.getAirOffset(x, y, z)) { + if (x != xDir || z != zDir) { + return false; + } + } else { + if (x == xDir && z == zDir) { + reachedTop = true; + } + if (!addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + casingAmount++; + } else { + return false; + } + } + } + } + } + y++; + } + return casingAmount >= 7 * y - 5 && y >= 3 && y <= 12 && reachedTop; + } + +} \ No newline at end of file -- cgit From 9580c236c773899405c81a45cd6d670cdc12d4e4 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 6 Jan 2020 05:28:19 +0000 Subject: + Added recipe for Distillus. + Added recipes for Chunkloaders. + Added recipe for Algae Farm. + Added recipes for Overflow Hatches. % Halved recipe time on Algae Farming, enabled use of compost to increase output. $ Potentially fixed the Overflow Hatches. --- .../advanced/GregtechMetaTileEntity_Adv_DistillationTower.java | 3 ++- .../machines/multi/production/algae/GregtechMTE_AlgaePondBase.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java index 9bed1846b7..e5387d8c6f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java @@ -54,6 +54,7 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M return new String[]{ "Controller Block for the Advanced Distillation Tower", "T1 constructed identical to standard DT", + "T2 is currently disabled.", "T2 is not variable height", "Size(WxHxD): 3x26x3", "Controller (Front bottom)", @@ -62,7 +63,7 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M "1x Output Bus (Any bottom layer casing)", "1x Maintenance Hatch (Any casing)", "1x Energy Hatch (Any casing)", - "Clean Stainless Steel Machine Casings for the rest ((7 x 25) - 5 at least!)", + "Integral Framework I's for the rest", s, s1, s2}; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index fda79876f6..a05ecca551 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -61,6 +61,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { return new String[] { "Grows Algae!", "Controller Block for the Algae Farm", + "Provide compost to boost production by one tier", "Size: 9x3x9 [WxHxL] (open)", "X X", "X X", -- cgit From a93e2aa92384f595dcb5907f5b88a220c6735cf0 Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Wed, 8 Jan 2020 00:12:46 +0100 Subject: ChemPlant & Catalyst Consumption (#598) % Make some Itemstacks static. % Higher tier coils speed up ChemPlant. % Redused catalyst consumption in ChemPlant. $ Some clean up. $ Fix that recipes without catalyst wont start. $ Redone catalyst code for it to better work with parrallel and it not failing recipe after consumed item. % Formatting/Spelling % Greatly improved the ChemPlant's Tooltip. % Tooltip update. % Made the tooltip a little bit clearer. Co-authored-by: Alkalus <3060479+draknyte1@users.noreply.github.com> --- .../chemplant/GregtechMTE_ChemicalPlant.java | 372 +++++++++++++++++++-- 1 file changed, 344 insertions(+), 28 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 654d036bf8..81a25b3266 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -1,41 +1,63 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.chemplant; import static gregtech.api.enums.GT_Values.E; +import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collection; import java.util.HashSet; +import java.util.List; + +import org.apache.commons.lang3.ArrayUtils; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.Recipe_GT; +import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour; +import gtPlusPlus.core.item.chemistry.AgriculturalChem; +import gtPlusPlus.core.item.chemistry.GenericChem; +import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { - + private int mSolidCasingTier = 0; private int mMachineCasingTier = 0; private int mPipeCasingTier = 0; private int mCoilTier = 0; + /** * Internal Recipe Map which holds the actual recipes, backed by the real map, shown by NEI. */ @@ -78,13 +100,30 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { @Override public String[] getTooltip() { return new String[] { - "Heavy Industry, now right at your doorstep!", "Controller Block for the Chemical Plant", - "27 Coils", - "18 Pipe Casings", - "57 Tiered Machine Casings", + "Heavy Industry, now right at your doorstep!", + "Solid Casings dictate Chemical Plant tier", + "Machine Casings dictate Hatch tier", + "Higher tier coils speed up the machine", + "CuNi 50% , FeAlCr 100% , Ni4Cr 150% , ...", + "Higher tier pipe casings boost parallel and reduce catalyst consumption", + "+2 parallel per tier, 20% extra chance of not damaging catalyst per tier", + "27x Coils", + "18x Pipe Casings", + "57x Tiered Machine Casings", "80+ Solid Casings", - "Hatch tier is limited to Machine Casing tier", + "Construction Guide:", + "Controller is placed on a middle casing in the bottom layer", + "Hatches can only be placed on the bottom layer edges", + "7x7x7 Hollow frame of solid casings", + "5x1x5 layer of solid casings (fills in top layer)", + "5x1x5 layer of machine casings (fills in bottom layer)", + "In the central 3x5x3:", + "3x1x3 layer of Coils, surrounded by ring of Machine Casings", + "3x1x3 layer of Pipe Casings", + "3x1x3 layer of Coils", + "3x1x3 layer of Pipe Casings", + "3x1x3 layer of Coils, surrounded by ring of Machine Casings", }; } @@ -121,7 +160,6 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { aOriginalTexture = Textures.BlockIcons.CASING_BLOCKS[11]; } - if (aSide == aFacing) { return new ITexture[]{aOriginalTexture, new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; } @@ -158,7 +196,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { @Override public int getEuDiscountForParallelism() { - return 0; + return 100; } private int getSolidCasingTier() { @@ -699,24 +737,6 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { } - - - - - - - - - - - - - - - - - - @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; @@ -741,6 +761,15 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { public String getCustomGUIResourceName() { return null; } + + // Same speed bonus as pyro oven + public int getSpeedBonus() { + return 50 * (this.mCoilTier - 2); + } + + public int getMaxCatalystDurability() { + return 50; + } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { @@ -758,10 +787,297 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { } @Override - public boolean checkRecipe(final ItemStack aStack) { - return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0); + public boolean checkRecipe(final ItemStack aStack) { + return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), getSpeedBonus()); } + + + @Override + public boolean checkRecipeGeneric( + ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + int aMaxParallelRecipes, int aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { + + // Based on the Processing Array. A bit overkill, but very flexible. + + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); + log("Running checkRecipeGeneric(0)"); + + GT_Recipe tRecipe = findRecipe( + getBaseMetaTileEntity(), mLastRecipe, false, + gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); + + + log("Running checkRecipeGeneric(1)"); + // Remember last recipe - an optimization for findRecipe() + this.mLastRecipe = tRecipe; + + + if (tRecipe == null) { + log("BAD RETURN - 1"); + return false; + } + + if (tRecipe.mSpecialValue > this.mSolidCasingTier) { + log("solid tier is too low"); + return false; + } + + + if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { + log("BAD RETURN - 2"); + return false; + } + + // checks if it has enough catalyst durabilety + ArrayListtCatalysts = null; + int tMaxParrallelCatalyst = aMaxParallelRecipes; + ItemStack tCatalystRecipe = findCatalyst(tRecipe.mInputs); + if (tCatalystRecipe != null) { + log("needs catalyst"); + tCatalysts = new ArrayList(); + tMaxParrallelCatalyst = getCatalysts(aItemInputs, tCatalystRecipe, aMaxParallelRecipes,tCatalysts); + } + + if (tMaxParrallelCatalyst == 0) { + log("found not enough catalists catalyst"); + return false; + } + + // EU discount + float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; + float tTotalEUt = 0.0f; + log("aEUPercent "+aEUPercent); + log("mEUt "+tRecipe.mEUt); + + int parallelRecipes = 0; + + log("parallelRecipes: "+parallelRecipes); + log("aMaxParallelRecipes: "+tMaxParrallelCatalyst); + log("tTotalEUt: "+tTotalEUt); + log("tVoltage: "+tVoltage); + log("tEnergy: "+tEnergy); + log("tRecipeEUt: "+tRecipeEUt); + // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits + for (; parallelRecipes < tMaxParrallelCatalyst && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { + log("Broke at "+parallelRecipes+"."); + break; + } + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; + } + + if (parallelRecipes == 0) { + log("BAD RETURN - 3"); + return false; + } + + if (tCatalysts != null) { + log("damaging catalyst"); + for (int j = 0;j aOutPut) { + int allowedParrallel = 0; + for (final ItemStack aInput : aItemInputs) { + if (aRecipeCatalyst.isItemEqual(aInput)) { + if (aInput.stackSize == 1) { + int damage = getDamage(aInput) + aMaxParrallel; + if (damage >getMaxCatalystDuarbilerty() ) { + aOutPut.add(aInput); + allowedParrallel += aMaxParrallel + (getMaxCatalystDuarbilerty() - damage); + if (allowedParrallel >aMaxParrallel ) { + return aMaxParrallel; + } + continue; + } + } + aOutPut.add(aInput); + return aMaxParrallel; + } + } + return allowedParrallel; + } + + private ItemStack findCatalyst(ItemStack[] aItemInputs) { + if (aItemInputs != null) { + for (final ItemStack aInput : aItemInputs) { + if (aInput != null) { + if (aInput.isItemEqual(GenericChem.mRedCatalyst)) + return aInput; + else if (aInput.isItemEqual(GenericChem.mYellowCatalyst)) + return aInput; + else if (aInput.isItemEqual(GenericChem.mBlueCatalyst)) + return aInput; + else if (aInput.isItemEqual(GenericChem.mOrangeCatalyst)) + return aInput; + else if (aInput.isItemEqual(GenericChem.mPurpleCatalyst)) + return aInput; + else if (aInput.isItemEqual(AgriculturalChem.mGreenCatalyst)) + return aInput; + else if (aInput.isItemEqual(GenericChem.mBrownCatalyst)) + return aInput; + } + } + } + return null; + } + + + private void damageCatalyst(ItemStack aStack) { + if (MathUtils.randFloat(0, 10000000)/10000000f < (1.2f - (0.2 * this.mPipeCasingTier))) { + int damage = getDamage(aStack) + 1; + log("damage catalyst "+damage); + if (damage >= getMaxCatalystDurability()) { + log("consume catalyst"); + ItemStack emptyCatalyst = ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier,1); + addOutput(emptyCatalyst); + setDamage(aStack,0); + aStack.stackSize -= 1; + } + else { + setDamage(aStack,damage); + } + } + else + log("not consuming catalyst"); + } + } + + private int getDamage(ItemStack aStack) { + if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) { + final NBTTagCompound tagMain = new NBTTagCompound(); + final NBTTagCompound tagNBT = new NBTTagCompound(); + tagNBT.setInteger("Damage", 0); + tagMain.setTag("catalyst", tagNBT); + aStack.setTagCompound(tagMain); + } + NBTTagCompound aNBT = aStack.getTagCompound(); + return aNBT.getCompoundTag("catalyst").getInteger("Damage"); + } + + private void setDamage(ItemStack aStack,int aAmount) { + NBTTagCompound aNBT = aStack.getTagCompound(); + aNBT = aNBT.getCompoundTag("catalyst"); + aNBT.setInteger("Damage", aAmount); + } + @SideOnly(Side.CLIENT) -- cgit From fbb298251275388777a7ff30d8b9f0fd0c88f39c Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Wed, 8 Jan 2020 00:14:32 +0100 Subject: Redone Turbodyne F1-A Logic (#597) - Removed free fuel tick on single block rocket engines. % Changed hg1223 from ZPM to LuV. % Spelling. % Adjusted logging. $ Rewrote large rocket engine logic. Co-authored-by: Alkalus <3060479+draknyte1@users.noreply.github.com> --- .../GregtechMetaTileEntity_LargeRocketEngine.java | 224 +++++++++++++-------- 1 file changed, 142 insertions(+), 82 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index bc36cb32a1..8e3e40b3ab 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -40,6 +40,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi protected int fuelValue; protected int fuelRemaining; protected int freeFuelTicks = 0; + protected int euProduction = 0; protected boolean boostEu; public static String mLubricantName = "Carbon Dioxide"; @@ -86,12 +87,13 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi mCoolantName = FluidUtils.getFluidStack("liquidhydrogen", 1).getLocalizedName(); } return new String[] { - "Controller Block for the Large Combustion Engine", - "Supply Rocket Fuels and 1000L of "+mLubricantName+" per hour to run", - "Supply 40L of "+mCoolantName+" per second to boost output (optional)", - "Consumes upto 5000L of Air per second", - "Default: Produces "+GT_Values.V[5]+"EU/t at 100% efficiency", - "Boosted: Produces "+(GT_Values.V[5]*3)+"EU/t at 150% efficiency", + "Controller Block for the Large Rocket Engine", + "Supply Rocket Fuels and 1000L(3000L boosted) of "+mLubricantName+" per hour to run", + "Supply 4L of "+mCoolantName+" per second per 2100 eu/t to boost output (optional)", + "Consumes upto 37500L of Air per second", + "Produces between 4K and 32K eu/t depending on how much fuel is fed", + "When producing more then 16K eu/t fuel wil be consume less efficiently (3x - 1.5x eff)", + "Boosting will produce 3x the amount of power but will consume 3x fuel", "Size(WxHxD): 3x3x10, Controller (front centered)", "3x3x10 of Stable "+mCasingName+" (hollow, Min 64!)", "8x "+mGearboxName+" inside the Hollow Casing", @@ -122,15 +124,20 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } public int getAir() { + log("geting air in "); if (this.mAirIntakes.isEmpty() || this.mAirIntakes.size() <= 0) { + log("return air 0"); return 0; } else { int totalAir = 0; FluidStack airstack = FluidUtils.getFluidStack("air", 1); for (GT_MetaTileEntity_Hatch_AirIntake u : this.mAirIntakes) { - if (u != null) { + if (u != null && u.mFluid != null) { + log(" to fluid stack"); + // had this trow errors cousing the machine to stop probebly fixed FluidStack f = u.mFluid; + log("fluid stack made"); if (f.isFluidEqual(airstack)) { totalAir += f.amount; } @@ -142,66 +149,100 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi @Override public boolean checkRecipe(final ItemStack aStack) { + if (this.mEfficiency < 0) + log(" geting air"); final ArrayList tFluids = this.getStoredFluids(); FluidStack air = FluidUtils.getFluidStack("air", 1); + log(" geting air 2"); int aircount = getAir() ; - if (aircount < (boostEu ? 500 : 200)) { - //Logger.INFO("Not Enough Air to Run "+aircount); + if (aircount < euProduction/32) { + log(" not enough air"); + //log("Not Enough Air to Run "+aircount); return false; } - else { - boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, boostEu ? 500 : 200)); + else { + log(" no boost"); + boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, euProduction/32)); if (!hasIntakeAir) { - //Logger.INFO("Could not consume Air to run "+aircount); + //log("Could not consume Air to run "+aircount); + freeFuelTicks = 0; return false; } } - //Logger.INFO("Running "+aircount); - + // reste fuel ticks incase it does not reset when it stops + if (freeFuelTicks != 0 && this.mProgresstime == 0 && this.mEfficiency == 0) + freeFuelTicks = 0; + + //log("Running "+aircount); + log("looking at hatch"); final Collection tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList; + + if (tFluids.size() > 0 && tRecipeList != null) { + log("has fluid"); + + if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 3 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { + log("Found CO2"); + if (this.mRuntime % 72 == 0 || this.mRuntime == 0) { + if (!consumeCO2()) { + freeFuelTicks = 0; + return false; + } + } + } else + { + log("no CO found"); + freeFuelTicks = 0; + return false; + } + + if (freeFuelTicks == 0) + this.boostEu = consumeLOH(); + log("Did we consume LOH? "+boostEu); + for (final FluidStack hatchFluid1 : tFluids) { if (hatchFluid1.isFluidEqual(air)) { continue; - } - for (final GT_Recipe aFuel : tRecipeList) { - final FluidStack tLiquid; - tLiquid = aFuel.mFluidInputs[0]; - if (hatchFluid1.isFluidEqual(tLiquid)) { - - final int n = (int) (this.boostEu ? ((GT_Values.V[5]*2) / aFuel.mSpecialValue) : (GT_Values.V[5] / aFuel.mSpecialValue)); - - if (!consumeFuel(aFuel)) { - continue; - } - - //Logger.INFO("Consumed some input fuel"); - this.boostEu = consumeLOH(); - //Logger.INFO("Did we consume LOH? "+boostEu); - - if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 2 : 1)))) { - //Logger.INFO("Found CO2"); - if (this.mRuntime % 72 == 0 || this.mRuntime == 0) { - if (!consumeCO2()) { - return false; - } - } + } + + if (freeFuelTicks == 0) { + log("tick = 0 consuming fuel"); + for (final GT_Recipe aFuel : tRecipeList) { + final FluidStack tLiquid; + tLiquid = aFuel.mFluidInputs[0]; + if (hatchFluid1.isFluidEqual(tLiquid)) { + log("consume fuel amount" + hatchFluid1.amount); + if (!consumeFuel(aFuel,hatchFluid1.amount)) { + continue; + } this.fuelValue = aFuel.mSpecialValue; this.fuelRemaining = hatchFluid1.amount; - this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]); + this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]<<1); this.mProgresstime = 1; this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 5; + this.mEfficiencyIncrease = euProduction/4000; return true; + //log(""); } - return false; } + + } else + { + this.mEfficiencyIncrease = euProduction/4000; + freeFuelTicks--; + this.mEUt = (int) ((this.mEfficiency < 1000) ? 0 : GT_Values.V[5]<<1); + this.mProgresstime = 1; + this.mMaxProgresstime = 1; + return true; } + } } this.mEUt = 0; this.mEfficiency = 0; + log("no fuel found"); + freeFuelTicks = 0; return false; } @@ -210,34 +251,50 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi * @param aFuel * @return */ - public boolean consumeFuel(GT_Recipe aFuel) { - if (freeFuelTicks > 0) { - freeFuelTicks--; - return true; - } - else { - Logger.INFO("Consuming fuel."); + public boolean consumeFuel(GT_Recipe aFuel,int amount) { + amount *= this.boostEu ? 0.3 : 0.9; + log("Consuming fuel."); freeFuelTicks = 0; - int value = aFuel.mSpecialValue * 3000; - Logger.INFO("Value: "+value); - value /= GT_Values.V[4]; - value /= 10; - Logger.INFO("Value: "+value); - FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], value); + int value = aFuel.mSpecialValue * 3; + log("amount: "+amount); + log("Value: "+value); + int energy = value * amount; + //engine needs at leas 2A EV of fuel to waork + if (energy < 40000){ + log("not enough fuel to work"); + return false; + } + //limits engine to LuV fuel consumption + if (energy > 427500){ + amount = (int) ((double) 427500/value); + energy = 427500; + } + log("amount2: "+amount); + FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], (this.boostEu ? amount * 3 : amount)); if (!this.depleteInput(tLiquid)) { + log("could not deplete fluid"); return false; } else { - this.fuelConsumption = value; - this.freeFuelTicks = value*2; - Logger.INFO("Consumed "+value+"L. Waiting "+freeFuelTicks+" ticks to consume more."); + this.fuelConsumption = this.boostEu ? amount * 3 : amount; + this.freeFuelTicks = 20; + setEUProduction(energy); + log("Consumed "+amount+"L. Waiting "+freeFuelTicks+" ticks to consume more."); return true; } - } + } + + public void setEUProduction(int energy){ + energy /= 20; + // 3x eff unles it gose above 16K eu/t + double energyEfficiency = energy > 5500 ? ((double) Math.sqrt(5500)/Math.sqrt(energy) * energy) : energy; + euProduction = (int) ((double) energyEfficiency * 1.84); + if (this.boostEu) + euProduction *= 3; } public boolean consumeCO2() { - if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 2 : 1)))) { + if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 3 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { return true; } else { @@ -246,7 +303,8 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } public boolean consumeLOH() { - return this.depleteInput(FluidUtils.getFluidStack(RocketFuels.Liquid_Hydrogen, 2)); + int LOHamount = (3 * euProduction)/1000; + return this.depleteInput(FluidUtils.getFluidStack(RocketFuels.Liquid_Hydrogen, LOHamount)); //(40 * ((long) euProduction / 10000)) } @Override @@ -258,15 +316,15 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi final int MAX_LENGTH = 8; for (int length=0;length 0) && (aLength <= MAX_LENGTH))) { - Logger.INFO("Checking for Hatches. "+aLength); + log("Checking for Hatches. "+aLength); //Top Row if (j == 1) { if (addDynamoToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { @@ -302,7 +360,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi // Do nothing } else { - Logger.INFO("Top Row - "+aLength+" | Did not find casing or Dynamo"); + log("Top Row - "+aLength+" | Did not find casing or Dynamo"); return false; } } @@ -312,7 +370,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi final IMetaTileEntity bCheck = aCheck.getMetaTileEntity(); // Only allow Dynamos on Top if (bCheck instanceof GT_MetaTileEntity_Hatch_Dynamo) { - Logger.INFO("Found dynamo in disallowed location | "+aX+", "+aY+", "+aZ+" | "+i+", "+j+", "+aLength); + log("Found dynamo in disallowed location | "+aX+", "+aY+", "+aZ+" | "+i+", "+j+", "+aLength); return false; } } @@ -328,30 +386,30 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { // Do nothing } - else {Logger.INFO("Bad block."); + else {log("Bad block."); return false; } } - Logger.INFO("Passed check. "+aLength); + log("Passed check. "+aLength); } else if (aLength == 0) { - Logger.INFO("Searching for Gearbox"); + log("Searching for Gearbox"); if (addMaintenanceToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(aX, aY, aZ), getCasingTextureIndex())) { // Do Nothing } else if(!(getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta())) { - Logger.INFO("Bad Missing Casing || Bad Meta"); + log("Bad Missing Casing || Bad Meta"); return false; } else { - Logger.INFO("Found "+mCasingName+"."); + log("Found "+mCasingName+"."); } } else if (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta()) { - Logger.INFO("Found Casing."); + log("Found Casing."); // Do nothing } else { - Logger.INFO("Bad XXX"); + log("Bad XXX"); return false; } } @@ -369,24 +427,24 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } if (this.mDynamoHatches.size() <= 0 || this.mDynamoHatches.isEmpty()) { - Logger.INFO("Wrong count for Dynamos"); + log("Wrong count for Dynamos"); return false; } if (this.mMufflerHatches.size() != 1 || this.mMufflerHatches.isEmpty()) { - Logger.INFO("Wrong count for Mufflers"); + log("Wrong count for Mufflers"); return false; } if (this.mAirIntakes.size() < 8 || this.mAirIntakes.isEmpty()) { - Logger.INFO("Wrong count for Air Intakes | "+this.mAirIntakes.size()); + log("Wrong count for Air Intakes | "+this.mAirIntakes.size()); return false; } if (this.mMaintenanceHatches.size() < 1 || this.mMaintenanceHatches.isEmpty()) { - Logger.INFO("Wrong count for Maint. Hatches"); + log("Wrong count for Maint. Hatches"); return false; } - Logger.INFO("Formed Rocket Engine."); + log("Formed Rocket Engine."); return true; } @@ -426,6 +484,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi @Override public void saveNBTData(final NBTTagCompound aNBT) { aNBT.setInteger("freeFuelTicks", freeFuelTicks); + aNBT.setInteger("euProduction", euProduction); super.saveNBTData(aNBT); } @@ -433,6 +492,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi public void loadNBTData(final NBTTagCompound aNBT) { super.loadNBTData(aNBT); freeFuelTicks = aNBT.getInteger("freeFuelTicks"); + euProduction = aNBT.getInteger("euProduction"); } @Override @@ -442,12 +502,12 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi @Override public int getMaxEfficiency(final ItemStack aStack) { - return this.boostEu ? 30000 : 10000; + return euProduction; } @Override public int getPollutionPerTick(final ItemStack aStack) { - return this.boostEu ? 150 : 75; + return 75 * ( euProduction / 10000); } @Override @@ -463,8 +523,8 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi "Current Pollution: " + getPollutionPerTick(null), "Time until next fuel consumption: "+freeFuelTicks, "Current Output: " + this.mEUt * this.mEfficiency / 10000 + " EU/t", - "Fuel Consumption: " + this.fuelConsumption + "L/t", - "Fuel Value: " + this.fuelValue + " EU/L", + "Fuel Consumption: " + (this.fuelConsumption) + "L/s", + "Fuel Value: " + this.fuelValue*3 + " EU/L", "Fuel Remaining: " + this.fuelRemaining + " Litres", "Current Efficiency: " + this.mEfficiency / 100 + "%", (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" }; -- cgit From 133c1c2efcb458bdc7aaf2e2bcb087c23fca3b7f Mon Sep 17 00:00:00 2001 From: botn365 <42187820+botn365@users.noreply.github.com> Date: Wed, 8 Jan 2020 00:16:02 +0100 Subject: Fix Multi-Amp usage on additional Multis (#594) --- .../processing/GregtechMetaTileEntity_IndustrialDehydrator.java | 3 ++- .../multi/production/GregtechMetaTileEntity_MassFabricator.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java index 4cead1c2a8..78896dd650 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java @@ -212,6 +212,7 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_Mu long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); Logger.WARNING("Running checkRecipeGeneric(0)"); GT_Recipe tRecipe = this.getRecipeMap().findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, @@ -239,7 +240,7 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_Mu int parallelRecipes = 0; // Count recipes to do in parallel, consuming input items and fluids and // considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { Logger.WARNING("Broke at " + parallelRecipes + "."); break; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index e531103a37..e78e5ef16c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -322,7 +322,8 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo if (this.mMode == MODE_SCRAP) { long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); GT_Recipe c = new Recipe_GT(false, new ItemStack[] { GT_Utility.copyAmount(1, aItemInputs[0]) }, GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aItemInputs[0]), 0) == null ? null : new ItemStack[] { ItemList.IC2_Scrap.get(1) }, @@ -335,7 +336,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo int parallelRecipes = 0; // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { if (!c.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { log("Broke at "+parallelRecipes+"."); break; -- cgit From 66a364a57dc70198a1551e038e49e56c53091c1b Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 7 Jan 2020 23:37:29 +0000 Subject: $ Small fixes left over from mobile commits. --- .../multi/production/chemplant/GregtechMTE_ChemicalPlant.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 81a25b3266..87f8d81bb2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -999,9 +999,9 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { if (aRecipeCatalyst.isItemEqual(aInput)) { if (aInput.stackSize == 1) { int damage = getDamage(aInput) + aMaxParrallel; - if (damage >getMaxCatalystDuarbilerty() ) { + if (damage > getMaxCatalystDurability() ) { aOutPut.add(aInput); - allowedParrallel += aMaxParrallel + (getMaxCatalystDuarbilerty() - damage); + allowedParrallel += aMaxParrallel + (getMaxCatalystDurability() - damage); if (allowedParrallel >aMaxParrallel ) { return aMaxParrallel; } @@ -1055,7 +1055,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { setDamage(aStack,damage); } } - else + else { log("not consuming catalyst"); } } -- cgit