diff options
author | Draknyte1 <3060479+draknyte1@users.noreply.github.com> | 2018-06-17 15:04:41 +1000 |
---|---|---|
committer | Draknyte1 <3060479+draknyte1@users.noreply.github.com> | 2018-06-17 15:04:41 +1000 |
commit | 2e41ca62618aebf5f110c55f44a4f61029b6ebea (patch) | |
tree | 7cc344d1846ff97bf26abdd57def12042490cbc9 | |
parent | 3655457016c99e60197271a6b3624196539e1c3b (diff) | |
download | GT5-Unofficial-2e41ca62618aebf5f110c55f44a4f61029b6ebea.tar.gz GT5-Unofficial-2e41ca62618aebf5f110c55f44a4f61029b6ebea.tar.bz2 GT5-Unofficial-2e41ca62618aebf5f110c55f44a4f61029b6ebea.zip |
+ Added low efficiency mode to the Pollution Scrubbers, allowing Rotors to be saved. Closes #312.
+ Added ability for Ore Wash Plant to hand Chemical Bathing. Closes #289.
% Made Multi-Machine now have a Fluid Extractor mode, this has replaced the Distillery mode. Closes #306.
% Updated Multi-Machine manual, to reflect mode C being enabled and it's new Fluid Extractor mode.
$ Fixed High Temp Pipe capacities.
$ Fixed Ore Wash Plant Tooltip. Closes #302.
6 files changed, 116 insertions, 50 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/BookHandler.java b/src/Java/gtPlusPlus/core/handler/BookHandler.java index edbb7becd4..41757bf680 100644 --- a/src/Java/gtPlusPlus/core/handler/BookHandler.java +++ b/src/Java/gtPlusPlus/core/handler/BookHandler.java @@ -3,14 +3,13 @@ package gtPlusPlus.core.handler; import java.util.HashMap; import java.util.Map; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; - import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; public class BookHandler { @@ -117,9 +116,9 @@ public class BookHandler { new String[] { "This Multiblock, depending upon the mode used, can function as a variety of different machines. The idea behind this, was that most of these machines are rather niche compared to any others, as such, not used often.", "To build, you need to construct a hollow 3x3x3 structure made from Multi-Use casings, With a minimum of 6. Any Casing position can be substituted out with an Input Hatch/Bus, an Output Hatch/Bus, Muffler, Maint. Hatch or Energy Injector Hatch.", - "The Mode can be set by using a Screwdriver on the controller block. Each mode allows the use of Numbered Circuits, to allow a different machine 'type' for each input bus. Mode 3 is currently disabled, as each machine requires special handling.", + "The Mode can be set by using a Screwdriver on the controller block. Each mode allows the use of Numbered Circuits, to allow a different machine 'type' for each input bus.", "[Metal Work] Mode A - Allows the multiblock to function as a Compressor, a Lathe or an Electro-Magnet. To allow a hatch to run in Compressor mode, insert a No. 20 circuit. For Lathe, use No. 21 and for Electro-Magnet use No. 22.", - "[Fluid Work] Mode B - Allows the multiblock to function as a Fermenter, a Distillery or an Extractor. To allow a hatch to run in Fermenter mode, insert a No. 20 circuit. For Distillery, use No. 21 and for Extractor use No. 22.", + "[Fluid Work] Mode B - Allows the multiblock to function as a Fermenter, a Fluid Extractor or an Extractor. To allow a hatch to run in Fermenter mode, insert a No. 20 circuit. For Fluid Extractor, use No. 21 and for Extractor use No. 22.", "[Misc. Work] Mode C - Allows the multiblock to function as a Laser Engraver, a Replicator or an Autoclave. To allow a hatch to run in Laser Engraver mode, insert a No. 20 circuit. For Autoclave, use No. 21 and for Replicator use No. 22. REPLICATOR DISABLED.", }); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index f43f83c79c..b73b82ac8b 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -1,24 +1,19 @@ package gtPlusPlus.core.recipe; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; - import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; - import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; -import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.RecipeUtils; +import gtPlusPlus.core.util.minecraft.*; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; public class RECIPES_Machines { @@ -1278,7 +1273,7 @@ public class RECIPES_Machines { ItemStack o_Lathe = ItemList.Machine_HV_Lathe.get(1); ItemStack o_Electromagnet = ItemList.Machine_HV_Polarizer.get(1); ItemStack o_Fermenter = ItemList.Machine_HV_Fermenter.get(1); - ItemStack o_Distillery = ItemList.Machine_HV_Distillery.get(1); + ItemStack o_Distillery = ItemList.Machine_HV_FluidExtractor.get(1); ItemStack o_Extractor = ItemList.Machine_HV_Extractor.get(1); RecipeUtils.recipeBuilder( plate, CI.craftingToolHammer_Hard, plate, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 8f13c05227..f9904ad2ee 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -2,11 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; import static gregtech.api.enums.GT_Values.V; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -17,15 +12,20 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; - import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.general.ItemAirFilter; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.gui.basic.CONTAINER_PollutionCleaner; import gtPlusPlus.xmod.gregtech.api.gui.basic.GUI_PollutionCleaner; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_BasicMachine { @@ -35,6 +35,8 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi protected boolean mHasPollution = false; protected int SLOT_ROTOR = 4; protected int SLOT_FILTER = 5; + + protected boolean mSaveRotor = false; private int mDamageFactorLow = 5; private float mDamageFactorHigh = (float) 0.6000000238418579; @@ -68,19 +70,28 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi @Override public String[] getDescription() { - return new String[]{this.mDescription, "Requires a Turbine Rotor and an Air Filter to run.", CORE.GT_Tooltip}; + return new String[]{ + this.mDescription, + "Requires a Turbine Rotor and an Air Filter to run.", + "Can be configured with a screwdriver to change modes", + "Low Efficiency: Removes half pollution, Turbine takes 50% dmg", + "High Efficiency: Removes full pollution, Turbine takes 100% dmg", + "Turbine Rotor will not break in LE mode", + CORE.GT_Tooltip}; } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setInteger("mOptimalAirFlow", this.mOptimalAirFlow); + aNBT.setBoolean("mSaveRotor", mSaveRotor); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); this.mOptimalAirFlow = aNBT.getInteger("mOptimalAirFlow"); + this.mSaveRotor = aNBT.getBoolean("mSaveRotor"); } @Override @@ -209,7 +220,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi //We are good to clean if (toRemove > 0){ if (damageTurbineRotor() && damageAirFilter()){ - removePollution(toRemove); + removePollution(mSaveRotor ? (toRemove/2) : toRemove); Logger.WARNING("mNewPollution[4]:"+getCurrentChunkPollution()); } else { @@ -281,23 +292,46 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi long rotorDurability = (rotorDurabilityMax - rotorDamage); Logger.WARNING("Rotor Damage: "+rotorDamage + " | Max Durability: "+rotorDurabilityMax+" | "+" Remaining Durability: "+rotorDurability); if (rotorDurability >= damageValue){ - Logger.WARNING("Damaging Rotor."); - GT_ModHandler.damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null); - - long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); - if (tempDur < rotorDurabilityMax){ - return true; - } - else { - rotorDurability = 0; - } + + + if (!mSaveRotor){ + Logger.WARNING("Damaging Rotor."); + GT_ModHandler.damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null); + + long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); + if (tempDur < rotorDurabilityMax){ + return true; + } + else { + rotorDurability = 0; + } + } + else { + Logger.WARNING("Damaging Rotor."); + if (rotorDurability > 1000){ + GT_ModHandler.damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue/2, 0, null); + long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); + if (tempDur < rotorDurabilityMax){ + return true; + } + else { + rotorDurability = 0; + } + } + } + + } - if (rotorDurability <= 0) { + if (rotorDurability <= 0 && !mSaveRotor) { Logger.WARNING("Destroying Rotor."); this.mInventory[this.SLOT_ROTOR] = null; return false; } + else if (rotorDurability <= 0 && mSaveRotor) { + Logger.WARNING("Saving Rotor."); + return false; + } }else { @@ -396,4 +430,17 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi return super.canInsertItem(aIndex, aStack, aSide); } + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + this.mSaveRotor = Utils.invertBoolean(mSaveRotor); + if (mSaveRotor){ + PlayerUtils.messagePlayer(aPlayer, "Running in low efficiency mode, rotors will not break."); + } + else { + PlayerUtils.messagePlayer(aPlayer, "Running in high efficiency mode, rotors will break."); + } + + super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + } + }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java index f1722eca17..3433cc5317 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java @@ -43,7 +43,7 @@ extends GregtechMeta_MultiBlockBase { private static final int MODE_LATHE = 1; private static final int MODE_MAGNETIC = 2; private static final int MODE_FERMENTER = 3; - private static final int MODE_DISTILL = 4; + private static final int MODE_FLUIDEXTRACT = 4; private static final int MODE_EXTRACTOR = 5; private static final int MODE_LASER = 6; private static final int MODE_AUTOCLAVE = 7; @@ -220,8 +220,8 @@ extends GregtechMeta_MultiBlockBase { else if (aMode == MODE_FERMENTER) { return GT_Recipe.GT_Recipe_Map.sFermentingRecipes; } - else if (aMode == MODE_DISTILL) { - return GT_Recipe.GT_Recipe_Map.sDistilleryRecipes; + else if (aMode == MODE_FLUIDEXTRACT) { + return GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes; } else if (aMode == MODE_EXTRACTOR) { return GT_Recipe.GT_Recipe_Map.sExtractorRecipes; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java index 0fafbde4a7..28e5cbc41b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java @@ -1,16 +1,10 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; -import net.minecraft.block.Block; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; - import gregtech.api.enums.TAE; 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.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -18,19 +12,25 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.everglades.block.DarkWorldContentLoader; +import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import ic2.core.init.BlocksItems; import ic2.core.init.InternalName; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_IndustrialWashPlant extends GregtechMeta_MultiBlockBase { + private boolean mChemicalMode = false; public GregtechMetaTileEntity_IndustrialWashPlant(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -49,15 +49,16 @@ extends GregtechMeta_MultiBlockBase { public String[] getDescription() { return new String[]{ "Controller Block for the Industrial Ore Washing Plant", + "Can be configured with a screwdriver to also process Chemical Bathing", "400% faster than using single block machines of the same voltage", "Processes four item per voltage tier", - "Chance to output Sludge per process", "Size: 5x3x7 [WxHxL] (open)", "X X", "X X", "XXXXX", "Controller (front centered)", "1x Input Bus (Any casing)", + "1x Input Hatch (Any casing)", "1x Output Bus (Any casing)", "1x Maintenance Hatch (Any casing)", "1x Energy Hatch (Any casing)", @@ -87,7 +88,7 @@ extends GregtechMeta_MultiBlockBase { @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sOreWasherRecipes; + return mChemicalMode ? GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes : GT_Recipe.GT_Recipe_Map.sOreWasherRecipes; } @Override @@ -318,7 +319,7 @@ extends GregtechMeta_MultiBlockBase { } public boolean addSludge() { - if (MathUtils.randInt(0, 100) <= 4) { + /*if (MathUtils.randInt(0, 100) <= 4) { if (this.mOutputHatches.size() > 0) { for (GT_MetaTileEntity_Hatch_Output h : this.mOutputHatches) { if (h.getFluid() == null || h.getFluid().isFluidEqual(FluidUtils.getFluidStack(DarkWorldContentLoader.SLUDGE, 1000))) { @@ -332,8 +333,32 @@ extends GregtechMeta_MultiBlockBase { } } } - } + } */ return true; } + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setBoolean("mChemicalMode", mChemicalMode); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mChemicalMode = aNBT.getBoolean("mChemicalMode"); + super.loadNBTData(aNBT); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + mChemicalMode = Utils.invertBoolean(mChemicalMode); + if (mChemicalMode){ + PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Chemical Bath Mode."); + } + else { + PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Ore Washer Mode."); + } + super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + } + }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index 45559fee97..9ee65a1760 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -107,7 +107,7 @@ public class GregtechConduits { generateGTFluidPipes(Materials.Clay, BasePipeID+65, 100, 500, false); generateGTFluidPipes(Materials.Lead, BasePipeID+70, 720, 1200, true); - generateNonGTFluidPipes(GT_Materials.TriniumNaquadahCarbonite, ALLOY.TRINIUM_NAQUADAH_CARBON, 30500, 4, 250000, true); + generateNonGTFluidPipes(GT_Materials.TriniumNaquadahCarbonite, ALLOY.TRINIUM_NAQUADAH_CARBON, 30500, 10, 250000, true); } |