aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-09-27 02:48:32 +0100
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-09-27 02:48:32 +0100
commit89d30a5cfcc2d3d5773647350edf913f156062b3 (patch)
tree778a5bd45aa29980fd6c86a327a37592dc600c5c /src/Java/gtPlusPlus/xmod/gregtech
parent2e90f7bac4f033ee49556238f02bcdccb3eca170 (diff)
downloadGT5-Unofficial-89d30a5cfcc2d3d5773647350edf913f156062b3.tar.gz
GT5-Unofficial-89d30a5cfcc2d3d5773647350edf913f156062b3.tar.bz2
GT5-Unofficial-89d30a5cfcc2d3d5773647350edf913f156062b3.zip
+ Added ability for Pollution Scrubbers to remove pollution if it's disabled. Useful if you disable it after starting, as GT will then ignore it forever in the chunks it's left in.
% Adjusted Melting point of CO2. % Adjusted the fuel usage on the LRE, I think? (I don't remember) $ Removed logging from decayable NEI handler. $ Fixed potential bad handling of fluid assignment to GT++ materials. $ Fixed incorrect handling of Sulphur Dioxide. $ Hopefully something here fixes the corruption of all canning recipes. :<
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java39
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java38
3 files changed, 54 insertions, 26 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 e277b671c6..4795b0d0b9 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
@@ -1,6 +1,9 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.GT_Values.V;
+import static gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils.mPollution;
+
+import org.apache.commons.lang3.ArrayUtils;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
@@ -40,6 +43,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
protected boolean mHasPollution = false;
protected int SLOT_ROTOR = 4;
protected int SLOT_FILTER = 5;
+ protected static boolean mPollutionEnabled = true;
protected boolean mSaveRotor = false;
@@ -55,10 +59,12 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)
});
+ mPollutionEnabled = PollutionUtils.mPollution();
}
public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName);
+ mPollutionEnabled = PollutionUtils.mPollution();
}
/*public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
@@ -75,10 +81,9 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
@Override
public String[] getDescription() {
- boolean highTier = this.mTier >= 7;
-
+ boolean highTier = this.mTier >= 7;
- return new String[]{
+ String[] A = new String[]{
this.mDescription,
highTier ? "Will attempt to remove 1/4 pollution from 8 surrounding chunks" : "",
highTier ? "If these chunks are not loaded, they will be ignored" : "",
@@ -87,9 +92,19 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
"Can be configured with a soldering iron 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",
-
+ "Turbine Rotor will not break in LE mode",
};
+ if (!mPollutionEnabled) {
+ String[] B = new String[] {
+ "===============================================",
+ "Pollution is disabled, scrubbers will now have a bonus use",
+ "They are now able to remove ALL lingering pollution as GT ignores it",
+ "and it will linger forever!",
+ "===============================================",
+ };
+ A = ArrayUtils.addAll(A, B);
+ }
+ return A;
}
@Override
@@ -187,7 +202,19 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
if (aBaseMetaTileEntity.isActive()){
//Do nothing if there is no pollution.
- if(this.mHasPollution && mCurrentPollution > 0){
+ if(this.mHasPollution && mCurrentPollution > 0){
+
+ //Only check every 30s.
+ if (!isIdle && aTick % (20L * 30) == 0L){
+ mPollutionEnabled = PollutionUtils.mPollution();
+ //Clear out pollution if it's disabled, because I am a nice gal.
+ if (!mPollution()) {
+ PollutionUtils.nullifyPollution(this.getBaseMetaTileEntity());
+ }
+ }
+
+
+
//Use a Turbine
if(hasRotor(stackRotor) && hasAirFilter(stackFilter)){
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
index 97ee87e4a2..4d38e686cf 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
@@ -50,7 +50,6 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
mHotFuelName = FluidUtils.getFluidStack("pyrotheum", 1).getLocalizedName();
mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 11);
mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 968);
- mUsingPollutionOutputs = PollutionUtils.setPollutionFluids();
}
public GregtechMetaTileEntity_Adv_EBF(String aName) {
@@ -59,7 +58,6 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
mHotFuelName = FluidUtils.getFluidStack("pyrotheum", 1).getLocalizedName();
mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 11);
mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 968);
- mUsingPollutionOutputs = PollutionUtils.setPollutionFluids();
}
@Override
@@ -216,6 +214,7 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
int targetHeight;
FluidStack tLiquid = aLiquid.copy();
boolean isOutputPollution = false;
+ mUsingPollutionOutputs = PollutionUtils.setPollutionFluids();
if (mUsingPollutionOutputs) {
for (FluidStack pollutionFluidStack : PollutionUtils.mPollutionFluidStacks) {
if (tLiquid.isFluidEqual(pollutionFluidStack)) {
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 9b6da487e8..bc36cb32a1 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
@@ -118,7 +118,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
@Override
public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "LargeDieselEngine.png");
+ return super.getClientGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
}
public int getAir() {
@@ -147,17 +147,17 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
int aircount = getAir() ;
if (aircount < (boostEu ? 500 : 200)) {
- Logger.INFO("Not Enough Air to Run "+aircount);
+ //Logger.INFO("Not Enough Air to Run "+aircount);
return false;
}
else {
boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, boostEu ? 500 : 200));
if (!hasIntakeAir) {
- Logger.INFO("Could not consume Air to run "+aircount);
+ //Logger.INFO("Could not consume Air to run "+aircount);
return false;
}
}
- Logger.INFO("Running "+aircount);
+ //Logger.INFO("Running "+aircount);
final Collection<GT_Recipe> tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList;
if (tFluids.size() > 0 && tRecipeList != null) {
@@ -169,22 +169,19 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
final FluidStack tLiquid;
tLiquid = aFuel.mFluidInputs[0];
if (hatchFluid1.isFluidEqual(tLiquid)) {
- final FluidStack fluidStack = tLiquid;
- Logger.INFO("Found valid thing");
- final int n = (int) (this.boostEu ? ((GT_Values.V[5]*2) / aFuel.mSpecialValue) : (GT_Values.V[5] / aFuel.mSpecialValue));
- fluidStack.amount = n;
- this.fuelConsumption = n;
+
+ 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");
+ //Logger.INFO("Consumed some input fuel");
this.boostEu = consumeLOH();
- Logger.INFO("Did we consume LOH? "+boostEu);
+ //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");
+ //Logger.INFO("Found CO2");
if (this.mRuntime % 72 == 0 || this.mRuntime == 0) {
if (!consumeCO2()) {
return false;
@@ -219,15 +216,21 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
return true;
}
else {
+ Logger.INFO("Consuming fuel.");
freeFuelTicks = 0;
int value = aFuel.mSpecialValue * 3000;
- value /= 1000;
+ Logger.INFO("Value: "+value);
+ value /= GT_Values.V[4];
+ value /= 10;
+ Logger.INFO("Value: "+value);
FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], value);
if (!this.depleteInput(tLiquid)) {
return false;
}
- else {
- freeFuelTicks = value;
+ else {
+ this.fuelConsumption = value;
+ this.freeFuelTicks = value*2;
+ Logger.INFO("Consumed "+value+"L. Waiting "+freeFuelTicks+" ticks to consume more.");
return true;
}
}
@@ -235,11 +238,9 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
public boolean consumeCO2() {
if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 2 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 2 : 1)))) {
- Logger.INFO("consumed some CO2");
return true;
}
else {
- Logger.INFO("No CO2 to consume");
return false;
}
}
@@ -460,6 +461,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
"Rocket Engine",
"Current Air: "+getAir(),
"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",
@@ -475,7 +477,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
@Override
public boolean hasSlotInGUI() {
- return true;
+ return false;
}
@Override