diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-09-27 02:48:32 +0100 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-09-27 02:48:32 +0100 |
commit | 89d30a5cfcc2d3d5773647350edf913f156062b3 (patch) | |
tree | 778a5bd45aa29980fd6c86a327a37592dc600c5c /src/Java/gtPlusPlus | |
parent | 2e90f7bac4f033ee49556238f02bcdccb3eca170 (diff) | |
download | GT5-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')
8 files changed, 243 insertions, 141 deletions
diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java index aa80f784a9..0e661fd429 100644 --- a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java +++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java @@ -107,7 +107,7 @@ public final class MISC_MATERIALS { "Carbon Dioxide", MaterialState.PURE_LIQUID, //State null, //Material Colour - -56, //Melting Point in C + -1, //Melting Point in C -1, //Boiling Point in C -1, //Protons -1, diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 904d1fb4df..dbcbeac32a 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -477,28 +477,26 @@ public class Material { if (aTest != null){ this.vMoltenFluid = aTest.getFluid(); } - else if (isValid == null || isValid == Materials._NULL){ - queueFluidGeneration(); - } else { - if (isValid.mFluid != null){ - this.vMoltenFluid = isValid.mFluid; - } - else if (isValid.mGas != null){ - this.vMoltenFluid = isValid.mGas; - } - else { + if (isValid == null || isValid == Materials._NULL){ queueFluidGeneration(); } + else { + FluidStack aTest2 = FluidUtils.getWildcardFluidStack(localizedName, 1); + if (aTest2 != null){ + this.vMoltenFluid = aTest2.getFluid(); + } + else { + queueFluidGeneration(); + } + } } - this.vPlasma = this.generatePlasma(); } else { this.vMoltenFluid = null; this.vPlasma = null; } - String ratio = ""; if (this.vSmallestRatio != null) { for (int hu=0;hu<this.vSmallestRatio.length;hu++){ diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java index a670f341fd..a2bfa5dcb2 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java @@ -6,6 +6,7 @@ import net.minecraft.item.ItemStack; import gregtech.api.enums.Dyes; import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; import gtPlusPlus.api.objects.Logger; @@ -590,6 +591,28 @@ public class FluidUtils { } return null; } + + public static FluidStack getWildcardFluidStack(Materials aMaterial, int amount) { + FluidStack aFStack1 = aMaterial.getFluid(amount); + FluidStack aFStack2 = aMaterial.getGas(amount); + FluidStack aFStack3 = aMaterial.getMolten(amount); + FluidStack aFStack4 = aMaterial.getSolid(amount); + if (aFStack1 != null) { + return aFStack1; + } + else if (aFStack2 != null) { + return aFStack2; + } + else if (aFStack3 != null) { + return aFStack3; + } + else if (aFStack4 != null) { + return aFStack4; + } + else { + return null; + } + } } diff --git a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java index e736592aed..6a41e54ec3 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java @@ -1,14 +1,19 @@ package gtPlusPlus.core.util.minecraft.gregtech; +import static gtPlusPlus.core.lib.CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK; + import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.GT_Mod; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.common.GT_Proxy; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.MISC_MATERIALS; @@ -33,7 +38,7 @@ public class PollutionUtils { public static AutoMap<FluidStack> mPollutionFluidStacks = new AutoMap<FluidStack>(); static { - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) { + if (MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) { mIsPollutionEnabled = mPollution(); } else { mIsPollutionEnabled = false; @@ -129,8 +134,57 @@ public class PollutionUtils { return addPollution(aChunk, -pollutionValue); } + public static boolean nullifyPollution(IGregTechTileEntity te) { + if (te == null) { + return false; + } + return nullifyPollution(te); + } + + public static boolean nullifyPollution(IHasWorldObjectAndCoords aTileOfSomeSort) { + if (aTileOfSomeSort == null) { + return false; + } + IHasWorldObjectAndCoords j = (IHasWorldObjectAndCoords) aTileOfSomeSort; + Chunk c = j.getWorld().getChunkFromBlockCoords(j.getXCoord(), j.getZCoord()); + return nullifyPollution(c); + } + + public static boolean nullifyPollution(Chunk aChunk) { + try { + if (aChunk == null) { + return false; + } + long getCurrentPollution = getPollution(aChunk); + if (getCurrentPollution <= 0) { + return false; + } + else { + if (mAddPollution2 != null) { + mAddPollution2.invoke(null, aChunk, -getCurrentPollution); + return true; + } + else { + Class<?> GT_Pollution = ReflectionUtils.getClass("gregtech.common.GT_Pollution"); + if (GT_Pollution != null) { + Method addPollution = ReflectionUtils.getMethod(GT_Pollution, "addPollution", Chunk.class, int.class); + if (addPollution != null) { + mAddPollution2 = addPollution; + mAddPollution2.invoke(null, aChunk, 0); + return true; + } + } + } + } + + } catch (SecurityException | IllegalAccessException + | IllegalArgumentException | InvocationTargetException e) { + } + return false; + } + public static int getPollution(IGregTechTileEntity te) { - if (mIsPollutionEnabled) + if (MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) try { if (te == null) { return 0; @@ -153,7 +207,7 @@ public class PollutionUtils { } public static int getPollution(Chunk te) { - if (mIsPollutionEnabled) + if (MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) try { if (te == null) { return 0; @@ -175,31 +229,52 @@ public class PollutionUtils { return 0; } - public static boolean setPollutionFluids() { - FluidStack CD, CM, SD; - CD = FluidUtils.getFluidStack("carbondioxide", 1000); - CM = FluidUtils.getFluidStack("carbonmonoxide", 1000); - SD = FluidUtils.getFluidStack("sulfuredioxide", 1000); - if (PollutionUtils.mPollutionFluidStacks.size() == 0) { - if (CD != null) { - PollutionUtils.mPollutionFluidStacks.put(CD); - ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonDioxide", 1); - if (ItemUtils.checkForInvalidItems(cellCD)) { - MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD); + public static boolean setPollutionFluids() { + if (mPollutionFluidStacks.isEmpty()) { + FluidStack CD, CM, SD; + CD = FluidUtils.getFluidStack("carbondioxide", 1000); + CM = FluidUtils.getFluidStack("carbonmonoxide", 1000); + SD = FluidUtils.getFluidStack("sulfurdioxide", 1000); + if (PollutionUtils.mPollutionFluidStacks.size() == 0) { + if (CD != null) { + Logger.INFO("[PollutionCompat] Found carbon dioxide fluid, registering it."); + PollutionUtils.mPollutionFluidStacks.put(CD); + ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonDioxide", 1); + if (ItemUtils.checkForInvalidItems(cellCD)) { + Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component."); + MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD); + } + } + else { + MaterialGenerator.generate(MISC_MATERIALS.CARBON_DIOXIDE, false, false); + } + if (CM != null) { + Logger.INFO("[PollutionCompat] Found carbon monoxide fluid, registering it."); + PollutionUtils.mPollutionFluidStacks.put(CM); + } + if (SD != null) { + Logger.INFO("[PollutionCompat] Found sulfur dioxide fluid, registering it."); + PollutionUtils.mPollutionFluidStacks.put(SD); } } - else { - MaterialGenerator.generate(MISC_MATERIALS.CARBON_DIOXIDE, false, false); + if (PollutionUtils.mPollutionFluidStacks.size() > 0) { + return true; } - if (CM != null) - PollutionUtils.mPollutionFluidStacks.put(CM); - if (SD != null) - PollutionUtils.mPollutionFluidStacks.put(SD); + return false; } - if (PollutionUtils.mPollutionFluidStacks.size() > 0) { - return true; + else { + if (mPollutionFluidStacks.size() != 3) { + Logger.INFO("Unable to detect all 3 pollution fluids. Found: "); + Logger.INFO(ArrayUtils.toString(mPollutionFluidStacks)); + return false; + } + else { + return true; + } } - return false; + + + } } diff --git a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java index 8f5a65c8d2..c619ff4479 100644 --- a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java +++ b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java @@ -10,14 +10,11 @@ import codechicken.nei.PositionedStack; import codechicken.nei.recipe.TemplateRecipeHandler; import crazypants.enderio.machine.enchanter.GuiEnchanter; import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.handler.Recipes.DecayableRecipe; import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique; import gtPlusPlus.core.item.materials.DustDecayable; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.VanillaColours; -import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.nei.handlers.NeiTextureHandler; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; @@ -31,7 +28,7 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { } public String getGuiTexture() { - return CORE.MODID+":textures/gui/nei/decayables.png"; + return CORE.MODID + ":textures/gui/nei/decayables.png"; } public Class<? extends GuiContainer> getGuiClass() { @@ -41,21 +38,22 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { public String getOverlayIdentifier() { return "GTPP_Decayables"; } - - public int recipiesPerPage() { - return 1; - } + + public int recipiesPerPage() { + return 1; + } public void loadTransferRects() { this.transferRects.add(new RecipeTransferRect(new Rectangle(6, 3, 16, 16), "GTPP_Decayables", new Object[0])); } public void loadCraftingRecipes(ItemStack result) { - if (result == null || (!DustDecayable.class.isInstance(result.getItem()) && !BaseItemDustUnique.class.isInstance(result.getItem()))) { + if (result == null || (!DustDecayable.class.isInstance(result.getItem()) + && !BaseItemDustUnique.class.isInstance(result.getItem()))) { return; } if (result != null) { - Logger.INFO("Looking up crafting recipes for "+ItemUtils.getItemName(result)); + //Logger.INFO("Looking up crafting recipes for "+ItemUtils.getItemName(result)); } final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes; for (final DecayableRecipe recipe : recipes) { @@ -64,8 +62,8 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { final ItemStack output = recipe.mOutput.copy(); if (!GT_Utility.areStacksEqual(result, output, true)) { continue; - } - Logger.INFO("Showing Usage result for "+ItemUtils.getItemName(result)); + } + //Logger.INFO("Showing Usage result for "+ItemUtils.getItemName(result)); final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); this.arecipes.add(rec); sort(); @@ -85,8 +83,7 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { sort(); } } - } - else { + } else { super.loadCraftingRecipes(outputId, results); } } @@ -94,7 +91,7 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { public void loadUsageRecipes(ItemStack ingredient) { final List<DecayableRecipe> recipes = DecayableRecipe.mRecipes; if (ingredient != null) { - Logger.INFO("Looking up Usage results for "+ItemUtils.getItemName(ingredient)); + //Logger.INFO("Looking up Usage results for "+ItemUtils.getItemName(ingredient)); } for (final DecayableRecipe recipe : recipes) { if (recipe.isValid()) { @@ -102,124 +99,107 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { final ItemStack output = recipe.mOutput.copy(); if (!GT_Utility.areStacksEqual(ingredient, input, true)) { continue; - } - Logger.INFO("Showing up Usage results for "+ItemUtils.getItemName(ingredient)); - final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); + } + //Logger.INFO("Showing up Usage results for "+ItemUtils.getItemName(ingredient)); + final DecayableRecipeNEI rec = new DecayableRecipeNEI(input, output, recipe.mTime); //rec.setIngredientPermutation((Collection) rec.input, ingredient); this.arecipes.add(rec); sort(); } - }} - + } + } + private final void sort() { List<DecayableRecipeNEI> g = new ArrayList<DecayableRecipeNEI>(); for (CachedRecipe u : arecipes) { g.add((DecayableRecipeNEI) u); } if (g != null && !g.isEmpty()) { - Collections.sort(g); + Collections.sort(g); } } public void drawExtras(int recipeIndex) { DecayableRecipeNEI recipe = (DecayableRecipeNEI) this.arecipes.get(recipeIndex); - + //GuiDraw.drawStringC(I18n.format("GTPP.container.decaychest.result", new Object[]{}), 43, 10, 8421504, false); int cost = recipe.time; - if (cost > 0){ - + if (cost > 0) { + // NEI Strings - String s = I18n.format("GTPP.nei.info", new Object[]{cost}); - String s0 = I18n.format("GTPP.nei.timetaken", new Object[]{cost}); - + String s = I18n.format("GTPP.nei.info", new Object[] { cost }); + String s0 = I18n.format("GTPP.nei.timetaken", new Object[] { cost }); + // Time Strings - String s1 = I18n.format("GTPP.time.ticks", new Object[]{cost}); - String s2 = I18n.format("GTPP.time.seconds", new Object[]{cost}); - String s3 = I18n.format("GTPP.time.minutes", new Object[]{cost}); - String s4 = I18n.format("GTPP.time.hours", new Object[]{cost}); - String s5 = I18n.format("GTPP.time.days", new Object[]{cost}); - String s6 = I18n.format("GTPP.time.months", new Object[]{cost}); + String s1 = I18n.format("GTPP.time.ticks", new Object[] { cost }); + String s2 = I18n.format("GTPP.time.seconds", new Object[] { cost }); + String s3 = I18n.format("GTPP.time.minutes", new Object[] { cost }); + String s4 = I18n.format("GTPP.time.hours", new Object[] { cost }); + String s5 = I18n.format("GTPP.time.days", new Object[] { cost }); + String s6 = I18n.format("GTPP.time.months", new Object[] { cost }); int y = 20; - + int secs = cost / 20; int mins = secs / 60; int hours = mins / 60; int days = hours / 24; int months = days / 30; - - + String suffix; int formattedTime; if (cost <= 20) { suffix = s1; formattedTime = cost; - } - else if (cost <= (20 * 60)) { + } else if (cost <= (20 * 60)) { suffix = s2; formattedTime = secs; - } - else if (cost <= (20 * 60 * 60)) { + } else if (cost <= (20 * 60 * 60)) { suffix = s3; formattedTime = mins; - } - else if (cost <= (20 * 60 * 60 * 24)) { + } else if (cost <= (20 * 60 * 60 * 24)) { suffix = s4; formattedTime = hours; - } - else if (cost < (20 * 60 * 60 * 24 * 30)) { + } else if (cost < (20 * 60 * 60 * 24 * 30)) { suffix = s5; formattedTime = days; - } - else if (cost <= (20 * 60 * 60 * 24 * 30)) { + } else if (cost <= (20 * 60 * 60 * 24 * 30)) { suffix = s6; formattedTime = months; - } - else { + } else { suffix = s1; - formattedTime = cost; + formattedTime = cost; } - - int x = 5; - GuiDraw.drawString(s, x, 25, VanillaColours.DYE_BLACK.getAsInt(), false); - GuiDraw.drawString(s0, x, 40, VanillaColours.DYE_BLACK.getAsInt(), false); - - - - - - GuiDraw.drawString(suffix, x + 16, y+30, VanillaColours.DYE_BLACK.getAsInt(), false); - + GuiDraw.drawString(s, x, 25, VanillaColours.DYE_BLACK.getAsInt(), false); + GuiDraw.drawString(s0, x, 40, VanillaColours.DYE_BLACK.getAsInt(), false); + + GuiDraw.drawString(suffix, x + 16, y + 30, VanillaColours.DYE_BLACK.getAsInt(), false); + //Values - GuiDraw.drawString((""+formattedTime), x, y+30, VanillaColours.DYE_GREEN.getAsInt(), false); - - + GuiDraw.drawString(("" + formattedTime), x, y + 30, VanillaColours.DYE_GREEN.getAsInt(), false); + if (hours > 1) { int aLeftoverMinutes = (cost - (hours * (20 * 60 * 60))); if (aLeftoverMinutes > 0) { int secs2 = aLeftoverMinutes / 20; int mins2 = secs2 / 60; - GuiDraw.drawString(s3, x + 16, y+42, VanillaColours.DYE_BLACK.getAsInt(), false); - GuiDraw.drawString((""+mins2), x, y+42, VanillaColours.DYE_GREEN.getAsInt(), false); - + GuiDraw.drawString(s3, x + 16, y + 42, VanillaColours.DYE_BLACK.getAsInt(), false); + GuiDraw.drawString(("" + mins2), x, y + 42, VanillaColours.DYE_GREEN.getAsInt(), false); + } - + } - - - - + } - + NeiTextureHandler.RECIPE_BUTTON.renderIcon(6.0D, 3.0D, 16.0D, 16.0D, 0.0D, true); } - public class DecayableRecipeNEI extends TemplateRecipeHandler.CachedRecipe implements Comparable<CachedRecipe> - { + public class DecayableRecipeNEI extends TemplateRecipeHandler.CachedRecipe implements Comparable<CachedRecipe> { private PositionedStack input; - private PositionedStack output; + private PositionedStack output; public int time; @Override @@ -244,11 +224,9 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { DecayableRecipeNEI p = (DecayableRecipeNEI) o; if (p.time > this.time) { return 1; - } - else if (p.time == this.time) { + } else if (p.time == this.time) { return 0; - } - else { + } else { return -1; } } 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 |