aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities
diff options
context:
space:
mode:
authorDraknyte1 <3060479+draknyte1@users.noreply.github.com>2018-06-17 15:04:41 +1000
committerDraknyte1 <3060479+draknyte1@users.noreply.github.com>2018-06-17 15:04:41 +1000
commit2e41ca62618aebf5f110c55f44a4f61029b6ebea (patch)
tree7cc344d1846ff97bf26abdd57def12042490cbc9 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities
parent3655457016c99e60197271a6b3624196539e1c3b (diff)
downloadGT5-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.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java85
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java49
3 files changed, 106 insertions, 34 deletions
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