From 875afd0dc22915795ec74279f1708d79cab0cac8 Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Sun, 21 Nov 2021 21:44:24 +0800 Subject: add info display for filled tank and fluid container feature --- .../gregtech/common/blocks/GT_Item_Machines.java | 91 +++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index 55743f445d..b59dd1d848 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -30,10 +30,12 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; import java.util.List; -public class GT_Item_Machines extends ItemBlock { +public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { private static final String[] directionNames = {"Bottom", "Top", "North", "South", "West", "East"}; @@ -89,6 +91,15 @@ public class GT_Item_Machines extends ItemBlock { } aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(tTileEntity.getEUCapacity()) + EnumChatFormatting.GRAY); } + if (GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_QuantumTank || GregTech_API.METATILEENTITIES[tDamage] instanceof GT_MetaTileEntity_SuperTank) { + if (aStack.hasTagCompound() && aStack.stackTagCompound.hasKey("mFluid")) { + FluidStack tContents = FluidStack.loadFluidStackFromNBT(aStack.stackTagCompound.getCompoundTag("mFluid")); + if (tContents != null && tContents.amount > 0) { + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_TANK_INFO", "Contains Fluid: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tContents.getLocalizedName() + EnumChatFormatting.GRAY); + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_TANK_AMOUNT", "Fluid Amount: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(tContents.amount) + " L" + EnumChatFormatting.GRAY); + } + } + } } NBTTagCompound aNBT = aStack.getTagCompound(); if (aNBT != null) { @@ -240,4 +251,82 @@ public class GT_Item_Machines extends ItemBlock { } } } + + @Override + public FluidStack getFluid(ItemStack container) { + if (container != null) { + NBTTagCompound tNBT = container.stackTagCompound; + if (tNBT != null && tNBT.hasKey("mFluid", 10)) { + return FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("mFluid")); + } + } + return null; + } + + @Override + public int getCapacity(ItemStack container) { + if (container != null) { + int tDamage = container.getItemDamage(); + IMetaTileEntity tMetaTile = GregTech_API.METATILEENTITIES[tDamage]; + if (tMetaTile != null) + return tMetaTile.getCapacity(); + } + return 0; + } + + @Override + public int fill(ItemStack container, FluidStack resource, boolean doFill) { + if (container != null && resource != null) { + int tDamage = container.getItemDamage(); + IMetaTileEntity tMetaTile = GregTech_API.METATILEENTITIES[tDamage]; + if (!(tMetaTile instanceof GT_MetaTileEntity_QuantumTank || tMetaTile instanceof GT_MetaTileEntity_SuperTank)) { + return 0; + } + if (container.stackTagCompound == null) container.stackTagCompound = new NBTTagCompound(); + FluidStack tStoredFluid = getFluid(container); + int tCapacity = getCapacity(container); + if (tCapacity <= 0) return 0; + if (tStoredFluid != null && tStoredFluid.isFluidEqual(resource)) { + int tAmount = Math.min(tCapacity - tStoredFluid.amount, resource.amount); + if (doFill) { + FluidStack tNewFluid = new FluidStack(tStoredFluid, tAmount + tStoredFluid.amount); + container.stackTagCompound.setTag("mFluid", tNewFluid.writeToNBT(new NBTTagCompound())); + } + return tAmount; + } + if (tStoredFluid == null) { + int tAmount = Math.min(tCapacity, resource.amount); + if (doFill) { + FluidStack tNewFluid = new FluidStack(resource, tAmount); + container.stackTagCompound.setTag("mFluid", tNewFluid.writeToNBT(new NBTTagCompound())); + } + return tAmount; + } + } + return 0; + } + + @Override + public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) { + if (container != null) { + int tDamage = container.getItemDamage(); + IMetaTileEntity tMetaTile = GregTech_API.METATILEENTITIES[tDamage]; + if (!(tMetaTile instanceof GT_MetaTileEntity_QuantumTank || tMetaTile instanceof GT_MetaTileEntity_SuperTank)) { + return null; + } + if (container.stackTagCompound == null) container.stackTagCompound = new NBTTagCompound(); + FluidStack tStoredFluid = getFluid(container); + if (tStoredFluid != null) { + int tAmount = Math.min(maxDrain, tStoredFluid.amount); + FluidStack tNewFluid = new FluidStack(tStoredFluid, tStoredFluid.amount - tAmount); + FluidStack tOutputFluid = new FluidStack(tStoredFluid, tAmount); + if (doDrain) { + if (tNewFluid.amount <= 0) container.stackTagCompound.removeTag("mFluid"); + else container.stackTagCompound.setTag("mFluid", tNewFluid.writeToNBT(new NBTTagCompound())); + } + return tOutputFluid; + } + } + return null; + } } -- cgit From a3d67f1a3e48b38a2e459643a95a88034b84ec04 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Tue, 23 Nov 2021 17:16:49 +0100 Subject: added configs to disabled dirt particles and pollution fog rendering --- src/main/java/gregtech/GT_Mod.java | 2 ++ src/main/java/gregtech/common/GT_Proxy.java | 10 ++++++++++ src/main/java/gregtech/common/render/GT_PollutionRenderer.java | 6 ++++++ 3 files changed, 18 insertions(+) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index fc7b17e0c6..a4b3c1d1ae 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -340,6 +340,8 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mRenderGlowTextures = GregTech_API.sClientDataFile.get("render", "GlowTextures", true); gregtechproxy.mRenderFlippedMachinesFlipped = GregTech_API.sClientDataFile.get("render", "RenderFlippedMachinesFlipped", true); gregtechproxy.mRenderIndicatorsOnHatch = GregTech_API.sClientDataFile.get("render", "RenderIndicatorsOnHatch", true); + gregtechproxy.mRenderDirtParticles = GregTech_API.sClientDataFile.get("render", "RenderDirtParticles", true); + gregtechproxy.mRenderPollutionFog = GregTech_API.sClientDataFile.get("render", "RenderPollutionFog", true); gregtechproxy.mMaxEqualEntitiesAtOneSpot = tMainConfig.get(aTextGeneral, "MaxEqualEntitiesAtOneSpot", 3).getInt(3); gregtechproxy.mSkeletonsShootGTArrows = tMainConfig.get(aTextGeneral, "SkeletonsShootGTArrows", 16).getInt(16); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 40716a2fa6..1d3b5c8213 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -236,6 +236,16 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { */ public boolean mRenderIndicatorsOnHatch = true; + /** + * This enables the rendering of dirt particles if pollution is enabled too + */ + public boolean mRenderDirtParticles = true; + + /** + * This enables the rendering of the pollution fog if pollution is enabled too + */ + public boolean mRenderPollutionFog = true; + public static final int GUI_ID_COVER_SIDE_BASE = 10; // Takes GUI ID 10 - 15 public static Map oreDictBurnTimes = new HashMap<>(); diff --git a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java index 4353786a7b..305eadf145 100644 --- a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java +++ b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java @@ -6,6 +6,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.GT_Mod; import gregtech.common.entities.GT_EntityFXPollution; import gregtech.common.misc.GT_ClientPollutionMap; import net.minecraft.block.Block; @@ -122,6 +123,8 @@ public class GT_PollutionRenderer { @SubscribeEvent(priority = EventPriority.LOWEST) public void renderGTPollutionFog(EntityViewRenderEvent.RenderFogEvent event) { + if (!GT_Mod.gregtechproxy.mRenderPollutionFog) return; + if ((!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) || (fogIntensityLastTick <= 0 && fogIntensityLastTick >= FOG_START_EXP_RATIO)) return; @@ -138,6 +141,8 @@ public class GT_PollutionRenderer { @SubscribeEvent(priority = EventPriority.LOWEST) public void renderGTPollutionFog(EntityViewRenderEvent.FogDensity event) { + if (!GT_Mod.gregtechproxy.mRenderPollutionFog) return; + if (!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) return; @@ -194,6 +199,7 @@ public class GT_PollutionRenderer { // Adding dirt particles in the air @SubscribeEvent(priority = EventPriority.HIGHEST) public void onClientTick(TickEvent.ClientTickEvent event) { + if (!GT_Mod.gregtechproxy.mRenderDirtParticles) return; Minecraft mc = Minecraft.getMinecraft(); if (mc == null) return; -- cgit From 4d6dd17d60bc1e892fa8d2ca3bd562fb05049558 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Tue, 23 Nov 2021 23:25:14 +0100 Subject: centralized pollution for GT multies --- src/main/java/gregtech/GT_Mod.java | 17 ++++++++++++++++ .../api/graphs/consumers/NodeEnergyReceiver.java | 2 +- .../interfaces/tileentity/IEnergyConnected.java | 2 +- .../api/metatileentity/BaseMetaTileEntity.java | 2 +- .../GT_MetaTileEntity_MultiBlockBase.java | 2 +- src/main/java/gregtech/common/GT_Proxy.java | 14 +++++++++++++ .../multi/GT_MetaTileEntity_Charcoal_Pit.java | 9 ++++++--- .../multi/GT_MetaTileEntity_DieselEngine.java | 3 ++- .../GT_MetaTileEntity_ElectricBlastFurnace.java | 6 ++++++ .../GT_MetaTileEntity_ExtremeDieselEngine.java | 3 ++- .../GT_MetaTileEntity_ImplosionCompressor.java | 3 ++- .../multi/GT_MetaTileEntity_LargeBoiler.java | 10 ++++------ .../GT_MetaTileEntity_LargeBoiler_Bronze.java | 22 +++++++++++++++++++++ .../multi/GT_MetaTileEntity_LargeBoiler_Steel.java | 23 +++++++++++++++++++++- .../GT_MetaTileEntity_LargeBoiler_Titanium.java | 23 +++++++++++++++++++++- ...T_MetaTileEntity_LargeBoiler_TungstenSteel.java | 22 +++++++++++++++++++++ .../multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 3 ++- .../multi/GT_MetaTileEntity_MultiFurnace.java | 6 ++++++ .../GT_MetaTileEntity_PrimitiveBlastFurnace.java | 2 +- .../multi/GT_MetaTileEntity_PyrolyseOven.java | 3 ++- 20 files changed, 156 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index a4b3c1d1ae..7ff7b46d53 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -377,12 +377,29 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mTEMachineRecipes = tMainConfig.get("general", "TEMachineRecipes", false).getBoolean(false); gregtechproxy.mEnableAllMaterials = tMainConfig.get("general", "EnableAllMaterials", false).getBoolean(false); gregtechproxy.mEnableAllComponents = tMainConfig.get("general", "EnableAllComponents", false).getBoolean(false); + + //Pollution gregtechproxy.mPollution = tMainConfig.get("Pollution", "EnablePollution", true).getBoolean(true); gregtechproxy.mPollutionSmogLimit = tMainConfig.get("Pollution", "SmogLimit", 500000).getInt(500000); gregtechproxy.mPollutionPoisonLimit = tMainConfig.get("Pollution", "PoisonLimit", 750000).getInt(750000); gregtechproxy.mPollutionVegetationLimit = tMainConfig.get("Pollution", "VegetationLimit", 1000000).getInt(1000000); gregtechproxy.mPollutionSourRainLimit = tMainConfig.get("Pollution", "SourRainLimit", 2000000).getInt(2000000); + gregtechproxy.mPollutionOnExplosion = tMainConfig.get("Pollution", "SourRainLimit", 100000).getInt(100000); gregtechproxy.mExplosionItemDrop = tMainConfig.get("general", "ExplosionItemDrops", false).getBoolean(false); + gregtechproxy.mPollutionPrimitveBlastFurnace = tMainConfig.get("Pollution", "PollutionPrimitiveBlastFurnace", 200).getInt(200); + gregtechproxy.mPollutionCharcoalPit = tMainConfig.get("Pollution", "PollutionCharcoalPit", 5).getInt(5); + gregtechproxy.mPollutionEBF = tMainConfig.get("Pollution", "PollutionEBF", 20).getInt(20); + gregtechproxy.mPollutionLargeCombustionEngine = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",24).getInt(24); + gregtechproxy.mPollutionExtremeCombustionEngine = tMainConfig.get("Pollution", "PollutionExtremeCombustionEngine",192).getInt(192); + gregtechproxy.mPollutionImplosionCompressor = tMainConfig.get("Pollution", "PollutionImplosionCompressor", 500).getInt(500); + gregtechproxy.mPollutionLargeBronzeBoiler = tMainConfig.get("Pollution", "PollutionLargeBronzeBoiler", 12).getInt(12); + gregtechproxy.mPollutionLargeSteelBoiler = tMainConfig.get("Pollution", "PollutionLargeSteelBoiler", 12).getInt(12); + gregtechproxy.mPollutionLargeTitaniumBoiler = tMainConfig.get("Pollution", "PollutionLargeTitaniumBoiler", 12).getInt(12); + gregtechproxy.mPollutionLargeTungstenSteelBoiler = tMainConfig.get("Pollution", "PollutionLargeTungstenSteelBoiler", 12).getInt(12); + gregtechproxy.mPollutionLargeGasTurbine = tMainConfig.get("Pollution", "PollutionLargeGasTurbine", 15).getInt(15); + gregtechproxy.mPollutionMultiSmelter = tMainConfig.get("Pollution", "PollutionMultiSmelter", 20).getInt(20); + gregtechproxy.mPollutionPyrolyseOven = tMainConfig.get("Pollution", "PollutionPyrolyseOven", 30).getInt(30); + gregtechproxy.mUndergroundOil.getConfig(tMainConfig, "undergroundfluid"); gregtechproxy.mEnableCleanroom = tMainConfig.get("general", "EnableCleanroom", true).getBoolean(true); if (gregtechproxy.mEnableCleanroom) diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java index a24c4acbcd..e1f3c3f0e0 100644 --- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java +++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java @@ -73,7 +73,7 @@ public class NodeEnergyReceiver extends ConsumerNode { tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) if (GT_Mod.gregtechproxy.mPollution) - GT_Pollution.addPollution(tWorld.getChunkFromBlockCoords(tX, tZ), 100000); + GT_Pollution.addPollution(tWorld.getChunkFromBlockCoords(tX, tZ), GT_Mod.gregtechproxy.mPollutionOnExplosion); new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder() .setStrength(tStrength) diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java index 24d0576864..30a5230168 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java @@ -113,7 +113,7 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) if (GT_Mod.gregtechproxy.mPollution) - GT_Pollution.addPollution(tWorld.getChunkFromBlockCoords(tX, tZ), 100000); + GT_Pollution.addPollution(tWorld.getChunkFromBlockCoords(tX, tZ), GT_Mod.gregtechproxy.mPollutionOnExplosion); new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder() .setStrength(tStrength) diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 9176d063ce..a0a5e75b54 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -1403,7 +1403,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } } - GT_Pollution.addPollution(this, 100000); + GT_Pollution.addPollution(this, GT_Mod.gregtechproxy.mPollutionOnExplosion); mMetaTileEntity.doExplosion(aAmount); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 6369c48f8e..b2100e7fd0 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -539,7 +539,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { GT_Log.exp.println("MultiBlockExplosion at: " +this.getBaseMetaTileEntity().getXCoord()+" | "+this.getBaseMetaTileEntity().getYCoord()+" | "+this.getBaseMetaTileEntity().getZCoord()+" DIMID: "+ this.getBaseMetaTileEntity().getWorld().provider.dimensionId+"."); - GT_Pollution.addPollution(getBaseMetaTileEntity(), 300000); + GT_Pollution.addPollution(getBaseMetaTileEntity(), GT_Mod.gregtechproxy.mPollutionOnExplosion); mInventory[1] = null; for (MetaTileEntity tTileEntity : mInputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); for (MetaTileEntity tTileEntity : mOutputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 1d3b5c8213..cced8fd8e3 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -188,6 +188,20 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionPoisonLimit = 750000; public int mPollutionVegetationLimit = 1000000; public int mPollutionSourRainLimit = 2000000; + public int mPollutionOnExplosion = 100000; + public int mPollutionPrimitveBlastFurnace = 10; + public int mPollutionEBF = 20; + public int mPollutionCharcoalPit = 5; + public int mPollutionLargeCombustionEngine = 24; + public int mPollutionExtremeCombustionEngine = 192; + public int mPollutionImplosionCompressor = 500; + public int mPollutionLargeBronzeBoiler = 12; + public int mPollutionLargeSteelBoiler = 12; + public int mPollutionLargeTitaniumBoiler = 12; + public int mPollutionLargeTungstenSteelBoiler = 12; + public int mPollutionLargeGasTurbine = 15; + public int mPollutionMultiSmelter = 20; + public int mPollutionPyrolyseOven = 30; public final GT_UO_DimensionList mUndergroundOil = new GT_UO_DimensionList(); public int mTicksUntilNextCraftSound = 0; public double mMagneticraftBonusOutputPercent = 100.0d; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index 058d5f3487..9fbcccbeda 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.machines.multi; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; @@ -69,7 +70,9 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock mEfficiency = 10000; mEfficiencyIncrease = 10000; mMaxProgresstime = Math.max(1, mMaxProgresstime); - GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime * 10); + + //adds all the pollution at once when the recipe starts + GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime * getPollutionPerTick(null)); return true; } else { mEfficiency = 0; @@ -200,7 +203,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock @Override public int getPollutionPerTick(ItemStack aStack) { - return 0; + return GT_Mod.gregtechproxy.mPollutionCharcoalPit; } @Override @@ -230,7 +233,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock .addInfo("Controller for the Charcoal Pit") .addInfo("Converts Logs into Brittle Charcoal blocks") .addInfo("Will automatically start when valid") - .addPollutionAmount(100) + .addPollutionAmount(20*getPollutionPerTick(null)) .addSeparator() .beginVariableStructureBlock(3, 11, 3, 6, 3, 11, false) .addStructureInfo("Can be up to 11x6x11 in size, shape doesn't matter") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index c6a30ad085..8fce561034 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -2,6 +2,7 @@ package gregtech.common.tileentities.machines.multi; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -265,7 +266,7 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu @Override public int getPollutionPerTick(ItemStack aStack) { - return 24; + return GT_Mod.gregtechproxy.mPollutionLargeCombustionEngine; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index 43498a59fe..4df827b5bc 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -3,6 +3,7 @@ package gregtech.common.tileentities.machines.multi; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Materials; @@ -128,6 +129,11 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); } + @Override + public int getPollutionPerTick(ItemStack aStack){ + return GT_Mod.gregtechproxy.mPollutionEBF; + } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sBlastRecipes; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index 8c3d474b8b..b1028f5bcd 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.machines.multi; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -159,7 +160,7 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die @Override public int getPollutionPerTick(ItemStack aStack) { - return super.getPollutionPerTick(aStack) * 8; + return GT_Mod.gregtechproxy.mPollutionExtremeCombustionEngine; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index b71d01ec07..5765d9a2b4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -1,6 +1,7 @@ package gregtech.common.tileentities.machines.multi; import com.gtnewhorizon.structurelib.structure.IStructureElement; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons; @@ -164,7 +165,7 @@ public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_Cub @Override public int getPollutionPerTick(ItemStack aStack) { - return 500; + return GT_Mod.gregtechproxy.mPollutionImplosionCompressor; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 2599d238a9..d5701d61a0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -132,6 +132,10 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En public abstract int getEfficiencyIncrease(); + public int getIntegratedCircuitConfig(){ + return integratedCircuitConfig; + } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { @@ -300,12 +304,6 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En return 10000; } - @Override - public int getPollutionPerTick(ItemStack aStack) { - int adjustedEUOutput = Math.max(25, getEUt() - 25 * integratedCircuitConfig); - return Math.max(1, 12 * adjustedEUOutput / getEUt()); - } - @Override public int getDamageToComponent(ItemStack aStack) { return 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java index 9aeff9b3d0..4277f306c6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java @@ -1,9 +1,11 @@ package gregtech.common.tileentities.machines.multi; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Bronze(int aID, String aName, String aNameRegional) { @@ -18,6 +20,26 @@ public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_Larg public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LargeBoiler_Bronze(this.mName); } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + + int integratedCircuitConfig = getIntegratedCircuitConfig(); + + /** + * This is the coefficient reducing the pollution based on the throttle applied via the circuit. + * 25 is the equivalent of EU/t removed by a throttle of -1000L/s (25 EU/t * 2 L/EU * 20 ticks = 1000 L/s) + * so 25/getEUt() is the normalized quantity removed by each increment in the throttle + */ + + int integratedCircuitReduction = (1-integratedCircuitConfig*25/getEUt()); + /** + * max here to clamp it to one in case the integratedCircuitReduction goes negative to ensure 1 gibbl/t + * of pollution. + */ + return Math.max(1, GT_Mod.gregtechproxy.mPollutionLargeBronzeBoiler*integratedCircuitReduction); + + } @Override public String getCasingMaterial(){ diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java index d1188955f4..637cdaa32d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java @@ -1,9 +1,11 @@ package gregtech.common.tileentities.machines.multi; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Steel(int aID, String aName, String aNameRegional) { @@ -18,7 +20,26 @@ public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_Large public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LargeBoiler_Steel(this.mName); } - + + @Override + public int getPollutionPerTick(ItemStack aStack) { + + int integratedCircuitConfig = getIntegratedCircuitConfig(); + + /** + * This is the coefficient reducing the pollution based on the throttle applied via the circuit. + * 25 is the equivalent of EU/t removed by a throttle of -1000L/s (25 EU/t * 2 L/EU * 20 ticks = 1000 L/s) + * so 25/getEUt() is the normalized quantity removed by each increment in the throttle + */ + + int integratedCircuitReduction = (1-integratedCircuitConfig*25/getEUt()); + /** + * max here to clamp it to one in case the integratedCircuitReduction goes negative to ensure 1 gibbl/t + * of pollution. + */ + return Math.max(1, GT_Mod.gregtechproxy.mPollutionLargeSteelBoiler*integratedCircuitReduction); + + } @Override public String getCasingMaterial(){ return "Steel"; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java index e67cf64723..45542acd9a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java @@ -1,9 +1,11 @@ package gregtech.common.tileentities.machines.multi; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional) { @@ -18,7 +20,26 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_La public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName); } - + + @Override + public int getPollutionPerTick(ItemStack aStack) { + + int integratedCircuitConfig = getIntegratedCircuitConfig(); + + /** + * This is the coefficient reducing the pollution based on the throttle applied via the circuit. + * 25 is the equivalent of EU/t removed by a throttle of -1000L/s (25 EU/t * 2 L/EU * 20 ticks = 1000 L/s) + * so 25/getEUt() is the normalized quantity removed by each increment in the throttle + */ + + int integratedCircuitReduction = (1-integratedCircuitConfig*25/getEUt()); + /** + * max here to clamp it to one in case the integratedCircuitReduction goes negative to ensure 1 gibbl/t + * of pollution. + */ + return Math.max(1, GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoiler*integratedCircuitReduction); + } + @Override public String getCasingMaterial(){ return "Titanium"; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java index 78e7d25752..2006ba9d99 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java @@ -1,9 +1,11 @@ package gregtech.common.tileentities.machines.multi; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_TungstenSteel(int aID, String aName, String aNameRegional) { @@ -18,6 +20,26 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEnti public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LargeBoiler_TungstenSteel(this.mName); } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + + int integratedCircuitConfig = getIntegratedCircuitConfig(); + + /** + * This is the coefficient reducing the pollution based on the throttle applied via the circuit. + * 25 is the equivalent of EU/t removed by a throttle of -1000L/s (25 EU/t * 2 L/EU * 20 ticks = 1000 L/s) + * so 25/getEUt() is the normalized quantity removed by each increment in the throttle + */ + + int integratedCircuitReduction = (1-integratedCircuitConfig*25/getEUt()); + /** + * max here to clamp it to one in case the integratedCircuitReduction goes negative to ensure 1 gibbl/t + * of pollution. + */ + return Math.max(1, GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoiler*integratedCircuitReduction); + + } @Override public String getCasingMaterial(){ diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index 20f795572e..696abf19d4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.machines.multi; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -83,7 +84,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public int getPollutionPerTick(ItemStack aStack) { - return 15; + return GT_Mod.gregtechproxy.mPollutionLargeGasTurbine; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index 37f56deef5..d93c6dfa65 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -3,6 +3,7 @@ package gregtech.common.tileentities.machines.multi; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -112,6 +113,11 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu return GT_Recipe.GT_Recipe_Map.sFurnaceRecipes; } + @Override + public int getPollutionPerTick(ItemStack aStack){ + return GT_Mod.gregtechproxy.mPollutionMultiSmelter; + } + @Override public boolean checkRecipe(ItemStack aStack) { ArrayList tInputList = getStoredInputs(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java index 61fb394841..3089fc69e1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java @@ -234,7 +234,7 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), - 200); + 20*GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnace); } aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine)); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index 9542c54ce0..6540d77582 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -4,6 +4,7 @@ import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import cpw.mods.fml.common.Loader; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.Textures; @@ -226,7 +227,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu @Override public int getPollutionPerTick(ItemStack aStack) { - return 30; + return GT_Mod.gregtechproxy.mPollutionPyrolyseOven; } @Override -- cgit From 2662d813045d763909c53478594cbf4dcbbcbb7f Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Wed, 24 Nov 2021 00:31:35 +0100 Subject: centralized pollution for GT boilers --- src/main/java/gregtech/GT_Mod.java | 3 +++ src/main/java/gregtech/common/GT_Proxy.java | 3 +++ .../common/tileentities/boilers/GT_MetaTileEntity_Boiler.java | 2 +- .../tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java | 7 ++++--- .../common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java | 6 +++--- .../tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java | 5 +++-- 6 files changed, 17 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 7ff7b46d53..db65afc608 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -399,6 +399,9 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionLargeGasTurbine = tMainConfig.get("Pollution", "PollutionLargeGasTurbine", 15).getInt(15); gregtechproxy.mPollutionMultiSmelter = tMainConfig.get("Pollution", "PollutionMultiSmelter", 20).getInt(20); gregtechproxy.mPollutionPyrolyseOven = tMainConfig.get("Pollution", "PollutionPyrolyseOven", 30).getInt(30); + gregtechproxy.mPollutionSmallCoalBoiler = tMainConfig.get("Pollution", "PollutionSmallCoalBoiler", 1).getInt(1); + gregtechproxy.mPollutionHighPressureLavaBoiler = tMainConfig.get("Pollution", "PollutionHighPressureLavaBoiler", 1).getInt(1); + gregtechproxy.mPollutionHighPressureCoalBoiler = tMainConfig.get("Pollution", "PollutionHighPressureCoalBoiler", 2).getInt(2); gregtechproxy.mUndergroundOil.getConfig(tMainConfig, "undergroundfluid"); gregtechproxy.mEnableCleanroom = tMainConfig.get("general", "EnableCleanroom", true).getBoolean(true); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index cced8fd8e3..34711399d2 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -202,6 +202,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionLargeGasTurbine = 15; public int mPollutionMultiSmelter = 20; public int mPollutionPyrolyseOven = 30; + public int mPollutionSmallCoalBoiler = 1; + public int mPollutionHighPressureLavaBoiler = 1; + public int mPollutionHighPressureCoalBoiler = 2; public final GT_UO_DimensionList mUndergroundOil = new GT_UO_DimensionList(); public int mTicksUntilNextCraftSound = 0; public double mMagneticraftBonusOutputPercent = 100.0d; diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java index 96b991e767..7f004b91f5 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java @@ -246,7 +246,7 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa private void pollute(long aTick) { if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { - GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution()); + GT_Pollution.addPollution(getBaseMetaTileEntity(), 20*getPollution()); } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index 41620dd711..737346b66d 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.boilers; +import gregtech.GT_Mod; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; @@ -30,7 +31,7 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { super(aID, aName, aNameRegional, new String[]{ "An early way to get Steam Power", "Produces 120L of Steam per second", - "Causes 20 Pollution per second"}); + "Causes "+Integer.toString(GT_Mod.gregtechproxy.mPollutionSmallCoalBoiler*20)+" Pollution per second"}); } public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional, String[] aDescription) { @@ -93,13 +94,13 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L) && this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { - GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution()); + GT_Pollution.addPollution(getBaseMetaTileEntity(), 20*getPollution()); } } @Override protected int getPollution() { - return 20; + return GT_Mod.gregtechproxy.mPollutionSmallCoalBoiler; } @Override diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java index aeb0a66173..791968cd5e 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.boilers; +import gregtech.GT_Mod; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; @@ -28,13 +29,12 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { public static final int ENERGY_PER_LAVA = 1; public static final int CONSUMPTION_PER_HEATUP = 3; public static final int PRODUCTION_PER_SECOND = 600; - public static final int POLLUTION_PER_SECOND = 20; public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, new String[]{ "A Boiler running off Lava", "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second", - "Causes " + POLLUTION_PER_SECOND + " Pollution per second", + "Causes " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoiler*20) + " Pollution per second", "Consumes " + ((double) CONSUMPTION_PER_HEATUP / ENERGY_PER_LAVA) + "L of Lava every " + COOLDOWN_INTERVAL + " ticks when fully heat up"}); } @@ -98,7 +98,7 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { @Override protected int getPollution() { - return POLLUTION_PER_SECOND; + return GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoiler; } @Override diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java index ab51156868..40b79e0c46 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.boilers; +import gregtech.GT_Mod; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -24,7 +25,7 @@ public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bro super(aID, aName, aNameRegional, new String[]{ "Faster than the Bronze Boiler", "Produces 300L of Steam per second", - "Causes 30 Pollution per second"}); + "Causes "+Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoiler*20)+" Pollution per second"}); } public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -81,7 +82,7 @@ public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bro @Override protected int getPollution() { - return 30; + return GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoiler; } @Override -- cgit From d12fb659dae02f08ff4d1465d4c89e7de3bd0177 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Wed, 24 Nov 2021 01:00:07 +0100 Subject: centralized pollution for generators --- src/main/java/gregtech/GT_Mod.java | 1 + src/main/java/gregtech/common/GT_Proxy.java | 2 ++ .../tileentities/generators/GT_MetaTileEntity_DieselGenerator.java | 7 ++++--- .../tileentities/generators/GT_MetaTileEntity_GasTurbine.java | 7 ++++--- 4 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index db65afc608..1613e2055e 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -402,6 +402,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionSmallCoalBoiler = tMainConfig.get("Pollution", "PollutionSmallCoalBoiler", 1).getInt(1); gregtechproxy.mPollutionHighPressureLavaBoiler = tMainConfig.get("Pollution", "PollutionHighPressureLavaBoiler", 1).getInt(1); gregtechproxy.mPollutionHighPressureCoalBoiler = tMainConfig.get("Pollution", "PollutionHighPressureCoalBoiler", 2).getInt(2); + gregtechproxy.mPollutionBaseDieselGenerator = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator",2).getInt(2); gregtechproxy.mUndergroundOil.getConfig(tMainConfig, "undergroundfluid"); gregtechproxy.mEnableCleanroom = tMainConfig.get("general", "EnableCleanroom", true).getBoolean(true); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 34711399d2..b39812b53f 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -205,6 +205,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionSmallCoalBoiler = 1; public int mPollutionHighPressureLavaBoiler = 1; public int mPollutionHighPressureCoalBoiler = 2; + public int mPollutionBaseDieselGenerator = 2; + public int mPollutionBaseGasTurbine = 1; public final GT_UO_DimensionList mUndergroundOil = new GT_UO_DimensionList(); public int mTicksUntilNextCraftSound = 0; public double mMagneticraftBonusOutputPercent = 100.0d; diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index 606af204e9..19b537821f 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -1,6 +1,7 @@ package gregtech.common.tileentities.generators; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.ItemList; @@ -19,14 +20,14 @@ import static gregtech.api.enums.Textures.BlockIcons.*; public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGenerator { - public static final int BASE_POLLUTION = 2; + public int mEfficiency; public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, new String[]{ "Requires liquid Fuel", - "Causes " + (int) (20 * BASE_POLLUTION * Math.pow(2, aTier - 1)) + " Pollution per second"}); + "Causes " + (int) (20 * GT_Mod.gregtechproxy.mPollutionBaseDieselGenerator * Math.pow(2, aTier - 1)) + " Pollution per second"}); onConfigLoad(); } @@ -165,6 +166,6 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe @Override public int getPollution() { - return (int) (BASE_POLLUTION * Math.pow(2, mTier - 1)); + return (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGenerator * Math.pow(2, mTier - 1)); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index 02b42e2b2f..6a3c17e893 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.generators; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; @@ -12,14 +13,14 @@ import gregtech.api.util.GT_Recipe; import static gregtech.api.enums.Textures.BlockIcons.*; public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerator { - public static final int BASE_POLLUTION = 1; + public int mEfficiency; public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, new String[]{ "Requires flammable Gasses", - "Causes " + (int) (20 * BASE_POLLUTION * Math.pow(2, aTier - 1)) + " Pollution per second"}); + "Causes " + (int) (20 * GT_Mod.gregtechproxy.mPollutionBaseGasTurbine * Math.pow(2, aTier - 1)) + " Pollution per second"}); onConfigLoad(); } @@ -137,6 +138,6 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat @Override public int getPollution() { - return (int) (BASE_POLLUTION * Math.pow(2, mTier - 1)); + return (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbine * Math.pow(2, mTier - 1)); } } -- cgit From ca41880e2b798252e0d75508d65d51382c6192d2 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Wed, 24 Nov 2021 01:12:22 +0100 Subject: made it easier to edit default values in code --- src/main/java/gregtech/GT_Mod.java | 51 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 1613e2055e..d5698b9657 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -378,31 +378,32 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mEnableAllMaterials = tMainConfig.get("general", "EnableAllMaterials", false).getBoolean(false); gregtechproxy.mEnableAllComponents = tMainConfig.get("general", "EnableAllComponents", false).getBoolean(false); - //Pollution - gregtechproxy.mPollution = tMainConfig.get("Pollution", "EnablePollution", true).getBoolean(true); - gregtechproxy.mPollutionSmogLimit = tMainConfig.get("Pollution", "SmogLimit", 500000).getInt(500000); - gregtechproxy.mPollutionPoisonLimit = tMainConfig.get("Pollution", "PoisonLimit", 750000).getInt(750000); - gregtechproxy.mPollutionVegetationLimit = tMainConfig.get("Pollution", "VegetationLimit", 1000000).getInt(1000000); - gregtechproxy.mPollutionSourRainLimit = tMainConfig.get("Pollution", "SourRainLimit", 2000000).getInt(2000000); - gregtechproxy.mPollutionOnExplosion = tMainConfig.get("Pollution", "SourRainLimit", 100000).getInt(100000); - gregtechproxy.mExplosionItemDrop = tMainConfig.get("general", "ExplosionItemDrops", false).getBoolean(false); - gregtechproxy.mPollutionPrimitveBlastFurnace = tMainConfig.get("Pollution", "PollutionPrimitiveBlastFurnace", 200).getInt(200); - gregtechproxy.mPollutionCharcoalPit = tMainConfig.get("Pollution", "PollutionCharcoalPit", 5).getInt(5); - gregtechproxy.mPollutionEBF = tMainConfig.get("Pollution", "PollutionEBF", 20).getInt(20); - gregtechproxy.mPollutionLargeCombustionEngine = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",24).getInt(24); - gregtechproxy.mPollutionExtremeCombustionEngine = tMainConfig.get("Pollution", "PollutionExtremeCombustionEngine",192).getInt(192); - gregtechproxy.mPollutionImplosionCompressor = tMainConfig.get("Pollution", "PollutionImplosionCompressor", 500).getInt(500); - gregtechproxy.mPollutionLargeBronzeBoiler = tMainConfig.get("Pollution", "PollutionLargeBronzeBoiler", 12).getInt(12); - gregtechproxy.mPollutionLargeSteelBoiler = tMainConfig.get("Pollution", "PollutionLargeSteelBoiler", 12).getInt(12); - gregtechproxy.mPollutionLargeTitaniumBoiler = tMainConfig.get("Pollution", "PollutionLargeTitaniumBoiler", 12).getInt(12); - gregtechproxy.mPollutionLargeTungstenSteelBoiler = tMainConfig.get("Pollution", "PollutionLargeTungstenSteelBoiler", 12).getInt(12); - gregtechproxy.mPollutionLargeGasTurbine = tMainConfig.get("Pollution", "PollutionLargeGasTurbine", 15).getInt(15); - gregtechproxy.mPollutionMultiSmelter = tMainConfig.get("Pollution", "PollutionMultiSmelter", 20).getInt(20); - gregtechproxy.mPollutionPyrolyseOven = tMainConfig.get("Pollution", "PollutionPyrolyseOven", 30).getInt(30); - gregtechproxy.mPollutionSmallCoalBoiler = tMainConfig.get("Pollution", "PollutionSmallCoalBoiler", 1).getInt(1); - gregtechproxy.mPollutionHighPressureLavaBoiler = tMainConfig.get("Pollution", "PollutionHighPressureLavaBoiler", 1).getInt(1); - gregtechproxy.mPollutionHighPressureCoalBoiler = tMainConfig.get("Pollution", "PollutionHighPressureCoalBoiler", 2).getInt(2); - gregtechproxy.mPollutionBaseDieselGenerator = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator",2).getInt(2); + //Pollution: edit GT_Proxy.java to change default values + gregtechproxy.mPollution = tMainConfig.get("Pollution", "EnablePollution", gregtechproxy.mPollution).getBoolean(gregtechproxy.mPollution); + gregtechproxy.mPollutionSmogLimit = tMainConfig.get("Pollution", "SmogLimit", gregtechproxy.mPollutionSmogLimit).getInt(gregtechproxy.mPollutionSmogLimit); + gregtechproxy.mPollutionPoisonLimit = tMainConfig.get("Pollution", "PoisonLimit", gregtechproxy.mPollutionPoisonLimit).getInt(gregtechproxy.mPollutionPoisonLimit); + gregtechproxy.mPollutionVegetationLimit = tMainConfig.get("Pollution", "VegetationLimit", gregtechproxy.mPollutionVegetationLimit).getInt(gregtechproxy.mPollutionVegetationLimit); + gregtechproxy.mPollutionSourRainLimit = tMainConfig.get("Pollution", "SourRainLimit", gregtechproxy.mPollutionSourRainLimit).getInt(gregtechproxy.mPollutionSourRainLimit); + gregtechproxy.mPollutionOnExplosion = tMainConfig.get("Pollution", "SourRainLimit", gregtechproxy.mPollutionOnExplosion).getInt(gregtechproxy.mPollutionOnExplosion); + gregtechproxy.mExplosionItemDrop = tMainConfig.get("general", "ExplosionItemDrops", gregtechproxy.mExplosionItemDrop).getBoolean(gregtechproxy.mExplosionItemDrop); + gregtechproxy.mPollutionPrimitveBlastFurnace = tMainConfig.get("Pollution", "PollutionPrimitiveBlastFurnace", gregtechproxy.mPollutionPrimitveBlastFurnace).getInt(gregtechproxy.mPollutionPrimitveBlastFurnace); + gregtechproxy.mPollutionCharcoalPit = tMainConfig.get("Pollution", "PollutionCharcoalPit", gregtechproxy.mPollutionCharcoalPit).getInt(gregtechproxy.mPollutionCharcoalPit); + gregtechproxy.mPollutionEBF = tMainConfig.get("Pollution", "PollutionEBF", gregtechproxy.mPollutionEBF).getInt(gregtechproxy.mPollutionEBF); + gregtechproxy.mPollutionLargeCombustionEngine = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",gregtechproxy.mPollutionLargeCombustionEngine).getInt(gregtechproxy.mPollutionLargeCombustionEngine); + gregtechproxy.mPollutionExtremeCombustionEngine = tMainConfig.get("Pollution", "PollutionExtremeCombustionEngine",gregtechproxy.mPollutionExtremeCombustionEngine).getInt(gregtechproxy.mPollutionExtremeCombustionEngine); + gregtechproxy.mPollutionImplosionCompressor = tMainConfig.get("Pollution", "PollutionImplosionCompressor", gregtechproxy.mPollutionImplosionCompressor).getInt(gregtechproxy.mPollutionImplosionCompressor); + gregtechproxy.mPollutionLargeBronzeBoiler = tMainConfig.get("Pollution", "PollutionLargeBronzeBoiler", gregtechproxy.mPollutionLargeBronzeBoiler).getInt(gregtechproxy.mPollutionLargeBronzeBoiler); + gregtechproxy.mPollutionLargeSteelBoiler = tMainConfig.get("Pollution", "PollutionLargeSteelBoiler", gregtechproxy.mPollutionLargeSteelBoiler).getInt(gregtechproxy.mPollutionLargeSteelBoiler); + gregtechproxy.mPollutionLargeTitaniumBoiler = tMainConfig.get("Pollution", "PollutionLargeTitaniumBoiler", gregtechproxy.mPollutionLargeTitaniumBoiler ).getInt(gregtechproxy.mPollutionLargeTitaniumBoiler ); + gregtechproxy.mPollutionLargeTungstenSteelBoiler = tMainConfig.get("Pollution", "PollutionLargeTungstenSteelBoiler", gregtechproxy.mPollutionLargeTungstenSteelBoiler).getInt(gregtechproxy.mPollutionLargeTungstenSteelBoiler); + gregtechproxy.mPollutionLargeGasTurbine = tMainConfig.get("Pollution", "PollutionLargeGasTurbine", gregtechproxy.mPollutionLargeGasTurbine).getInt( gregtechproxy.mPollutionLargeGasTurbine); + gregtechproxy.mPollutionMultiSmelter = tMainConfig.get("Pollution", "PollutionMultiSmelter", gregtechproxy.mPollutionMultiSmelter).getInt(gregtechproxy.mPollutionMultiSmelter); + gregtechproxy.mPollutionPyrolyseOven = tMainConfig.get("Pollution", "PollutionPyrolyseOven", gregtechproxy.mPollutionPyrolyseOven).getInt(gregtechproxy.mPollutionPyrolyseOven); + gregtechproxy.mPollutionSmallCoalBoiler = tMainConfig.get("Pollution", "PollutionSmallCoalBoiler", gregtechproxy.mPollutionSmallCoalBoiler).getInt(gregtechproxy.mPollutionSmallCoalBoiler); + gregtechproxy.mPollutionHighPressureLavaBoiler = tMainConfig.get("Pollution", "PollutionHighPressureLavaBoiler", gregtechproxy.mPollutionHighPressureLavaBoiler).getInt(gregtechproxy.mPollutionHighPressureLavaBoiler); + gregtechproxy.mPollutionHighPressureCoalBoiler = tMainConfig.get("Pollution", "PollutionHighPressureCoalBoiler", gregtechproxy.mPollutionHighPressureCoalBoiler).getInt(gregtechproxy.mPollutionHighPressureCoalBoiler); + gregtechproxy.mPollutionBaseDieselGenerator = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator",gregtechproxy.mPollutionBaseDieselGenerator).getInt(gregtechproxy.mPollutionBaseDieselGenerator); + gregtechproxy.mPollutionBaseGasTurbine = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator", gregtechproxy.mPollutionBaseGasTurbine).getInt(gregtechproxy.mPollutionBaseGasTurbine); gregtechproxy.mUndergroundOil.getConfig(tMainConfig, "undergroundfluid"); gregtechproxy.mEnableCleanroom = tMainConfig.get("general", "EnableCleanroom", true).getBoolean(true); -- cgit From 81ee095c16fcb19bc0c2155057c34325f3b4488d Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Wed, 24 Nov 2021 01:15:42 +0100 Subject: fixed bricked blast furnace tooltip --- .../machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java index 446965f3b6..7edde2d499 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.machines.multi; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons; @@ -34,7 +35,7 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri .addInfo("Controller Block for the Bricked Blast Furnace") .addInfo("Usable for Steel and general Pyrometallurgy") .addInfo("Has a useful interface, unlike other gregtech multis") - .addPollutionAmount(200) + .addPollutionAmount(20 * GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnace) .addSeparator() .beginStructureBlock(3, 4, 3, true) .addController("Front center") -- cgit From edfa66b41faa598b3d0219df4534839e7ed88e74 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 01:34:56 +0100 Subject: changed large boilers to use per second for more precision --- src/main/java/gregtech/GT_Mod.java | 9 +++++---- .../GT_MetaTileEntity_MultiBlockBase.java | 7 +++++++ src/main/java/gregtech/common/GT_Proxy.java | 9 +++++---- .../multi/GT_MetaTileEntity_LargeBoiler.java | 2 +- .../GT_MetaTileEntity_LargeBoiler_Bronze.java | 23 +++++++--------------- .../multi/GT_MetaTileEntity_LargeBoiler_Steel.java | 22 +++++++-------------- .../GT_MetaTileEntity_LargeBoiler_Titanium.java | 20 ++++++------------- ...T_MetaTileEntity_LargeBoiler_TungstenSteel.java | 23 +++++++--------------- 8 files changed, 45 insertions(+), 70 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index d5698b9657..82f0228d41 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -392,10 +392,11 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionLargeCombustionEngine = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",gregtechproxy.mPollutionLargeCombustionEngine).getInt(gregtechproxy.mPollutionLargeCombustionEngine); gregtechproxy.mPollutionExtremeCombustionEngine = tMainConfig.get("Pollution", "PollutionExtremeCombustionEngine",gregtechproxy.mPollutionExtremeCombustionEngine).getInt(gregtechproxy.mPollutionExtremeCombustionEngine); gregtechproxy.mPollutionImplosionCompressor = tMainConfig.get("Pollution", "PollutionImplosionCompressor", gregtechproxy.mPollutionImplosionCompressor).getInt(gregtechproxy.mPollutionImplosionCompressor); - gregtechproxy.mPollutionLargeBronzeBoiler = tMainConfig.get("Pollution", "PollutionLargeBronzeBoiler", gregtechproxy.mPollutionLargeBronzeBoiler).getInt(gregtechproxy.mPollutionLargeBronzeBoiler); - gregtechproxy.mPollutionLargeSteelBoiler = tMainConfig.get("Pollution", "PollutionLargeSteelBoiler", gregtechproxy.mPollutionLargeSteelBoiler).getInt(gregtechproxy.mPollutionLargeSteelBoiler); - gregtechproxy.mPollutionLargeTitaniumBoiler = tMainConfig.get("Pollution", "PollutionLargeTitaniumBoiler", gregtechproxy.mPollutionLargeTitaniumBoiler ).getInt(gregtechproxy.mPollutionLargeTitaniumBoiler ); - gregtechproxy.mPollutionLargeTungstenSteelBoiler = tMainConfig.get("Pollution", "PollutionLargeTungstenSteelBoiler", gregtechproxy.mPollutionLargeTungstenSteelBoiler).getInt(gregtechproxy.mPollutionLargeTungstenSteelBoiler); + gregtechproxy.mPollutionLargeBronzeBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeBronzeBoiler", gregtechproxy.mPollutionLargeBronzeBoilerPerSecond).getInt(gregtechproxy.mPollutionLargeBronzeBoilerPerSecond); + gregtechproxy.mPollutionLargeSteelBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeSteelBoiler", gregtechproxy.mPollutionLargeSteelBoilerPerSecond).getInt(gregtechproxy.mPollutionLargeSteelBoilerPerSecond); + gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeTitaniumBoiler", gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond ).getInt(gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond ); + gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeTungstenSteelBoiler", gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond).getInt(gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond); + gregtechproxy.mPollutionReleasedByThrottle = tMainConfig.get("Pollution", "PollutionReleasedByThrottle", gregtechproxy.mPollutionReleasedByThrottle).getDouble(gregtechproxy.mPollutionReleasedByThrottle); gregtechproxy.mPollutionLargeGasTurbine = tMainConfig.get("Pollution", "PollutionLargeGasTurbine", gregtechproxy.mPollutionLargeGasTurbine).getInt( gregtechproxy.mPollutionLargeGasTurbine); gregtechproxy.mPollutionMultiSmelter = tMainConfig.get("Pollution", "PollutionMultiSmelter", gregtechproxy.mPollutionMultiSmelter).getInt(gregtechproxy.mPollutionMultiSmelter); gregtechproxy.mPollutionPyrolyseOven = tMainConfig.get("Pollution", "PollutionPyrolyseOven", gregtechproxy.mPollutionPyrolyseOven).getInt(gregtechproxy.mPollutionPyrolyseOven); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index b2100e7fd0..8fe70c4f72 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -400,6 +400,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { */ public abstract int getPollutionPerTick(ItemStack aStack); + /** + * Gets the pollution produced per second by this multiblock + */ + public int getPollutionPerSecond(ItemStack aStack){ + return 20 * getPollutionPerTick(aStack); + } + /** * Gets the damage to the ItemStack, usually 0 or 1. */ diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index b39812b53f..12da46b8d7 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -195,10 +195,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionLargeCombustionEngine = 24; public int mPollutionExtremeCombustionEngine = 192; public int mPollutionImplosionCompressor = 500; - public int mPollutionLargeBronzeBoiler = 12; - public int mPollutionLargeSteelBoiler = 12; - public int mPollutionLargeTitaniumBoiler = 12; - public int mPollutionLargeTungstenSteelBoiler = 12; + public int mPollutionLargeBronzeBoilerPerSecond = 1000; + public int mPollutionLargeSteelBoilerPerSecond = 2000; + public int mPollutionLargeTitaniumBoilerPerSecond = 3000; + public int mPollutionLargeTungstenSteelBoilerPerSecond = 4000; + public double mPollutionReleasedByThrottle = 1.0/24.0; // divided by 24 because 24 circuit conf public int mPollutionLargeGasTurbine = 15; public int mPollutionMultiSmelter = 20; public int mPollutionPyrolyseOven = 30; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index d5701d61a0..a73fb68962 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -90,7 +90,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En .addInfo("Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + getEUt() * 40 + "L/s")//? .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") .addInfo(String.format("Diesel fuels have 1/4 efficiency - Takes %.2f seconds to heat up", 500.0 / getEfficiencyIncrease()))//? check semifluid again - .addPollutionAmount(20 * getPollutionPerTick(null)) + .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(3, 5, 3, false) .addController("Front bottom") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java index 4277f306c6..1e89258ae4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java @@ -22,25 +22,16 @@ public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_Larg } @Override - public int getPollutionPerTick(ItemStack aStack) { - + public int getPollutionPerSecond(ItemStack aStack) { int integratedCircuitConfig = getIntegratedCircuitConfig(); + return Math.max(1, (int) (GT_Mod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond/(GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * integratedCircuitConfig))); + } - /** - * This is the coefficient reducing the pollution based on the throttle applied via the circuit. - * 25 is the equivalent of EU/t removed by a throttle of -1000L/s (25 EU/t * 2 L/EU * 20 ticks = 1000 L/s) - * so 25/getEUt() is the normalized quantity removed by each increment in the throttle - */ - - int integratedCircuitReduction = (1-integratedCircuitConfig*25/getEUt()); - /** - * max here to clamp it to one in case the integratedCircuitReduction goes negative to ensure 1 gibbl/t - * of pollution. - */ - return Math.max(1, GT_Mod.gregtechproxy.mPollutionLargeBronzeBoiler*integratedCircuitReduction); - + @Override + public int getPollutionPerTick(ItemStack aStack){ + return getPollutionPerSecond(aStack)/20; } - + @Override public String getCasingMaterial(){ return "Bronze"; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java index 637cdaa32d..4c08b1fff1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java @@ -22,24 +22,16 @@ public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_Large } @Override - public int getPollutionPerTick(ItemStack aStack) { - + public int getPollutionPerSecond(ItemStack aStack) { int integratedCircuitConfig = getIntegratedCircuitConfig(); + return Math.max(1, (int) (GT_Mod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond/(GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * integratedCircuitConfig))); + } - /** - * This is the coefficient reducing the pollution based on the throttle applied via the circuit. - * 25 is the equivalent of EU/t removed by a throttle of -1000L/s (25 EU/t * 2 L/EU * 20 ticks = 1000 L/s) - * so 25/getEUt() is the normalized quantity removed by each increment in the throttle - */ - - int integratedCircuitReduction = (1-integratedCircuitConfig*25/getEUt()); - /** - * max here to clamp it to one in case the integratedCircuitReduction goes negative to ensure 1 gibbl/t - * of pollution. - */ - return Math.max(1, GT_Mod.gregtechproxy.mPollutionLargeSteelBoiler*integratedCircuitReduction); - + @Override + public int getPollutionPerTick(ItemStack aStack){ + return getPollutionPerSecond(aStack)/20; } + @Override public String getCasingMaterial(){ return "Steel"; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java index 45542acd9a..3a2566c82e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java @@ -22,22 +22,14 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_La } @Override - public int getPollutionPerTick(ItemStack aStack) { - + public int getPollutionPerSecond(ItemStack aStack) { int integratedCircuitConfig = getIntegratedCircuitConfig(); + return Math.max(1, (int) (GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond/(GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * integratedCircuitConfig))); + } - /** - * This is the coefficient reducing the pollution based on the throttle applied via the circuit. - * 25 is the equivalent of EU/t removed by a throttle of -1000L/s (25 EU/t * 2 L/EU * 20 ticks = 1000 L/s) - * so 25/getEUt() is the normalized quantity removed by each increment in the throttle - */ - - int integratedCircuitReduction = (1-integratedCircuitConfig*25/getEUt()); - /** - * max here to clamp it to one in case the integratedCircuitReduction goes negative to ensure 1 gibbl/t - * of pollution. - */ - return Math.max(1, GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoiler*integratedCircuitReduction); + @Override + public int getPollutionPerTick(ItemStack aStack){ + return getPollutionPerSecond(aStack)/20; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java index 2006ba9d99..4a1fa4d931 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java @@ -22,25 +22,16 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEnti } @Override - public int getPollutionPerTick(ItemStack aStack) { - + public int getPollutionPerSecond(ItemStack aStack) { int integratedCircuitConfig = getIntegratedCircuitConfig(); + return Math.max(1, (int) (GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond/(GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * integratedCircuitConfig))); + } - /** - * This is the coefficient reducing the pollution based on the throttle applied via the circuit. - * 25 is the equivalent of EU/t removed by a throttle of -1000L/s (25 EU/t * 2 L/EU * 20 ticks = 1000 L/s) - * so 25/getEUt() is the normalized quantity removed by each increment in the throttle - */ - - int integratedCircuitReduction = (1-integratedCircuitConfig*25/getEUt()); - /** - * max here to clamp it to one in case the integratedCircuitReduction goes negative to ensure 1 gibbl/t - * of pollution. - */ - return Math.max(1, GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoiler*integratedCircuitReduction); - + @Override + public int getPollutionPerTick(ItemStack aStack){ + return getPollutionPerSecond(aStack)/20; } - + @Override public String getCasingMaterial(){ return "TungstenSteel"; -- cgit From 9dc605d3d9825f02c209b58bc52bb1b3f9673228 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 01:39:49 +0100 Subject: changed implosion compressor to user per second for more precision --- src/main/java/gregtech/GT_Mod.java | 2 +- src/main/java/gregtech/common/GT_Proxy.java | 2 +- .../machines/multi/GT_MetaTileEntity_ImplosionCompressor.java | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 82f0228d41..fa71ea5a77 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -391,7 +391,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionEBF = tMainConfig.get("Pollution", "PollutionEBF", gregtechproxy.mPollutionEBF).getInt(gregtechproxy.mPollutionEBF); gregtechproxy.mPollutionLargeCombustionEngine = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",gregtechproxy.mPollutionLargeCombustionEngine).getInt(gregtechproxy.mPollutionLargeCombustionEngine); gregtechproxy.mPollutionExtremeCombustionEngine = tMainConfig.get("Pollution", "PollutionExtremeCombustionEngine",gregtechproxy.mPollutionExtremeCombustionEngine).getInt(gregtechproxy.mPollutionExtremeCombustionEngine); - gregtechproxy.mPollutionImplosionCompressor = tMainConfig.get("Pollution", "PollutionImplosionCompressor", gregtechproxy.mPollutionImplosionCompressor).getInt(gregtechproxy.mPollutionImplosionCompressor); + gregtechproxy.mPollutionImplosionCompressorPerSecond = tMainConfig.get("Pollution", "PollutionImplosionCompressor", gregtechproxy.mPollutionImplosionCompressorPerSecond).getInt(gregtechproxy.mPollutionImplosionCompressorPerSecond); gregtechproxy.mPollutionLargeBronzeBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeBronzeBoiler", gregtechproxy.mPollutionLargeBronzeBoilerPerSecond).getInt(gregtechproxy.mPollutionLargeBronzeBoilerPerSecond); gregtechproxy.mPollutionLargeSteelBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeSteelBoiler", gregtechproxy.mPollutionLargeSteelBoilerPerSecond).getInt(gregtechproxy.mPollutionLargeSteelBoilerPerSecond); gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeTitaniumBoiler", gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond ).getInt(gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond ); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 12da46b8d7..56a7e58214 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -194,7 +194,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionCharcoalPit = 5; public int mPollutionLargeCombustionEngine = 24; public int mPollutionExtremeCombustionEngine = 192; - public int mPollutionImplosionCompressor = 500; + public int mPollutionImplosionCompressorPerSecond = 10000; public int mPollutionLargeBronzeBoilerPerSecond = 1000; public int mPollutionLargeSteelBoilerPerSecond = 2000; public int mPollutionLargeTitaniumBoilerPerSecond = 3000; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index 5765d9a2b4..a28dfc343e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -46,7 +46,7 @@ public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_Cub tt.addMachineType("Implosion Compressor") .addInfo("Explosions are fun") .addInfo("Controller block for the Implosion Compressor") - .addPollutionAmount(20 * getPollutionPerTick(null)) + .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(3, 3, 3, true) .addController("Front center") @@ -165,9 +165,13 @@ public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_Cub @Override public int getPollutionPerTick(ItemStack aStack) { - return GT_Mod.gregtechproxy.mPollutionImplosionCompressor; + return getPollutionPerSecond(aStack)/20; } + @Override + public int getPollutionPerSecond(ItemStack aStack){ + return GT_Mod.gregtechproxy.mPollutionImplosionCompressorPerSecond; + } @Override public int getDamageToComponent(ItemStack aStack) { return 0; -- cgit From 234b55ee8331afc47be1235948d116d184f1c9c3 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 01:42:55 +0100 Subject: changed the BBF to use per second for more precision --- src/main/java/gregtech/GT_Mod.java | 2 +- src/main/java/gregtech/common/GT_Proxy.java | 2 +- .../machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java | 2 +- .../machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index fa71ea5a77..f345e1f835 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -386,7 +386,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionSourRainLimit = tMainConfig.get("Pollution", "SourRainLimit", gregtechproxy.mPollutionSourRainLimit).getInt(gregtechproxy.mPollutionSourRainLimit); gregtechproxy.mPollutionOnExplosion = tMainConfig.get("Pollution", "SourRainLimit", gregtechproxy.mPollutionOnExplosion).getInt(gregtechproxy.mPollutionOnExplosion); gregtechproxy.mExplosionItemDrop = tMainConfig.get("general", "ExplosionItemDrops", gregtechproxy.mExplosionItemDrop).getBoolean(gregtechproxy.mExplosionItemDrop); - gregtechproxy.mPollutionPrimitveBlastFurnace = tMainConfig.get("Pollution", "PollutionPrimitiveBlastFurnace", gregtechproxy.mPollutionPrimitveBlastFurnace).getInt(gregtechproxy.mPollutionPrimitveBlastFurnace); + gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond = tMainConfig.get("Pollution", "PollutionPrimitiveBlastFurnace", gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond).getInt(gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond); gregtechproxy.mPollutionCharcoalPit = tMainConfig.get("Pollution", "PollutionCharcoalPit", gregtechproxy.mPollutionCharcoalPit).getInt(gregtechproxy.mPollutionCharcoalPit); gregtechproxy.mPollutionEBF = tMainConfig.get("Pollution", "PollutionEBF", gregtechproxy.mPollutionEBF).getInt(gregtechproxy.mPollutionEBF); gregtechproxy.mPollutionLargeCombustionEngine = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",gregtechproxy.mPollutionLargeCombustionEngine).getInt(gregtechproxy.mPollutionLargeCombustionEngine); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 56a7e58214..c4091728b2 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -189,7 +189,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionVegetationLimit = 1000000; public int mPollutionSourRainLimit = 2000000; public int mPollutionOnExplosion = 100000; - public int mPollutionPrimitveBlastFurnace = 10; + public int mPollutionPrimitveBlastFurnacePerSecond = 200; public int mPollutionEBF = 20; public int mPollutionCharcoalPit = 5; public int mPollutionLargeCombustionEngine = 24; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java index 7edde2d499..617c191562 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java @@ -35,7 +35,7 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri .addInfo("Controller Block for the Bricked Blast Furnace") .addInfo("Usable for Steel and general Pyrometallurgy") .addInfo("Has a useful interface, unlike other gregtech multis") - .addPollutionAmount(20 * GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnace) + .addPollutionAmount(GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond) .addSeparator() .beginStructureBlock(3, 4, 3, true) .addController("Front center") diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java index 3089fc69e1..84d200d4f9 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java @@ -234,7 +234,7 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), - 20*GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnace); + GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond); } aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine)); -- cgit From 245c1b3e8c2107d0e82355ee7dfaad7b5c1736e1 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 01:46:05 +0100 Subject: changed the Combustion Generator to use epr second for more precision --- src/main/java/gregtech/GT_Mod.java | 2 +- src/main/java/gregtech/common/GT_Proxy.java | 2 +- .../machines/multi/GT_MetaTileEntity_DieselEngine.java | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index f345e1f835..33047d2f93 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -389,7 +389,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond = tMainConfig.get("Pollution", "PollutionPrimitiveBlastFurnace", gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond).getInt(gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond); gregtechproxy.mPollutionCharcoalPit = tMainConfig.get("Pollution", "PollutionCharcoalPit", gregtechproxy.mPollutionCharcoalPit).getInt(gregtechproxy.mPollutionCharcoalPit); gregtechproxy.mPollutionEBF = tMainConfig.get("Pollution", "PollutionEBF", gregtechproxy.mPollutionEBF).getInt(gregtechproxy.mPollutionEBF); - gregtechproxy.mPollutionLargeCombustionEngine = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",gregtechproxy.mPollutionLargeCombustionEngine).getInt(gregtechproxy.mPollutionLargeCombustionEngine); + gregtechproxy.mPollutionLargeCombustionEnginePerSecond = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",gregtechproxy.mPollutionLargeCombustionEnginePerSecond).getInt(gregtechproxy.mPollutionLargeCombustionEnginePerSecond); gregtechproxy.mPollutionExtremeCombustionEngine = tMainConfig.get("Pollution", "PollutionExtremeCombustionEngine",gregtechproxy.mPollutionExtremeCombustionEngine).getInt(gregtechproxy.mPollutionExtremeCombustionEngine); gregtechproxy.mPollutionImplosionCompressorPerSecond = tMainConfig.get("Pollution", "PollutionImplosionCompressor", gregtechproxy.mPollutionImplosionCompressorPerSecond).getInt(gregtechproxy.mPollutionImplosionCompressorPerSecond); gregtechproxy.mPollutionLargeBronzeBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeBronzeBoiler", gregtechproxy.mPollutionLargeBronzeBoilerPerSecond).getInt(gregtechproxy.mPollutionLargeBronzeBoilerPerSecond); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index c4091728b2..52129098cb 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -192,7 +192,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionPrimitveBlastFurnacePerSecond = 200; public int mPollutionEBF = 20; public int mPollutionCharcoalPit = 5; - public int mPollutionLargeCombustionEngine = 24; + public int mPollutionLargeCombustionEnginePerSecond = 480; public int mPollutionExtremeCombustionEngine = 192; public int mPollutionImplosionCompressorPerSecond = 10000; public int mPollutionLargeBronzeBoilerPerSecond = 1000; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index 8fce561034..fbe547f4f9 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -79,7 +79,7 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu .addInfo("Default: Produces 2048EU/t at 100% fuel efficiency") .addInfo("Boosted: Produces 6144EU/t at 150% fuel efficiency") .addInfo("You need to wait for it to reach 300% to output full power") - .addPollutionAmount(20 * getPollutionPerTick(null)) + .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(3, 3, 4, false) .addController("Front center") @@ -264,9 +264,14 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu return boostEu ? 30000 : 10000; } + @Override + public int getPollutionPerSecond(ItemStack aStack) { + return GT_Mod.gregtechproxy.mPollutionLargeCombustionEnginePerSecond; + } + @Override public int getPollutionPerTick(ItemStack aStack) { - return GT_Mod.gregtechproxy.mPollutionLargeCombustionEngine; + return getPollutionPerSecond(aStack)/20; } @Override -- cgit From 91e6127a4bcceabf9edb8dbaad916228953d85ca Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 01:48:20 +0100 Subject: changed the Extreme Combustion Generator to use per second for more precision --- src/main/java/gregtech/GT_Mod.java | 2 +- src/main/java/gregtech/common/GT_Proxy.java | 2 +- .../machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 33047d2f93..e9de80428f 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -390,7 +390,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionCharcoalPit = tMainConfig.get("Pollution", "PollutionCharcoalPit", gregtechproxy.mPollutionCharcoalPit).getInt(gregtechproxy.mPollutionCharcoalPit); gregtechproxy.mPollutionEBF = tMainConfig.get("Pollution", "PollutionEBF", gregtechproxy.mPollutionEBF).getInt(gregtechproxy.mPollutionEBF); gregtechproxy.mPollutionLargeCombustionEnginePerSecond = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",gregtechproxy.mPollutionLargeCombustionEnginePerSecond).getInt(gregtechproxy.mPollutionLargeCombustionEnginePerSecond); - gregtechproxy.mPollutionExtremeCombustionEngine = tMainConfig.get("Pollution", "PollutionExtremeCombustionEngine",gregtechproxy.mPollutionExtremeCombustionEngine).getInt(gregtechproxy.mPollutionExtremeCombustionEngine); + gregtechproxy.mPollutionExtremeCombustionEnginePerSecond = tMainConfig.get("Pollution", "PollutionExtremeCombustionEngine",gregtechproxy.mPollutionExtremeCombustionEnginePerSecond).getInt(gregtechproxy.mPollutionExtremeCombustionEnginePerSecond); gregtechproxy.mPollutionImplosionCompressorPerSecond = tMainConfig.get("Pollution", "PollutionImplosionCompressor", gregtechproxy.mPollutionImplosionCompressorPerSecond).getInt(gregtechproxy.mPollutionImplosionCompressorPerSecond); gregtechproxy.mPollutionLargeBronzeBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeBronzeBoiler", gregtechproxy.mPollutionLargeBronzeBoilerPerSecond).getInt(gregtechproxy.mPollutionLargeBronzeBoilerPerSecond); gregtechproxy.mPollutionLargeSteelBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeSteelBoiler", gregtechproxy.mPollutionLargeSteelBoilerPerSecond).getInt(gregtechproxy.mPollutionLargeSteelBoilerPerSecond); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 52129098cb..7e77a22703 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -193,7 +193,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionEBF = 20; public int mPollutionCharcoalPit = 5; public int mPollutionLargeCombustionEnginePerSecond = 480; - public int mPollutionExtremeCombustionEngine = 192; + public int mPollutionExtremeCombustionEnginePerSecond = 192; public int mPollutionImplosionCompressorPerSecond = 10000; public int mPollutionLargeBronzeBoilerPerSecond = 1000; public int mPollutionLargeSteelBoilerPerSecond = 2000; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index b1028f5bcd..b96391e7ec 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -45,7 +45,7 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die .addInfo("Default: Produces 8192EU/t at 100% fuel efficiency") .addInfo("Boosted: Produces 32768EU/t at 400% fuel efficiency") .addInfo("You need to wait for it to reach 400% to output full power") - .addPollutionAmount(20 * getPollutionPerTick(null)) + .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(3, 3, 4, false) .addController("Front center") @@ -159,8 +159,13 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die } @Override - public int getPollutionPerTick(ItemStack aStack) { - return GT_Mod.gregtechproxy.mPollutionExtremeCombustionEngine; + public int getPollutionPerSecond(ItemStack aStack) { + return GT_Mod.gregtechproxy.mPollutionExtremeCombustionEnginePerSecond; + } + + @Override + public int getPollutionPerTick(ItemStack aStack){ + return getPollutionPerSecond(aStack)/20; } @Override -- cgit From ef7017fdb7db218971492a3cc250b3f56eb3f576 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 01:49:18 +0100 Subject: forgot to convert tick value into second --- src/main/java/gregtech/common/GT_Proxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 7e77a22703..37ff52868f 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -193,7 +193,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionEBF = 20; public int mPollutionCharcoalPit = 5; public int mPollutionLargeCombustionEnginePerSecond = 480; - public int mPollutionExtremeCombustionEnginePerSecond = 192; + public int mPollutionExtremeCombustionEnginePerSecond = 3840; public int mPollutionImplosionCompressorPerSecond = 10000; public int mPollutionLargeBronzeBoilerPerSecond = 1000; public int mPollutionLargeSteelBoilerPerSecond = 2000; -- cgit From a02ad36015d395a34a3f5d5b3ee6fc8c7e494e34 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 01:52:47 +0100 Subject: changed the gas turbine to use per second for more precision --- src/main/java/gregtech/GT_Mod.java | 2 +- src/main/java/gregtech/common/GT_Proxy.java | 2 +- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index e9de80428f..9699b90238 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -397,7 +397,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeTitaniumBoiler", gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond ).getInt(gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond ); gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeTungstenSteelBoiler", gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond).getInt(gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond); gregtechproxy.mPollutionReleasedByThrottle = tMainConfig.get("Pollution", "PollutionReleasedByThrottle", gregtechproxy.mPollutionReleasedByThrottle).getDouble(gregtechproxy.mPollutionReleasedByThrottle); - gregtechproxy.mPollutionLargeGasTurbine = tMainConfig.get("Pollution", "PollutionLargeGasTurbine", gregtechproxy.mPollutionLargeGasTurbine).getInt( gregtechproxy.mPollutionLargeGasTurbine); + gregtechproxy.mPollutionLargeGasTurbinePerSecond = tMainConfig.get("Pollution", "PollutionLargeGasTurbine", gregtechproxy.mPollutionLargeGasTurbinePerSecond).getInt( gregtechproxy.mPollutionLargeGasTurbinePerSecond); gregtechproxy.mPollutionMultiSmelter = tMainConfig.get("Pollution", "PollutionMultiSmelter", gregtechproxy.mPollutionMultiSmelter).getInt(gregtechproxy.mPollutionMultiSmelter); gregtechproxy.mPollutionPyrolyseOven = tMainConfig.get("Pollution", "PollutionPyrolyseOven", gregtechproxy.mPollutionPyrolyseOven).getInt(gregtechproxy.mPollutionPyrolyseOven); gregtechproxy.mPollutionSmallCoalBoiler = tMainConfig.get("Pollution", "PollutionSmallCoalBoiler", gregtechproxy.mPollutionSmallCoalBoiler).getInt(gregtechproxy.mPollutionSmallCoalBoiler); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 37ff52868f..26fac9f2e6 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -200,7 +200,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionLargeTitaniumBoilerPerSecond = 3000; public int mPollutionLargeTungstenSteelBoilerPerSecond = 4000; public double mPollutionReleasedByThrottle = 1.0/24.0; // divided by 24 because 24 circuit conf - public int mPollutionLargeGasTurbine = 15; + public int mPollutionLargeGasTurbinePerSecond = 300; public int mPollutionMultiSmelter = 20; public int mPollutionPyrolyseOven = 30; public int mPollutionSmallCoalBoiler = 1; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index 696abf19d4..6b58f8a44d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -42,7 +42,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT tt.addMachineType("Gas Turbine") .addInfo("Controller block for the Large Gas Turbine") .addInfo("Needs a Turbine, place inside controller") - .addPollutionAmount(20 * getPollutionPerTick(null)) + .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(3, 3, 4, true) .addController("Front center") @@ -83,8 +83,13 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT } @Override - public int getPollutionPerTick(ItemStack aStack) { - return GT_Mod.gregtechproxy.mPollutionLargeGasTurbine; + public int getPollutionPerSecond(ItemStack aStack) { + return GT_Mod.gregtechproxy.mPollutionLargeGasTurbinePerSecond; + } + + @Override + public int getPollutionPerTick(ItemStack aStack){ + return getPollutionPerSecond(aStack)/20; } @Override -- cgit From eb9ff33839299923ced6373dece17e338cddccdd Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 01:55:05 +0100 Subject: changed multismelter to use per second for more precision --- src/main/java/gregtech/GT_Mod.java | 2 +- src/main/java/gregtech/common/GT_Proxy.java | 2 +- .../machines/multi/GT_MetaTileEntity_MultiFurnace.java | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 9699b90238..74c9e6203c 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -398,7 +398,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond = tMainConfig.get("Pollution", "PollutionLargeTungstenSteelBoiler", gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond).getInt(gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond); gregtechproxy.mPollutionReleasedByThrottle = tMainConfig.get("Pollution", "PollutionReleasedByThrottle", gregtechproxy.mPollutionReleasedByThrottle).getDouble(gregtechproxy.mPollutionReleasedByThrottle); gregtechproxy.mPollutionLargeGasTurbinePerSecond = tMainConfig.get("Pollution", "PollutionLargeGasTurbine", gregtechproxy.mPollutionLargeGasTurbinePerSecond).getInt( gregtechproxy.mPollutionLargeGasTurbinePerSecond); - gregtechproxy.mPollutionMultiSmelter = tMainConfig.get("Pollution", "PollutionMultiSmelter", gregtechproxy.mPollutionMultiSmelter).getInt(gregtechproxy.mPollutionMultiSmelter); + gregtechproxy.mPollutionMultiSmelterPerSecond = tMainConfig.get("Pollution", "PollutionMultiSmelter", gregtechproxy.mPollutionMultiSmelterPerSecond).getInt(gregtechproxy.mPollutionMultiSmelterPerSecond); gregtechproxy.mPollutionPyrolyseOven = tMainConfig.get("Pollution", "PollutionPyrolyseOven", gregtechproxy.mPollutionPyrolyseOven).getInt(gregtechproxy.mPollutionPyrolyseOven); gregtechproxy.mPollutionSmallCoalBoiler = tMainConfig.get("Pollution", "PollutionSmallCoalBoiler", gregtechproxy.mPollutionSmallCoalBoiler).getInt(gregtechproxy.mPollutionSmallCoalBoiler); gregtechproxy.mPollutionHighPressureLavaBoiler = tMainConfig.get("Pollution", "PollutionHighPressureLavaBoiler", gregtechproxy.mPollutionHighPressureLavaBoiler).getInt(gregtechproxy.mPollutionHighPressureLavaBoiler); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 26fac9f2e6..fe8971eaa0 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -201,7 +201,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionLargeTungstenSteelBoilerPerSecond = 4000; public double mPollutionReleasedByThrottle = 1.0/24.0; // divided by 24 because 24 circuit conf public int mPollutionLargeGasTurbinePerSecond = 300; - public int mPollutionMultiSmelter = 20; + public int mPollutionMultiSmelterPerSecond = 400; public int mPollutionPyrolyseOven = 30; public int mPollutionSmallCoalBoiler = 1; public int mPollutionHighPressureLavaBoiler = 1; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index d93c6dfa65..ca334e5bd6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -75,7 +75,7 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu .addInfo("Controller Block for the Multi Smelter") .addInfo("Smelts up to 8-128 items at once") .addInfo("Items smelted increases with coil tier") - .addPollutionAmount(20 * getPollutionPerTick(null)) + .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(3, 3, 3, true) .addController("Front bottom") @@ -113,9 +113,14 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu return GT_Recipe.GT_Recipe_Map.sFurnaceRecipes; } + @Override + public int getPollutionPerSecond(ItemStack aStack){ + return GT_Mod.gregtechproxy.mPollutionMultiSmelterPerSecond; + } + @Override public int getPollutionPerTick(ItemStack aStack){ - return GT_Mod.gregtechproxy.mPollutionMultiSmelter; + return getPollutionPerSecond(aStack)/20; } @Override -- cgit From 42f146187eb2443332167e5efe5578daf95a69f9 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 01:57:20 +0100 Subject: changed pyrolyse oven to use per second for more precision --- src/main/java/gregtech/GT_Mod.java | 2 +- src/main/java/gregtech/common/GT_Proxy.java | 2 +- .../machines/multi/GT_MetaTileEntity_PyrolyseOven.java | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 74c9e6203c..9d5ff5cfb1 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -399,7 +399,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionReleasedByThrottle = tMainConfig.get("Pollution", "PollutionReleasedByThrottle", gregtechproxy.mPollutionReleasedByThrottle).getDouble(gregtechproxy.mPollutionReleasedByThrottle); gregtechproxy.mPollutionLargeGasTurbinePerSecond = tMainConfig.get("Pollution", "PollutionLargeGasTurbine", gregtechproxy.mPollutionLargeGasTurbinePerSecond).getInt( gregtechproxy.mPollutionLargeGasTurbinePerSecond); gregtechproxy.mPollutionMultiSmelterPerSecond = tMainConfig.get("Pollution", "PollutionMultiSmelter", gregtechproxy.mPollutionMultiSmelterPerSecond).getInt(gregtechproxy.mPollutionMultiSmelterPerSecond); - gregtechproxy.mPollutionPyrolyseOven = tMainConfig.get("Pollution", "PollutionPyrolyseOven", gregtechproxy.mPollutionPyrolyseOven).getInt(gregtechproxy.mPollutionPyrolyseOven); + gregtechproxy.mPollutionPyrolyseOvenPerSecond = tMainConfig.get("Pollution", "PollutionPyrolyseOven", gregtechproxy.mPollutionPyrolyseOvenPerSecond).getInt(gregtechproxy.mPollutionPyrolyseOvenPerSecond); gregtechproxy.mPollutionSmallCoalBoiler = tMainConfig.get("Pollution", "PollutionSmallCoalBoiler", gregtechproxy.mPollutionSmallCoalBoiler).getInt(gregtechproxy.mPollutionSmallCoalBoiler); gregtechproxy.mPollutionHighPressureLavaBoiler = tMainConfig.get("Pollution", "PollutionHighPressureLavaBoiler", gregtechproxy.mPollutionHighPressureLavaBoiler).getInt(gregtechproxy.mPollutionHighPressureLavaBoiler); gregtechproxy.mPollutionHighPressureCoalBoiler = tMainConfig.get("Pollution", "PollutionHighPressureCoalBoiler", gregtechproxy.mPollutionHighPressureCoalBoiler).getInt(gregtechproxy.mPollutionHighPressureCoalBoiler); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index fe8971eaa0..4dfc6da24d 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -202,7 +202,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public double mPollutionReleasedByThrottle = 1.0/24.0; // divided by 24 because 24 circuit conf public int mPollutionLargeGasTurbinePerSecond = 300; public int mPollutionMultiSmelterPerSecond = 400; - public int mPollutionPyrolyseOven = 30; + public int mPollutionPyrolyseOvenPerSecond = 300; public int mPollutionSmallCoalBoiler = 1; public int mPollutionHighPressureLavaBoiler = 1; public int mPollutionHighPressureCoalBoiler = 2; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index 6540d77582..d60f38fdc9 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -92,7 +92,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu .addInfo("Processing speed scales linearly with Coil tier:") .addInfo("CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.") .addInfo("EU/t is not affected by Coil tier") - .addPollutionAmount(20 * getPollutionPerTick(null)) + .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(5, 4, 5, true) .addController("Front center") @@ -226,8 +226,13 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu } @Override - public int getPollutionPerTick(ItemStack aStack) { - return GT_Mod.gregtechproxy.mPollutionPyrolyseOven; + public int getPollutionPerSecond(ItemStack aStack) { + return GT_Mod.gregtechproxy.mPollutionPyrolyseOvenPerSecond; + } + + @Override + public int getPollutionPerTick(ItemStack aStack){ + return getPollutionPerSecond(aStack)/20; } @Override -- cgit From e53a0edcbf35f130f7770a2084ea79e87a377d97 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 01:58:26 +0100 Subject: changed EBF to use per second for more precision --- src/main/java/gregtech/GT_Mod.java | 2 +- src/main/java/gregtech/common/GT_Proxy.java | 2 +- .../machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 9d5ff5cfb1..e0a0082565 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -388,7 +388,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mExplosionItemDrop = tMainConfig.get("general", "ExplosionItemDrops", gregtechproxy.mExplosionItemDrop).getBoolean(gregtechproxy.mExplosionItemDrop); gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond = tMainConfig.get("Pollution", "PollutionPrimitiveBlastFurnace", gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond).getInt(gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond); gregtechproxy.mPollutionCharcoalPit = tMainConfig.get("Pollution", "PollutionCharcoalPit", gregtechproxy.mPollutionCharcoalPit).getInt(gregtechproxy.mPollutionCharcoalPit); - gregtechproxy.mPollutionEBF = tMainConfig.get("Pollution", "PollutionEBF", gregtechproxy.mPollutionEBF).getInt(gregtechproxy.mPollutionEBF); + gregtechproxy.mPollutionEBFPerSecond = tMainConfig.get("Pollution", "PollutionEBF", gregtechproxy.mPollutionEBFPerSecond).getInt(gregtechproxy.mPollutionEBFPerSecond); gregtechproxy.mPollutionLargeCombustionEnginePerSecond = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",gregtechproxy.mPollutionLargeCombustionEnginePerSecond).getInt(gregtechproxy.mPollutionLargeCombustionEnginePerSecond); gregtechproxy.mPollutionExtremeCombustionEnginePerSecond = tMainConfig.get("Pollution", "PollutionExtremeCombustionEngine",gregtechproxy.mPollutionExtremeCombustionEnginePerSecond).getInt(gregtechproxy.mPollutionExtremeCombustionEnginePerSecond); gregtechproxy.mPollutionImplosionCompressorPerSecond = tMainConfig.get("Pollution", "PollutionImplosionCompressor", gregtechproxy.mPollutionImplosionCompressorPerSecond).getInt(gregtechproxy.mPollutionImplosionCompressorPerSecond); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 4dfc6da24d..a87aeaffb8 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -190,7 +190,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionSourRainLimit = 2000000; public int mPollutionOnExplosion = 100000; public int mPollutionPrimitveBlastFurnacePerSecond = 200; - public int mPollutionEBF = 20; + public int mPollutionEBFPerSecond = 400; public int mPollutionCharcoalPit = 5; public int mPollutionLargeCombustionEnginePerSecond = 480; public int mPollutionExtremeCombustionEnginePerSecond = 3840; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index 4df827b5bc..f975dd3abe 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -19,7 +19,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_StructureUtility; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -89,7 +88,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab .addInfo("Each 1800K over the min. Heat required allows for one upgraded overclock instead of normal") .addInfo("Upgraded overclocks reduce recipe time to 25% (instead of 50%) and increase EU/t to 400%") .addInfo("Additionally gives +100K for every tier past MV") - .addPollutionAmount(20 * getPollutionPerTick(null)) + .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(3, 4, 3, true) .addController("Front bottom") @@ -129,9 +128,14 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); } + @Override + public int getPollutionPerSecond(ItemStack aStack){ + return GT_Mod.gregtechproxy.mPollutionEBFPerSecond; + } + @Override public int getPollutionPerTick(ItemStack aStack){ - return GT_Mod.gregtechproxy.mPollutionEBF; + return getPollutionPerSecond(aStack)/20; } @Override -- cgit From 448d418411560f209f56a2ed778058e06d56c3fd Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 02:00:29 +0100 Subject: changed the charcoal pit to use per second for more precision --- src/main/java/gregtech/GT_Mod.java | 2 +- src/main/java/gregtech/common/GT_Proxy.java | 2 +- .../machines/multi/GT_MetaTileEntity_Charcoal_Pit.java | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index e0a0082565..c20440eb3e 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -387,7 +387,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionOnExplosion = tMainConfig.get("Pollution", "SourRainLimit", gregtechproxy.mPollutionOnExplosion).getInt(gregtechproxy.mPollutionOnExplosion); gregtechproxy.mExplosionItemDrop = tMainConfig.get("general", "ExplosionItemDrops", gregtechproxy.mExplosionItemDrop).getBoolean(gregtechproxy.mExplosionItemDrop); gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond = tMainConfig.get("Pollution", "PollutionPrimitiveBlastFurnace", gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond).getInt(gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond); - gregtechproxy.mPollutionCharcoalPit = tMainConfig.get("Pollution", "PollutionCharcoalPit", gregtechproxy.mPollutionCharcoalPit).getInt(gregtechproxy.mPollutionCharcoalPit); + gregtechproxy.mPollutionCharcoalPitPerSecond = tMainConfig.get("Pollution", "PollutionCharcoalPit", gregtechproxy.mPollutionCharcoalPitPerSecond).getInt(gregtechproxy.mPollutionCharcoalPitPerSecond); gregtechproxy.mPollutionEBFPerSecond = tMainConfig.get("Pollution", "PollutionEBF", gregtechproxy.mPollutionEBFPerSecond).getInt(gregtechproxy.mPollutionEBFPerSecond); gregtechproxy.mPollutionLargeCombustionEnginePerSecond = tMainConfig.get("Pollution", "PollutionLargeCombustionEngine",gregtechproxy.mPollutionLargeCombustionEnginePerSecond).getInt(gregtechproxy.mPollutionLargeCombustionEnginePerSecond); gregtechproxy.mPollutionExtremeCombustionEnginePerSecond = tMainConfig.get("Pollution", "PollutionExtremeCombustionEngine",gregtechproxy.mPollutionExtremeCombustionEnginePerSecond).getInt(gregtechproxy.mPollutionExtremeCombustionEnginePerSecond); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index a87aeaffb8..ec60cabee1 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -191,7 +191,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionOnExplosion = 100000; public int mPollutionPrimitveBlastFurnacePerSecond = 200; public int mPollutionEBFPerSecond = 400; - public int mPollutionCharcoalPit = 5; + public int mPollutionCharcoalPitPerSecond = 100; public int mPollutionLargeCombustionEnginePerSecond = 480; public int mPollutionExtremeCombustionEnginePerSecond = 3840; public int mPollutionImplosionCompressorPerSecond = 10000; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index 9fbcccbeda..ef31a072ed 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -202,8 +202,13 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } @Override - public int getPollutionPerTick(ItemStack aStack) { - return GT_Mod.gregtechproxy.mPollutionCharcoalPit; + public int getPollutionPerSecond(ItemStack aStack) { + return GT_Mod.gregtechproxy.mPollutionCharcoalPitPerSecond; + } + + @Override + public int getPollutionPerTick(ItemStack aStack){ + return getPollutionPerSecond(aStack)/20; } @Override @@ -233,7 +238,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock .addInfo("Controller for the Charcoal Pit") .addInfo("Converts Logs into Brittle Charcoal blocks") .addInfo("Will automatically start when valid") - .addPollutionAmount(20*getPollutionPerTick(null)) + .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginVariableStructureBlock(3, 11, 3, 6, 3, 11, false) .addStructureInfo("Can be up to 11x6x11 in size, shape doesn't matter") -- cgit From 678e4e6ea3939672cc5330f109512ce45be88616 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 02:05:49 +0100 Subject: changed single block boilers to use per second for more precision --- src/main/java/gregtech/GT_Mod.java | 6 +++--- src/main/java/gregtech/common/GT_Proxy.java | 6 +++--- .../common/tileentities/boilers/GT_MetaTileEntity_Boiler.java | 2 +- .../tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java | 6 +++--- .../common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java | 4 ++-- .../common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index c20440eb3e..b6d6c41a1f 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -400,9 +400,9 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionLargeGasTurbinePerSecond = tMainConfig.get("Pollution", "PollutionLargeGasTurbine", gregtechproxy.mPollutionLargeGasTurbinePerSecond).getInt( gregtechproxy.mPollutionLargeGasTurbinePerSecond); gregtechproxy.mPollutionMultiSmelterPerSecond = tMainConfig.get("Pollution", "PollutionMultiSmelter", gregtechproxy.mPollutionMultiSmelterPerSecond).getInt(gregtechproxy.mPollutionMultiSmelterPerSecond); gregtechproxy.mPollutionPyrolyseOvenPerSecond = tMainConfig.get("Pollution", "PollutionPyrolyseOven", gregtechproxy.mPollutionPyrolyseOvenPerSecond).getInt(gregtechproxy.mPollutionPyrolyseOvenPerSecond); - gregtechproxy.mPollutionSmallCoalBoiler = tMainConfig.get("Pollution", "PollutionSmallCoalBoiler", gregtechproxy.mPollutionSmallCoalBoiler).getInt(gregtechproxy.mPollutionSmallCoalBoiler); - gregtechproxy.mPollutionHighPressureLavaBoiler = tMainConfig.get("Pollution", "PollutionHighPressureLavaBoiler", gregtechproxy.mPollutionHighPressureLavaBoiler).getInt(gregtechproxy.mPollutionHighPressureLavaBoiler); - gregtechproxy.mPollutionHighPressureCoalBoiler = tMainConfig.get("Pollution", "PollutionHighPressureCoalBoiler", gregtechproxy.mPollutionHighPressureCoalBoiler).getInt(gregtechproxy.mPollutionHighPressureCoalBoiler); + gregtechproxy.mPollutionSmallCoalBoilerPerSecond = tMainConfig.get("Pollution", "PollutionSmallCoalBoiler", gregtechproxy.mPollutionSmallCoalBoilerPerSecond).getInt(gregtechproxy.mPollutionSmallCoalBoilerPerSecond); + gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond = tMainConfig.get("Pollution", "PollutionHighPressureLavaBoiler", gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond).getInt(gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond); + gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond = tMainConfig.get("Pollution", "PollutionHighPressureCoalBoiler", gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond).getInt(gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond); gregtechproxy.mPollutionBaseDieselGenerator = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator",gregtechproxy.mPollutionBaseDieselGenerator).getInt(gregtechproxy.mPollutionBaseDieselGenerator); gregtechproxy.mPollutionBaseGasTurbine = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator", gregtechproxy.mPollutionBaseGasTurbine).getInt(gregtechproxy.mPollutionBaseGasTurbine); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index ec60cabee1..e553800b42 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -203,9 +203,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionLargeGasTurbinePerSecond = 300; public int mPollutionMultiSmelterPerSecond = 400; public int mPollutionPyrolyseOvenPerSecond = 300; - public int mPollutionSmallCoalBoiler = 1; - public int mPollutionHighPressureLavaBoiler = 1; - public int mPollutionHighPressureCoalBoiler = 2; + public int mPollutionSmallCoalBoilerPerSecond = 20; + public int mPollutionHighPressureLavaBoilerPerSecond = 20; + public int mPollutionHighPressureCoalBoilerPerSecond = 30; public int mPollutionBaseDieselGenerator = 2; public int mPollutionBaseGasTurbine = 1; public final GT_UO_DimensionList mUndergroundOil = new GT_UO_DimensionList(); diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java index 7f004b91f5..96b991e767 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java @@ -246,7 +246,7 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa private void pollute(long aTick) { if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { - GT_Pollution.addPollution(getBaseMetaTileEntity(), 20*getPollution()); + GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution()); } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index 737346b66d..3927241e79 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -31,7 +31,7 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { super(aID, aName, aNameRegional, new String[]{ "An early way to get Steam Power", "Produces 120L of Steam per second", - "Causes "+Integer.toString(GT_Mod.gregtechproxy.mPollutionSmallCoalBoiler*20)+" Pollution per second"}); + "Causes "+Integer.toString(GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond)+" Pollution per second"}); } public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional, String[] aDescription) { @@ -94,13 +94,13 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L) && this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { - GT_Pollution.addPollution(getBaseMetaTileEntity(), 20*getPollution()); + GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution()); } } @Override protected int getPollution() { - return GT_Mod.gregtechproxy.mPollutionSmallCoalBoiler; + return GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond; } @Override diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java index 791968cd5e..18010c0886 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java @@ -34,7 +34,7 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { super(aID, aName, aNameRegional, new String[]{ "A Boiler running off Lava", "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second", - "Causes " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoiler*20) + " Pollution per second", + "Causes " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond) + " Pollution per second", "Consumes " + ((double) CONSUMPTION_PER_HEATUP / ENERGY_PER_LAVA) + "L of Lava every " + COOLDOWN_INTERVAL + " ticks when fully heat up"}); } @@ -98,7 +98,7 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { @Override protected int getPollution() { - return GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoiler; + return GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond; } @Override diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java index 40b79e0c46..98546ff09e 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -25,7 +25,7 @@ public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bro super(aID, aName, aNameRegional, new String[]{ "Faster than the Bronze Boiler", "Produces 300L of Steam per second", - "Causes "+Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoiler*20)+" Pollution per second"}); + "Causes "+Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond)+" Pollution per second"}); } public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -82,7 +82,7 @@ public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bro @Override protected int getPollution() { - return GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoiler; + return GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond; } @Override -- cgit From 8439128255071ef89e71afb92fc46c7e31385e87 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 02:16:00 +0100 Subject: changed singleblock generators to use per second for more precision --- src/main/java/gregtech/GT_Mod.java | 5 +++-- src/main/java/gregtech/common/GT_Proxy.java | 6 ++++-- .../tileentities/generators/GT_MetaTileEntity_DieselGenerator.java | 4 ++-- .../tileentities/generators/GT_MetaTileEntity_GasTurbine.java | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index b6d6c41a1f..74a68dc748 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -403,8 +403,9 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionSmallCoalBoilerPerSecond = tMainConfig.get("Pollution", "PollutionSmallCoalBoiler", gregtechproxy.mPollutionSmallCoalBoilerPerSecond).getInt(gregtechproxy.mPollutionSmallCoalBoilerPerSecond); gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond = tMainConfig.get("Pollution", "PollutionHighPressureLavaBoiler", gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond).getInt(gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond); gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond = tMainConfig.get("Pollution", "PollutionHighPressureCoalBoiler", gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond).getInt(gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond); - gregtechproxy.mPollutionBaseDieselGenerator = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator",gregtechproxy.mPollutionBaseDieselGenerator).getInt(gregtechproxy.mPollutionBaseDieselGenerator); - gregtechproxy.mPollutionBaseGasTurbine = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator", gregtechproxy.mPollutionBaseGasTurbine).getInt(gregtechproxy.mPollutionBaseGasTurbine); + gregtechproxy.mPollutionBaseDieselGeneratorPerSecond = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator",gregtechproxy.mPollutionBaseDieselGeneratorPerSecond).getInt(gregtechproxy.mPollutionBaseDieselGeneratorPerSecond); + gregtechproxy.mPollutionDieselGeneratorReleasedByTier = tMainConfig.get("Pollution", "PollutionReleasedByTier", gregtechproxy.mPollutionDieselGeneratorReleasedByTier).getDoubleList(); + gregtechproxy.mPollutionBaseGasTurbinePerSecond = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator", gregtechproxy.mPollutionBaseGasTurbinePerSecond).getInt(gregtechproxy.mPollutionBaseGasTurbinePerSecond); gregtechproxy.mUndergroundOil.getConfig(tMainConfig, "undergroundfluid"); gregtechproxy.mEnableCleanroom = tMainConfig.get("general", "EnableCleanroom", true).getBoolean(true); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index e553800b42..569e06643a 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -206,8 +206,10 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionSmallCoalBoilerPerSecond = 20; public int mPollutionHighPressureLavaBoilerPerSecond = 20; public int mPollutionHighPressureCoalBoilerPerSecond = 30; - public int mPollutionBaseDieselGenerator = 2; - public int mPollutionBaseGasTurbine = 1; + public int mPollutionBaseDieselGeneratorPerSecond = 200; + public double[] mPollutionDieselGeneratorReleasedByTier = new double[]{0.1, 1.0, 0.9, 0.8}; + public int mPollutionBaseGasTurbinePerSecond = 200; + public double[] mPollutionGasTurbineReleasedByTier = new double[]{0.1, 1.0, 0.9, 0.8}; public final GT_UO_DimensionList mUndergroundOil = new GT_UO_DimensionList(); public int mTicksUntilNextCraftSound = 0; public double mMagneticraftBonusOutputPercent = 100.0d; diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index 19b537821f..f025ed34ec 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -27,7 +27,7 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, new String[]{ "Requires liquid Fuel", - "Causes " + (int) (20 * GT_Mod.gregtechproxy.mPollutionBaseDieselGenerator * Math.pow(2, aTier - 1)) + " Pollution per second"}); + "Causes " + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[aTier]) + " Pollution per second"}); onConfigLoad(); } @@ -166,6 +166,6 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe @Override public int getPollution() { - return (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGenerator * Math.pow(2, mTier - 1)); + return (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[mTier]); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index 6a3c17e893..a0f6aeee64 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -20,7 +20,7 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, new String[]{ "Requires flammable Gasses", - "Causes " + (int) (20 * GT_Mod.gregtechproxy.mPollutionBaseGasTurbine * Math.pow(2, aTier - 1)) + " Pollution per second"}); + "Causes " + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) + " Pollution per second"}); onConfigLoad(); } @@ -138,6 +138,6 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat @Override public int getPollution() { - return (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbine * Math.pow(2, mTier - 1)); + return (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[mTier]); } } -- cgit From a174c85a2585dc80f0d50c6d3e909e59fb451681 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 02:29:28 +0100 Subject: adapt base generator class to produce correct amount of pollution per sec --- .../implementations/GT_MetaTileEntity_BasicGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java index bb7b795c36..b9612e1769 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java @@ -214,7 +214,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); //long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);//TODO CHECK if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) { - GT_Pollution.addPollution(getBaseMetaTileEntity(),10 * getPollution()); + GT_Pollution.addPollution(getBaseMetaTileEntity(),getPollution()/2); mFluid.amount -= tFluidAmountToUse * tConsumed; } } @@ -229,7 +229,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) { aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); - GT_Pollution.addPollution(getBaseMetaTileEntity(),10 * getPollution()); + GT_Pollution.addPollution(getBaseMetaTileEntity(),getPollution()/2); } } } -- cgit From 38d2c580503b34dd41f326c17e89257860a13849 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 14:53:21 +0100 Subject: rework large boilers for more clarity --- .../machines/multi/GT_MetaTileEntity_LargeBoiler.java | 12 ++++++++++++ .../multi/GT_MetaTileEntity_LargeBoiler_Bronze.java | 14 +++----------- .../multi/GT_MetaTileEntity_LargeBoiler_Steel.java | 13 ++----------- .../multi/GT_MetaTileEntity_LargeBoiler_Titanium.java | 13 ++----------- .../multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java | 13 ++----------- 5 files changed, 21 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index a73fb68962..c46d732935 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -73,6 +73,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En private int excessProjectedEU = 0; //Eliminate rounding errors from throttling the boiler private int mCasingAmount; private int mFireboxAmount; + protected int pollutionPerSecond = 1; //placeholder for the child classes public GT_MetaTileEntity_LargeBoiler(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -136,6 +137,17 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En return integratedCircuitConfig; } + @Override + public int getPollutionPerSecond(ItemStack aStack) { + //allows for 0 pollution if circuit throttle is too high + return Math.max(0, (int) (pollutionPerSecond * (1-GT_Mod.gregtechproxy.mPollutionReleasedByThrottle*getIntegratedCircuitConfig()))); + } + + @Override + public int getPollutionPerTick(ItemStack aStack){ + return getPollutionPerSecond(aStack)/20; + } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java index 1e89258ae4..fda98a431f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java @@ -8,12 +8,15 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_LargeBoiler { + public GT_MetaTileEntity_LargeBoiler_Bronze(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); + pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond; } public GT_MetaTileEntity_LargeBoiler_Bronze(String aName) { super(aName); + pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond; } @Override @@ -21,17 +24,6 @@ public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_Larg return new GT_MetaTileEntity_LargeBoiler_Bronze(this.mName); } - @Override - public int getPollutionPerSecond(ItemStack aStack) { - int integratedCircuitConfig = getIntegratedCircuitConfig(); - return Math.max(1, (int) (GT_Mod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond/(GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * integratedCircuitConfig))); - } - - @Override - public int getPollutionPerTick(ItemStack aStack){ - return getPollutionPerSecond(aStack)/20; - } - @Override public String getCasingMaterial(){ return "Bronze"; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java index 4c08b1fff1..583f26082c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java @@ -10,10 +10,12 @@ import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); + pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond; } public GT_MetaTileEntity_LargeBoiler_Steel(String aName) { super(aName); + pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond; } @Override @@ -21,17 +23,6 @@ public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_Large return new GT_MetaTileEntity_LargeBoiler_Steel(this.mName); } - @Override - public int getPollutionPerSecond(ItemStack aStack) { - int integratedCircuitConfig = getIntegratedCircuitConfig(); - return Math.max(1, (int) (GT_Mod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond/(GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * integratedCircuitConfig))); - } - - @Override - public int getPollutionPerTick(ItemStack aStack){ - return getPollutionPerSecond(aStack)/20; - } - @Override public String getCasingMaterial(){ return "Steel"; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java index 3a2566c82e..01f59d1f99 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java @@ -10,10 +10,12 @@ import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); + pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond; } public GT_MetaTileEntity_LargeBoiler_Titanium(String aName) { super(aName); + pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond; } @Override @@ -21,17 +23,6 @@ public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_La return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName); } - @Override - public int getPollutionPerSecond(ItemStack aStack) { - int integratedCircuitConfig = getIntegratedCircuitConfig(); - return Math.max(1, (int) (GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond/(GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * integratedCircuitConfig))); - } - - @Override - public int getPollutionPerTick(ItemStack aStack){ - return getPollutionPerSecond(aStack)/20; - } - @Override public String getCasingMaterial(){ return "Titanium"; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java index 4a1fa4d931..b14ce3e5f0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java @@ -10,10 +10,12 @@ import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEntity_LargeBoiler { public GT_MetaTileEntity_LargeBoiler_TungstenSteel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); + pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond; } public GT_MetaTileEntity_LargeBoiler_TungstenSteel(String aName) { super(aName); + pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond; } @Override @@ -21,17 +23,6 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEnti return new GT_MetaTileEntity_LargeBoiler_TungstenSteel(this.mName); } - @Override - public int getPollutionPerSecond(ItemStack aStack) { - int integratedCircuitConfig = getIntegratedCircuitConfig(); - return Math.max(1, (int) (GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond/(GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * integratedCircuitConfig))); - } - - @Override - public int getPollutionPerTick(ItemStack aStack){ - return getPollutionPerSecond(aStack)/20; - } - @Override public String getCasingMaterial(){ return "TungstenSteel"; -- cgit From 00b682a49b7f60986630710dff410ece5eeb1a81 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Thu, 25 Nov 2021 14:56:31 +0100 Subject: explain why it's divided by 2 --- .../implementations/GT_MetaTileEntity_BasicGenerator.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java index b9612e1769..ff8615e4c5 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java @@ -214,6 +214,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); //long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);//TODO CHECK if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) { + // divided by two because this is called every 10 ticks, not 20 GT_Pollution.addPollution(getBaseMetaTileEntity(),getPollution()/2); mFluid.amount -= tFluidAmountToUse * tConsumed; } @@ -229,6 +230,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) { aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); + // divided by two because this is called every 10 ticks, not 20 GT_Pollution.addPollution(getBaseMetaTileEntity(),getPollution()/2); } } -- cgit From 82f7eae1493e09c9f7a871c39f6d2e6a7ace5e89 Mon Sep 17 00:00:00 2001 From: repo_alt Date: Fri, 26 Nov 2021 14:33:38 +0300 Subject: fix GT_Recipe_Map_FormingPress for PA https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/8875 --- src/main/java/gregtech/api/util/GT_Recipe.java | 53 +++++++++++++++++--------- 1 file changed, 36 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index c0ea06af07..6e12a3d36c 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -1585,23 +1585,8 @@ public class GT_Recipe implements Comparable { GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs); if (aInputs == null || aInputs.length < 2 || aInputs[0] == null || aInputs[1] == null || !GregTech_API.sPostloadFinished) return rRecipe; - if (rRecipe == null) { - if (ItemList.Shape_Mold_Name.isStackEqual(aInputs[0], false, true)) { - ItemStack tOutput = GT_Utility.copyAmount(1, aInputs[1]); - tOutput.setStackDisplayName(aInputs[0].getDisplayName()); - rRecipe = new GT_Recipe(false, new ItemStack[]{ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, aInputs[1])}, new ItemStack[]{tOutput}, null, null, null, null, 128, 8, 0); - rRecipe.mCanBeBuffered = false; - return rRecipe; - } - if (ItemList.Shape_Mold_Name.isStackEqual(aInputs[1], false, true)) { - ItemStack tOutput = GT_Utility.copyAmount(1, aInputs[0]); - tOutput.setStackDisplayName(aInputs[1].getDisplayName()); - rRecipe = new GT_Recipe(false, new ItemStack[]{ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, aInputs[0])}, new ItemStack[]{tOutput}, null, null, null, null, 128, 8, 0); - rRecipe.mCanBeBuffered = false; - return rRecipe; - } - return null; - } + if (rRecipe == null) + return findRenamingRecipe(aInputs); for (ItemStack aMold : aInputs) { if (ItemList.Shape_Mold_Credit.isStackEqual(aMold, false, true)) { NBTTagCompound tNBT = aMold.getTagCompound(); @@ -1617,6 +1602,40 @@ public class GT_Recipe implements Comparable { } return rRecipe; } + + private ItemStack findNameMoldIndex(ItemStack[] inputs) { + for (ItemStack stack: inputs) { + if (ItemList.Shape_Mold_Name.isStackEqual(stack, false, true)) + return stack; + } + return null; + } + + private ItemStack findStackToRename(ItemStack[] inputs, ItemStack mold) { + for (ItemStack stack: inputs) { + if (stack == mold || stack == null) + continue; + return stack; + } + return null; + } + + private GT_Recipe findRenamingRecipe(ItemStack[] inputs) { + ItemStack mold = findNameMoldIndex(inputs); + if (mold == null) + return null; + ItemStack input = findStackToRename(inputs, mold); + if (input == null) + return null; + ItemStack output = GT_Utility.copyAmount(1, input); + output.setStackDisplayName(mold.getDisplayName()); + GT_Recipe recipe = new GT_Recipe(false, + new ItemStack[]{ ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, input) }, + new ItemStack[]{ output }, + null, null, null, null, 128, 8, 0); + recipe.mCanBeBuffered = false; + return recipe; + } } /** -- cgit From d56cb909f63dcefa9f8dce6e75ad1074ccc1e872 Mon Sep 17 00:00:00 2001 From: bombcar Date: Fri, 26 Nov 2021 08:37:08 -0600 Subject: allow generators to face down --- .../implementations/GT_MetaTileEntity_BasicGenerator.java | 2 +- .../api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java | 2 +- .../machines/basic/GT_MetaTileEntity_SeismicProspector.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java index bb7b795c36..fe8317be95 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java @@ -117,7 +117,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity @Override public boolean isFacingValid(byte aSide) { - return aSide > 1; + return true; } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java index 7b99d78009..552d3d6587 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java @@ -16,7 +16,7 @@ import net.minecraftforge.fluids.FluidTankInfo; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! - *

+ * * This is the main construct for my generic Tanks. Filling and emptying behavior have to be implemented manually */ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_TieredMachineBlock implements IHasFluidDisplayItem { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java index 42c8db6722..b6ff782cfb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -95,7 +95,7 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic }else if(aStack.getItem() == Ic2Items.dynamite.getItem()){ aStack.stackSize -= 4; }else if(aStack.getItem() == ItemList.Block_Powderbarrel.getItem() && aStack.getItemDamage()==ItemList.Block_Powderbarrel.get(1).getItemDamage()){ - aStack.stackSize -=8; + aStack.stackSize -= 8; }else{ aStack.stackSize -= 1; } -- cgit From 9090fc1ecc4890f8f2837447b2e0a781fb754f14 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Fri, 26 Nov 2021 23:05:38 +0800 Subject: Reduce innate outbound loss by one tier This will make LV power networks less annoying to build Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 9176d063ce..2d8dd5c910 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -481,7 +481,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (mMetaTileEntity.isEnetOutput() && oOutput > 0) { - long tOutputVoltage = Math.max(oOutput, oOutput + (1 << GT_Utility.getTier(oOutput))), tUsableAmperage = Math.min(getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); + long tOutputVoltage = Math.max(oOutput, oOutput + (1L << Math.max(0, GT_Utility.getTier(oOutput) - 1))), + tUsableAmperage = Math.min(getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); if (tUsableAmperage > 0) { long tEU = tOutputVoltage * IEnergyConnected.Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this); mAverageEUOutput[mAverageEUOutputIndex] += tEU; -- cgit From aa7cdfacf76c51f688b7e55391e9aa89e669a319 Mon Sep 17 00:00:00 2001 From: bombcar Date: Fri, 26 Nov 2021 09:59:51 -0600 Subject: add code to only output 512 (HV) for creepy egg --- .../generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index 5516b355fd..0bb96de85c 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -72,6 +72,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B private static int sEnergyPerEssentia = 320; private static final Map sAspectsEnergy = new HashMap<>(); private static int sDragonEggEnergyPerTick = 2048; + private static int sCreeperEggEnergyPerTick = 512; private int mEfficiency; private int mMaxVisPerDrain; private final MagicalEnergyBB mMagicalEnergyBB = new MagicalEnergyBB(this, mTier, mTier + 2); @@ -96,6 +97,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B private static void sharedConfigLoad(GT_Config aConfig) { sAllowMultipleEggs = aConfig.get(machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false); sDragonEggEnergyPerTick = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerTick.DragonEgg", 2048); + sCreeperEggEnergyPerTick = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerTick.DragonEgg", 512); sEnergyPerEndercrystal = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 512); if (THAUMCRAFT_LOADED) { sEnergyFromVis = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerVis", 20); @@ -422,7 +424,13 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B setActiveSiphon(this); } } - return sDragonEggEnergyPerTick; + Block egg = getBaseMetaTileEntity().getBlockOffset(0, 1, 0); + if (egg == Blocks.dragon_egg) { + return sDragonEggEnergyPerTick; + } else if (egg.getUnlocalizedName().contains("creeperEgg")) { + return sCreeperEggEnergyPerTick; + } + return 0; } private long absorbFromEnderCrystals() { -- cgit From 9a642e79edcc8de4c10965cb2c28dafeb63e176c Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 26 Nov 2021 16:03:05 +0000 Subject: Update GT_MetaTileEntity_MagicalEnergyAbsorber.java Fix config option. --- .../generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index 0bb96de85c..04dcdbe6b1 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -97,7 +97,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B private static void sharedConfigLoad(GT_Config aConfig) { sAllowMultipleEggs = aConfig.get(machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false); sDragonEggEnergyPerTick = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerTick.DragonEgg", 2048); - sCreeperEggEnergyPerTick = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerTick.DragonEgg", 512); + sCreeperEggEnergyPerTick = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerTick.CreeperEgg", 512); sEnergyPerEndercrystal = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 512); if (THAUMCRAFT_LOADED) { sEnergyFromVis = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerVis", 20); -- cgit From 9d432a42b6b7e502f8593b437fb2c110f5de8082 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 28 Nov 2021 21:52:26 +0800 Subject: Fix pollution ticking and reading Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- .../gregtech/api/util/GT_ChunkAssociatedData.java | 2 +- src/main/java/gregtech/common/GT_Pollution.java | 73 ++++++++++++++-------- 2 files changed, 48 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java b/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java index bd9148b516..aa779b0359 100644 --- a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java +++ b/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java @@ -296,7 +296,7 @@ public abstract class GT_ChunkAssociatedData pollutionList = new ArrayList<>();//chunks left to process - private final List chunkData = new ArrayList<>();//link to chunk data that is saved/loaded + private List pollutionList = new ArrayList<>();//chunks left to process in this cycle + private final Set pollutedChunks = new HashSet<>();// a global list of all chunks with positive pollution private int operationsPerTick = 0;//how much chunks should be processed in each cycle private static final short cycleLen = 1200; private final World world; + private boolean blank = true; public static int mPlayerPollution; private static int POLLUTIONPACKET_MINVALUE = 1000; @@ -103,16 +108,18 @@ public class GT_Pollution { private void tickPollutionInWorld(int aTickID) {//called from method above //gen data set - if (aTickID == 0) { + if (aTickID == 0 || blank) { // make a snapshot of what to work on - // counterintuitive as it seems, but this is the fastest way java collections framework offers us. - pollutionList = new ArrayList<>(chunkData); + pollutionList = new ArrayList<>(pollutedChunks); //set operations per tick - if (pollutionList.size() > 0) operationsPerTick = (pollutionList.size() / cycleLen); - else operationsPerTick = 0;//SANity + if (pollutionList.size() > 0) + operationsPerTick = Math.max(1, pollutionList.size() / cycleLen); + else + operationsPerTick = 0; //SANity + blank = false; } - for (int chunksProcessed = 0; chunksProcessed <= operationsPerTick; chunksProcessed++) { + for (int chunksProcessed = 0; chunksProcessed < operationsPerTick; chunksProcessed++) { if (pollutionList.size() == 0) break;//no more stuff to do ChunkCoordIntPair actualPos = pollutionList.remove(pollutionList.size() - 1);//faster //get pollution @@ -120,10 +127,8 @@ public class GT_Pollution { int tPollution = currentData.getAmount(); //remove some tPollution = (int) (0.9945f * tPollution); - //tPollution -= 2000;//This does not really matter... - if (tPollution <= 0) tPollution = 0;//SANity check - else if (tPollution > 400000) {//Spread Pollution + if (tPollution > 400000) {//Spread Pollution ChunkCoordIntPair[] tNeighbors = new ChunkCoordIntPair[4];//array is faster tNeighbors[0] = (new ChunkCoordIntPair(actualPos.chunkXPos + 1, actualPos.chunkZPos)); @@ -138,7 +143,7 @@ public class GT_Pollution { tDiff = tDiff / 20; neighborPollution = GT_Utility.safeInt((long) neighborPollution + tDiff);//tNPol += tDiff; tPollution -= tDiff; - neighbor.setAmount(neighborPollution); + setChunkPollution(neighborPosition, neighborPollution); } } @@ -200,7 +205,7 @@ public class GT_Pollution { } } //Write new pollution to Hashmap !!! - currentData.setAmount(tPollution); + setChunkPollution(actualPos, tPollution); //Send new value to players nearby if (tPollution > POLLUTIONPACKET_MINVALUE) { @@ -210,6 +215,10 @@ public class GT_Pollution { } } + private void setChunkPollution(ChunkCoordIntPair coord, int pollution) { + mutatePollution(world, coord.chunkXPos, coord.chunkZPos, c -> c.setAmount(pollution), pollutedChunks); + } + private static void damageBlock(World world, int x, int y, int z, boolean sourRain) { if (world.isRemote) return; Block tBlock = world.getBlock(x, y, z); @@ -265,13 +274,33 @@ public class GT_Pollution { } } + private static GT_Pollution getPollutionManager(World world) { + return dimensionWisePollution.computeIfAbsent(world.provider.dimensionId, i -> new GT_Pollution(world)); + } + public static void addPollution(IGregTechTileEntity te, int aPollution) { - addPollution(te.getWorld().getChunkFromBlockCoords(te.getXCoord(), te.getZCoord()), aPollution); + if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0) return; + mutatePollution(te.getWorld(), te.getXCoord() >> 4, te.getZCoord() >> 4, d -> d.changeAmount(aPollution), null); } public static void addPollution(Chunk ch, int aPollution) { if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0) return; - STORAGE.get(ch).changeAmount(aPollution); + mutatePollution(ch.worldObj, ch.xPosition, ch.zPosition, d -> d.changeAmount(aPollution), null); + } + + private static void mutatePollution(World world, int x, int z, Consumer mutator, @Nullable Set chunks) { + ChunkData data = STORAGE.get(world, x, z); + boolean hadPollution = data.getAmount() > 0; + mutator.accept(data); + boolean hasPollution = data.getAmount() > 0; + if (hasPollution != hadPollution) { + if (chunks == null) + chunks = getPollutionManager(world).pollutedChunks; + if (hasPollution) + chunks.add(new ChunkCoordIntPair(x, z)); + else + chunks.remove(new ChunkCoordIntPair(x, z)); + } } public static int getPollution(IGregTechTileEntity te) { @@ -341,14 +370,11 @@ public class GT_Pollution { @Override protected ChunkData readElement(DataInput input, int version, World world, int chunkX, int chunkZ) throws IOException { ChunkData data = new ChunkData(input.readInt()); - getChunkData(world).add(new ChunkCoordIntPair(chunkX, chunkZ)); + if (data.getAmount() > 0) + getPollutionManager(world).pollutedChunks.add(new ChunkCoordIntPair(chunkX, chunkZ)); return data; } - private List getChunkData(World world) { - return dimensionWisePollution.computeIfAbsent(world.provider.dimensionId, i -> new GT_Pollution(world)).chunkData; - } - @Override protected ChunkData createElement(World world, int chunkX, int chunkZ) { return new ChunkData(); @@ -359,11 +385,6 @@ public class GT_Pollution { super.loadAll(w); } - public void set(World world, ChunkCoordIntPair coord, ChunkData data) { - set(world, coord.chunkXPos, coord.chunkZPos, data); - getChunkData(world).add(coord); - } - public boolean isCreated(World world, ChunkCoordIntPair coord) { return isCreated(world.provider.dimensionId, coord.chunkXPos, coord.chunkZPos); } @@ -377,7 +398,7 @@ public class GT_Pollution { } private ChunkData(int amount) { - this.amount = amount; + this.amount = Math.max(0, amount); } /** -- cgit From a3da11bb7c82ddec2409989314adeb3076c0157b Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Sun, 28 Nov 2021 22:52:54 +0800 Subject: remove tiny dust in ore process --- .../api/interfaces/internal/IGT_RecipeAdder.java | 4 ++++ src/main/java/gregtech/api/util/GT_ModHandler.java | 19 ++++++++++++++-- src/main/java/gregtech/common/GT_RecipeAdder.java | 26 ++++++++++++++++++++++ .../oreprocessing/ProcessingCrushedOre.java | 2 +- .../loaders/oreprocessing/ProcessingDirty.java | 4 ++-- .../loaders/oreprocessing/ProcessingDust.java | 2 +- 6 files changed, 51 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java index 2267b6c241..9d66e38060 100644 --- a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java +++ b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java @@ -407,6 +407,8 @@ public interface IGT_RecipeAdder { */ boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int aDuration, int aEUt); + boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int[] aChances, int aDuration, int aEUt); + /** * Adds an Implosion Compressor Recipe * @@ -488,6 +490,8 @@ public interface IGT_RecipeAdder { */ boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int aDuration, int aEUt); + boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); + /** * Adds an Unboxing Recipe */ diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 810a204c40..acd9a294f9 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -797,6 +797,13 @@ public class GT_ModHandler { /** * IC2-ThermalCentrifuge Recipe. Overloads old Recipes automatically */ + public static boolean addThermalCentrifugeRecipe(ItemStack aInput, int[] aChances, int aHeat, Object... aOutput) { + if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.thermalcentrifuge, aInput, true)) return false; + RA.addThermalCentrifugeRecipe(aInput, aOutput.length >= 1 ? (ItemStack)aOutput[0] : null, aOutput.length >= 2 ? (ItemStack)aOutput[1] : null, aOutput.length >= 3 ? (ItemStack)aOutput[2] : null, aChances, 500, 48); + return true; + } + public static boolean addThermalCentrifugeRecipe(ItemStack aInput, int aHeat, Object... aOutput) { if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.thermalcentrifuge, aInput, true)) return false; @@ -807,11 +814,19 @@ public class GT_ModHandler { /** * IC2-OreWasher Recipe. Overloads old Recipes automatically */ + public static boolean addOreWasherRecipe(ItemStack aInput, int[] aChances, int aWaterAmount, Object... aOutput) { + if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; + if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.orewashing, aInput, true)) return false; + RA.addOreWasherRecipe(aInput, (ItemStack)aOutput[0], (ItemStack)aOutput[1], (ItemStack)aOutput[2], GT_ModHandler.getWater(aWaterAmount), aChances, 500, 16); + RA.addOreWasherRecipe(aInput, (ItemStack)aOutput[0], (ItemStack)aOutput[1], (ItemStack)aOutput[2], GT_ModHandler.getDistilledWater(aWaterAmount / 5), aChances, 300, 16); + return true; + } + public static boolean addOreWasherRecipe(ItemStack aInput, int aWaterAmount, Object... aOutput) { if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false; if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.orewashing, aInput, true)) return false; - RA.addOreWasherRecipe(aInput, (ItemStack)aOutput[0], (ItemStack)aOutput[1], (ItemStack)aOutput[2], GT_ModHandler.getWater(1000L), 500, 16); - RA.addOreWasherRecipe(aInput, (ItemStack)aOutput[0], (ItemStack)aOutput[1], (ItemStack)aOutput[2], GT_ModHandler.getDistilledWater(200L), 300, 16); + RA.addOreWasherRecipe(aInput, (ItemStack)aOutput[0], (ItemStack)aOutput[1], (ItemStack)aOutput[2], GT_ModHandler.getWater(aWaterAmount), 500, 16); + RA.addOreWasherRecipe(aInput, (ItemStack)aOutput[0], (ItemStack)aOutput[1], (ItemStack)aOutput[2], GT_ModHandler.getDistilledWater(aWaterAmount / 5), 300, 16); return true; } diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 1571ef7b46..4ba4601490 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -594,6 +594,20 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override + public boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int[] aChances, int aDuration, int aEUt) { + if ((aInput == null) || (aFluidInput == null) || ((aOutput1 == null) || (aOutput2 == null) || (aOutput3 == null))) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("orewasher", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0); + return true; + } + + + @Override public boolean addImplosionRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) { if ((aInput1 == null) || (aOutput1 == null)) { @@ -774,6 +788,18 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return true; } + @Override + public boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) { + if ((aInput == null) || (aOutput1 == null)) { + return false; + } + if (!GregTech_API.sRecipeFile.get("thermalcentrifuge", aInput, true)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, null, null, aDuration, aEUt, 0); + return true; + } + @Override public boolean addAmplifier(ItemStack aAmplifierItem, int aDuration, int aAmplifierAmountOutputted) { if ((aAmplifierItem == null) || (aAmplifierAmountOutputted <= 0)) { diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingCrushedOre.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingCrushedOre.java index fd500b258a..a7c3a524b8 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingCrushedOre.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingCrushedOre.java @@ -22,7 +22,7 @@ public class ProcessingCrushedOre implements gregtech.api.interfaces.IOreRecipeR GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, GT_Utility.selectItemInList(2, aMaterial.mMacerateInto, aMaterial.mOreByProducts), 1L), 10, false); break; case crushedPurified: - GT_ModHandler.addThermalCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), (int) Math.min(5000L, Math.abs(aMaterial.getMass() * 20L)), GT_OreDictUnificator.get(OrePrefixes.crushedCentrifuged, aMaterial.mMacerateInto, GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_Utility.selectItemInList(1, aMaterial.mMacerateInto, aMaterial.mOreByProducts), 1L)); + GT_ModHandler.addThermalCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), new int[] {10000, 1111}, (int) Math.min(5000L, Math.abs(aMaterial.getMass() * 20L)), GT_OreDictUnificator.get(OrePrefixes.crushedCentrifuged, aMaterial.mMacerateInto, GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), 1L), GT_OreDictUnificator.get(OrePrefixes.dust, GT_Utility.selectItemInList(1, aMaterial.mMacerateInto, aMaterial.mOreByProducts), 1L)); ItemStack tGem = GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L); if(tGem!=null){ diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDirty.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDirty.java index ca73118d20..2682cf24a2 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDirty.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDirty.java @@ -21,8 +21,8 @@ public class ProcessingDirty implements gregtech.api.interfaces.IOreRecipeRegist public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, net.minecraft.item.ItemStack aStack) { GT_Values.RA.addForgeHammerRecipe(GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, 1L), 10, 16); GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial.mMacerateInto, GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), 1L), GT_OreDictUnificator.get(OrePrefixes.dust, GT_Utility.selectItemInList(0, aMaterial.mMacerateInto, aMaterial.mOreByProducts), 1L), 10, false); - GT_ModHandler.addOreWasherRecipe(GT_Utility.copyAmount(1L, aStack), 1000, GT_OreDictUnificator.get(aPrefix == OrePrefixes.crushed ? OrePrefixes.crushedPurified : OrePrefixes.dustPure, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_Utility.selectItemInList(0, aMaterial.mMacerateInto, aMaterial.mOreByProducts), 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); - GT_ModHandler.addThermalCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), (int) Math.min(5000L, Math.abs(aMaterial.getMass() * 20L)), GT_OreDictUnificator.get(aPrefix == OrePrefixes.crushed ? OrePrefixes.crushedCentrifuged : OrePrefixes.dust, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_Utility.selectItemInList(1, aMaterial.mMacerateInto, aMaterial.mOreByProducts), 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); + GT_ModHandler.addOreWasherRecipe(GT_Utility.copyAmount(1L, aStack), new int[] {10000, 1111, 10000}, 1000, GT_OreDictUnificator.get(aPrefix == OrePrefixes.crushed ? OrePrefixes.crushedPurified : OrePrefixes.dustPure, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, GT_Utility.selectItemInList(0, aMaterial.mMacerateInto, aMaterial.mOreByProducts), 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); + GT_ModHandler.addThermalCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), new int[] {10000, 1111, 10000}, (int) Math.min(5000L, Math.abs(aMaterial.getMass() * 20L)), GT_OreDictUnificator.get(aPrefix == OrePrefixes.crushed ? OrePrefixes.crushedCentrifuged : OrePrefixes.dust, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, GT_Utility.selectItemInList(1, aMaterial.mMacerateInto, aMaterial.mOreByProducts), 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); if (aMaterial.contains(SubTag.WASHING_MERCURY)) GT_Values.RA.addChemicalBathRecipe(GT_Utility.copyAmount(1L, aStack), Materials.Mercury.getFluid(1000L), GT_OreDictUnificator.get(aPrefix == OrePrefixes.crushed ? OrePrefixes.crushedPurified : OrePrefixes.dustPure, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java index 9fa2c63970..29a89ccc65 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java @@ -191,7 +191,7 @@ public class ProcessingDust implements gregtech.api.interfaces.IOreRecipeRegistr GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(2L, aStack), 0, GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 2L), tImpureStack, null, null, null, null, (int) Math.max(1L, aMaterial.getMass() * 16L)); } } else { - GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), 0, GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), tImpureStack, null, null, null, null, (int) Math.max(1L, aMaterial.getMass() * 8L)); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), null, null, null, GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, tByProduct, GT_OreDictUnificator.get(OrePrefixes.nugget, tByProduct, 1L), 1L), null, null, null, null, new int[]{10000, 1111}, (int) Math.max(1L, aMaterial.getMass() * 8L), 5); } break; case dustSmall: -- cgit From cfae9ce1a2b58c48b878a7ab461caccc108e1f0c Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Sun, 28 Nov 2021 18:49:58 +0100 Subject: moved client GT config to the right place --- src/main/java/gregtech/GT_Mod.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 74a68dc748..e157c08c03 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -201,7 +201,7 @@ public class GT_Mod implements IGT_Mod { GregTech_API.sSpecialFile = new GT_Config(new Configuration(new File(new File(aEvent.getModConfigurationDirectory(), "GregTech"), "Other.cfg"))); GregTech_API.sOPStuff = new GT_Config(new Configuration(new File(new File(aEvent.getModConfigurationDirectory(), "GregTech"), "OverpoweredStuff.cfg"))); - GregTech_API.sClientDataFile = new GT_Config(new Configuration(new File(aEvent.getModConfigurationDirectory().getParentFile(), "GregTech.cfg"))); + GregTech_API.sClientDataFile = new GT_Config(new Configuration(new File(new File(aEvent.getModConfigurationDirectory(), "GregTech"), "Client.cfg"))); GregTech_API.mIC2Classic = Loader.isModLoaded("IC2-Classic-Spmod"); GregTech_API.mGTPlusPlus = Loader.isModLoaded("miscutils"); GregTech_API.mTranslocator = Loader.isModLoaded("Translocator"); -- cgit From 4d09a302d099f41109687c7eb0f44aa7636ae1d2 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Sun, 28 Nov 2021 22:29:00 +0100 Subject: fixed config oversight --- src/main/java/gregtech/GT_Mod.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index e157c08c03..d8ebca57a2 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -404,8 +404,9 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond = tMainConfig.get("Pollution", "PollutionHighPressureLavaBoiler", gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond).getInt(gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond); gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond = tMainConfig.get("Pollution", "PollutionHighPressureCoalBoiler", gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond).getInt(gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond); gregtechproxy.mPollutionBaseDieselGeneratorPerSecond = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator",gregtechproxy.mPollutionBaseDieselGeneratorPerSecond).getInt(gregtechproxy.mPollutionBaseDieselGeneratorPerSecond); - gregtechproxy.mPollutionDieselGeneratorReleasedByTier = tMainConfig.get("Pollution", "PollutionReleasedByTier", gregtechproxy.mPollutionDieselGeneratorReleasedByTier).getDoubleList(); - gregtechproxy.mPollutionBaseGasTurbinePerSecond = tMainConfig.get("Pollution", "PollutionBaseDieselGenerator", gregtechproxy.mPollutionBaseGasTurbinePerSecond).getInt(gregtechproxy.mPollutionBaseGasTurbinePerSecond); + gregtechproxy.mPollutionDieselGeneratorReleasedByTier = tMainConfig.get("Pollution", "PollutionReleasedByTierDieselGenerator", gregtechproxy.mPollutionDieselGeneratorReleasedByTier).getDoubleList(); + gregtechproxy.mPollutionBaseGasTurbinePerSecond = tMainConfig.get("Pollution", "PollutionBaseGasTurbineGenerator", gregtechproxy.mPollutionBaseGasTurbinePerSecond).getInt(gregtechproxy.mPollutionBaseGasTurbinePerSecond); + gregtechproxy.mPollutionGasTurbineReleasedByTier = tMainConfig.get("Pollution", "PollutionReleasedByTierGasTurbineGenerator", gregtechproxy.mPollutionGasTurbineReleasedByTier).getDoubleList(); gregtechproxy.mUndergroundOil.getConfig(tMainConfig, "undergroundfluid"); gregtechproxy.mEnableCleanroom = tMainConfig.get("general", "EnableCleanroom", true).getBoolean(true); -- cgit From 8494b65c5d390dd8c1035fd07534df55d1fb3ad4 Mon Sep 17 00:00:00 2001 From: boubou_19 Date: Mon, 29 Nov 2021 02:39:06 +0100 Subject: removed useless overrides --- .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 9 ++++++--- .../machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java | 5 ----- .../machines/multi/GT_MetaTileEntity_AssemblyLine.java | 5 ----- .../machines/multi/GT_MetaTileEntity_Charcoal_Pit.java | 5 ----- .../tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java | 5 ----- .../machines/multi/GT_MetaTileEntity_DieselEngine.java | 5 ----- .../machines/multi/GT_MetaTileEntity_DistillationTower.java | 5 ----- .../machines/multi/GT_MetaTileEntity_DrillerBase.java | 5 ----- .../machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java | 5 ----- .../machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java | 5 ----- .../machines/multi/GT_MetaTileEntity_FusionComputer.java | 5 ----- .../machines/multi/GT_MetaTileEntity_HeatExchanger.java | 5 ----- .../machines/multi/GT_MetaTileEntity_ImplosionCompressor.java | 5 ----- .../machines/multi/GT_MetaTileEntity_LargeBoiler.java | 5 ----- .../machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java | 5 ----- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 5 ----- .../machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java | 5 ----- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java | 5 ----- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java | 5 ----- .../machines/multi/GT_MetaTileEntity_MultiFurnace.java | 5 ----- .../machines/multi/GT_MetaTileEntity_OilCracker.java | 5 ----- .../machines/multi/GT_MetaTileEntity_ProcessingArray.java | 5 ----- .../machines/multi/GT_MetaTileEntity_PyrolyseOven.java | 5 ----- .../machines/multi/GT_MetaTileEntity_VacuumFreezer.java | 5 ----- 24 files changed, 6 insertions(+), 118 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 8fe70c4f72..f7b15f2c44 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -398,13 +398,16 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { /** * Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pullution Block) */ - public abstract int getPollutionPerTick(ItemStack aStack); + public int getPollutionPerTick(ItemStack aStack){ + return getPollutionPerSecond(aStack)/20; + } /** - * Gets the pollution produced per second by this multiblock + * Gets the pollution produced per second by this multiblock, default to 0. Override this with + * its actual value in the code of the multiblock. */ public int getPollutionPerSecond(ItemStack aStack){ - return 20 * getPollutionPerTick(aStack); + return 0; } /** diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java index 2409c1660c..af6afbc4c4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java @@ -34,11 +34,6 @@ public abstract class GT_MetaTileEntity_AbstractMultiFurnace aFluids, int aOptFlow, int aBaseEff) { if (aFluids.size() >= 1) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index 2c803712f1..b34662e619 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -82,11 +82,6 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La return 59; } - @Override - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - @Override int fluidIntoPower(ArrayList aFluids, int aOptFlow, int aBaseEff) { if (looseFit) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index 76c5533c09..b32385c1be 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -88,11 +88,6 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar return 60; } - @Override - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - @Override int fluidIntoPower(ArrayList aFluids, int aOptFlow, int aBaseEff) { if (aFluids.size() >= 1) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index 356dda9183..651d9c9d09 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -85,11 +85,6 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg return 16; } - @Override - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - private int condenseSteam(int steam) { excessWater += steam; int water = excessWater / STEAM_PER_WATER; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index ca334e5bd6..cd07476194 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -118,11 +118,6 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu return GT_Mod.gregtechproxy.mPollutionMultiSmelterPerSecond; } - @Override - public int getPollutionPerTick(ItemStack aStack){ - return getPollutionPerSecond(aStack)/20; - } - @Override public boolean checkRecipe(ItemStack aStack) { ArrayList tInputList = getStoredInputs(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java index b9ade288c1..10b94fc254 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java @@ -272,11 +272,6 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult return 10000; } - @Override - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - @Override public int getDamageToComponent(ItemStack aStack) { return 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index a48f63c60a..44f93eb3db 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -409,11 +409,6 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu return 10000; } - @Override - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - @Override public int getDamageToComponent(ItemStack aStack) { return 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index d60f38fdc9..18eda558a0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -230,11 +230,6 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu return GT_Mod.gregtechproxy.mPollutionPyrolyseOvenPerSecond; } - @Override - public int getPollutionPerTick(ItemStack aStack){ - return getPollutionPerSecond(aStack)/20; - } - @Override public int getDamageToComponent(ItemStack aStack) { return 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java index 843f2ff337..f476e78310 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java @@ -142,11 +142,6 @@ public class GT_MetaTileEntity_VacuumFreezer extends GT_MetaTileEntity_CubicMult return 10000; } - @Override - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - @Override public int getDamageToComponent(ItemStack aStack) { return 0; -- cgit From aa5ecad587ade7d98b7c819c78d0079b28e1ed17 Mon Sep 17 00:00:00 2001 From: bombcar Date: Mon, 29 Nov 2021 09:46:05 -0600 Subject: update speed to L/t --- .../common/items/GT_MetaGenerated_Item_01.java | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index e7f846d9b0..9f8d0c4ae8 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -58,7 +58,7 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { private static final String aTextStick = " S "; private static final String aTextFeather = "F "; private static final String aTextEmptyRow = " "; private static final String aTextShape = " P "; - private static final String PartCoverText = " L/sec (as Cover)"; + private static final String PartCoverText = " L/tic (as Cover)"; private static final String PartNotCoverText = "Cannot be used as a Cover"; private static final String RAText = "Grabs from and inserts into specific slots"; private static final String FRText1 = "Configuable up to "; @@ -541,16 +541,16 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Titanium), 'S', OrePrefixes.stick.get(Materials.Titanium), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium), 'M', ItemList.Electric_Motor_EV, 'C', OrePrefixes.cableGt01.get(Materials.Aluminium)}); GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.TungstenSteel), 'S', OrePrefixes.stick.get(Materials.TungstenSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel), 'M', ItemList.Electric_Motor_IV, 'C', OrePrefixes.cableGt01.get(Materials.Tungsten)}); - ItemList.Electric_Pump_LV.set(addItem(610, "Electric Pump (LV)", GT_Utility.formatNumbers(640) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); - ItemList.Electric_Pump_MV.set(addItem(611, "Electric Pump (MV)", GT_Utility.formatNumbers(2560) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); - ItemList.Electric_Pump_HV.set(addItem(612, "Electric Pump (HV)", GT_Utility.formatNumbers(10240) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); - ItemList.Electric_Pump_EV.set(addItem(613, "Electric Pump (EV)", GT_Utility.formatNumbers(40960) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); - ItemList.Electric_Pump_IV.set(addItem(614, "Electric Pump (IV)", GT_Utility.formatNumbers(163840) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); - ItemList.Electric_Pump_LuV.set(addItem(615, "Electric Pump (LuV)", GT_Utility.formatNumbers(655360) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 32L))); - ItemList.Electric_Pump_ZPM.set(addItem(616, "Electric Pump (ZPM)", GT_Utility.formatNumbers(2621440) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 64L))); - ItemList.Electric_Pump_UV.set(addItem(617, "Electric Pump (UV)", GT_Utility.formatNumbers(10485760) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 128L))); - ItemList.Electric_Pump_UHV.set(addItem(618, "Electric Pump (UHV)", GT_Utility.formatNumbers(20971520) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 256L))); - ItemList.Electric_Pump_UEV.set(addItem(619, "Electric Pump (UEV)", GT_Utility.formatNumbers(41943040) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); + ItemList.Electric_Pump_LV.set(addItem(610, "Electric Pump (LV)", GT_Utility.formatNumbers(32) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + ItemList.Electric_Pump_MV.set(addItem(611, "Electric Pump (MV)", GT_Utility.formatNumbers(128) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.Electric_Pump_HV.set(addItem(612, "Electric Pump (HV)", GT_Utility.formatNumbers(512) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); + ItemList.Electric_Pump_EV.set(addItem(613, "Electric Pump (EV)", GT_Utility.formatNumbers(2048) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); + ItemList.Electric_Pump_IV.set(addItem(614, "Electric Pump (IV)", GT_Utility.formatNumbers(8192) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); + ItemList.Electric_Pump_LuV.set(addItem(615, "Electric Pump (LuV)", GT_Utility.formatNumbers(32768) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 32L))); + ItemList.Electric_Pump_ZPM.set(addItem(616, "Electric Pump (ZPM)", GT_Utility.formatNumbers(131072) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 64L))); + ItemList.Electric_Pump_UV.set(addItem(617, "Electric Pump (UV)", GT_Utility.formatNumbers(524288) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 128L))); + ItemList.Electric_Pump_UHV.set(addItem(618, "Electric Pump (UHV)", GT_Utility.formatNumbers(1048576) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 256L))); + ItemList.Electric_Pump_UEV.set(addItem(619, "Electric Pump (UEV)", GT_Utility.formatNumbers(2097152) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); ItemList.Electric_Pump_UIV.set(addItem(27, "Electric Pump (UIV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); ItemList.Electric_Pump_UMV.set(addItem(28, "Electric Pump (UMV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); ItemList.Electric_Pump_UXV.set(addItem(29, "Electric Pump (UXV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); @@ -574,11 +574,11 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_EV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'W', OrePrefixes.cableGt01.get(Materials.Aluminium), 'P', OrePrefixes.pipeMedium.get(Materials.Titanium)}); GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_IV, 'O', OrePrefixes.ring.get(Materials.AnySyntheticRubber), 'X', OrePrefixes.rotor.get(Materials.TungstenSteel), 'S', OrePrefixes.screw.get(Materials.TungstenSteel), 'W', OrePrefixes.cableGt01.get(Materials.Tungsten), 'P', OrePrefixes.pipeMedium.get(Materials.TungstenSteel)}); - ItemList.Steam_Valve_LV.set(addItem(620, "Steam Valve (LV)", GT_Utility.formatNumbers(20480) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); - ItemList.Steam_Valve_MV.set(addItem(621, "Steam Valve (MV)", GT_Utility.formatNumbers(40960) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); - ItemList.Steam_Valve_HV.set(addItem(622, "Steam Valve (HV)", GT_Utility.formatNumbers(81920) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); - ItemList.Steam_Valve_EV.set(addItem(623, "Steam Valve (EV)", GT_Utility.formatNumbers(163840) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); - ItemList.Steam_Valve_IV.set(addItem(624, "Steam Valve (IV)", GT_Utility.formatNumbers(327680) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); + ItemList.Steam_Valve_LV.set(addItem(620, "Steam Valve (LV)", GT_Utility.formatNumbers(1024) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + ItemList.Steam_Valve_MV.set(addItem(621, "Steam Valve (MV)", GT_Utility.formatNumbers(2048) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.Steam_Valve_HV.set(addItem(622, "Steam Valve (HV)", GT_Utility.formatNumbers(4096) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); + ItemList.Steam_Valve_EV.set(addItem(623, "Steam Valve (EV)", GT_Utility.formatNumbers(8192) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); + ItemList.Steam_Valve_IV.set(addItem(624, "Steam Valve (IV)", GT_Utility.formatNumbers(16384) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); GregTech_API.registerCover(ItemList.Steam_Valve_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(1024)); GregTech_API.registerCover(ItemList.Steam_Valve_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(2048)); -- cgit From a34790512c36a56ffe62ead86cf49b8b89b4f846 Mon Sep 17 00:00:00 2001 From: bombcar Date: Mon, 29 Nov 2021 10:34:55 -0600 Subject: add both L/t and L/s to pumps --- .../common/items/GT_MetaGenerated_Item_01.java | 35 +++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index 9f8d0c4ae8..4501efb20c 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -58,10 +58,11 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { private static final String aTextStick = " S "; private static final String aTextFeather = "F "; private static final String aTextEmptyRow = " "; private static final String aTextShape = " P "; - private static final String PartCoverText = " L/tic (as Cover)"; + private static final String PartCoverText = " L/t ("; + private static final String PartCoverText2 = " L/s) as Cover"; private static final String PartNotCoverText = "Cannot be used as a Cover"; private static final String RAText = "Grabs from and inserts into specific slots"; - private static final String FRText1 = "Configuable up to "; + private static final String FRText1 = "Configurable up to "; private static final String FRText2 = " L/sec (as Cover)/n Rightclick/Screwdriver-rightclick/Shift-screwdriver-rightclick/n to adjust the pump speed by 1/16/256 L/sec per click"; public GT_MetaGenerated_Item_01() { @@ -541,16 +542,16 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.Titanium), 'S', OrePrefixes.stick.get(Materials.Titanium), 'G', OrePrefixes.gearGtSmall.get(Materials.Titanium), 'M', ItemList.Electric_Motor_EV, 'C', OrePrefixes.cableGt01.get(Materials.Aluminium)}); GT_ModHandler.addCraftingRecipe(ItemList.Electric_Piston_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", 'P', OrePrefixes.plate.get(Materials.TungstenSteel), 'S', OrePrefixes.stick.get(Materials.TungstenSteel), 'G', OrePrefixes.gearGtSmall.get(Materials.TungstenSteel), 'M', ItemList.Electric_Motor_IV, 'C', OrePrefixes.cableGt01.get(Materials.Tungsten)}); - ItemList.Electric_Pump_LV.set(addItem(610, "Electric Pump (LV)", GT_Utility.formatNumbers(32) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); - ItemList.Electric_Pump_MV.set(addItem(611, "Electric Pump (MV)", GT_Utility.formatNumbers(128) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); - ItemList.Electric_Pump_HV.set(addItem(612, "Electric Pump (HV)", GT_Utility.formatNumbers(512) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); - ItemList.Electric_Pump_EV.set(addItem(613, "Electric Pump (EV)", GT_Utility.formatNumbers(2048) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); - ItemList.Electric_Pump_IV.set(addItem(614, "Electric Pump (IV)", GT_Utility.formatNumbers(8192) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); - ItemList.Electric_Pump_LuV.set(addItem(615, "Electric Pump (LuV)", GT_Utility.formatNumbers(32768) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 32L))); - ItemList.Electric_Pump_ZPM.set(addItem(616, "Electric Pump (ZPM)", GT_Utility.formatNumbers(131072) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 64L))); - ItemList.Electric_Pump_UV.set(addItem(617, "Electric Pump (UV)", GT_Utility.formatNumbers(524288) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 128L))); - ItemList.Electric_Pump_UHV.set(addItem(618, "Electric Pump (UHV)", GT_Utility.formatNumbers(1048576) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 256L))); - ItemList.Electric_Pump_UEV.set(addItem(619, "Electric Pump (UEV)", GT_Utility.formatNumbers(2097152) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); + ItemList.Electric_Pump_LV.set(addItem(610, "Electric Pump (LV)", GT_Utility.formatNumbers(32) + PartCoverText + GT_Utility.formatNumbers(32 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + ItemList.Electric_Pump_MV.set(addItem(611, "Electric Pump (MV)", GT_Utility.formatNumbers(128) + PartCoverText + GT_Utility.formatNumbers(128 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.Electric_Pump_HV.set(addItem(612, "Electric Pump (HV)", GT_Utility.formatNumbers(512) + PartCoverText + GT_Utility.formatNumbers(512 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); + ItemList.Electric_Pump_EV.set(addItem(613, "Electric Pump (EV)", GT_Utility.formatNumbers(2048) + PartCoverText + GT_Utility.formatNumbers(2048 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); + ItemList.Electric_Pump_IV.set(addItem(614, "Electric Pump (IV)", GT_Utility.formatNumbers(8192) + PartCoverText + GT_Utility.formatNumbers(8192 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); + ItemList.Electric_Pump_LuV.set(addItem(615, "Electric Pump (LuV)", GT_Utility.formatNumbers(32768) + PartCoverText + GT_Utility.formatNumbers(32768 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 32L))); + ItemList.Electric_Pump_ZPM.set(addItem(616, "Electric Pump (ZPM)", GT_Utility.formatNumbers(131072) + PartCoverText + GT_Utility.formatNumbers(131072 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 64L))); + ItemList.Electric_Pump_UV.set(addItem(617, "Electric Pump (UV)", GT_Utility.formatNumbers(524288) + PartCoverText + GT_Utility.formatNumbers(524288 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 128L))); + ItemList.Electric_Pump_UHV.set(addItem(618, "Electric Pump (UHV)", GT_Utility.formatNumbers(1048576) + PartCoverText + GT_Utility.formatNumbers(1048576 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 256L))); + ItemList.Electric_Pump_UEV.set(addItem(619, "Electric Pump (UEV)", GT_Utility.formatNumbers(2097152) + PartCoverText + GT_Utility.formatNumbers(2097152 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); ItemList.Electric_Pump_UIV.set(addItem(27, "Electric Pump (UIV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); ItemList.Electric_Pump_UMV.set(addItem(28, "Electric Pump (UMV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); ItemList.Electric_Pump_UXV.set(addItem(29, "Electric Pump (UXV)", PartNotCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 512L))); @@ -574,11 +575,11 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_EV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_EV, 'O', OrePrefixes.ring.get(Materials.AnyRubber), 'X', OrePrefixes.rotor.get(Materials.StainlessSteel), 'S', OrePrefixes.screw.get(Materials.StainlessSteel), 'W', OrePrefixes.cableGt01.get(Materials.Aluminium), 'P', OrePrefixes.pipeMedium.get(Materials.Titanium)}); GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_IV.get(1L), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", 'M', ItemList.Electric_Motor_IV, 'O', OrePrefixes.ring.get(Materials.AnySyntheticRubber), 'X', OrePrefixes.rotor.get(Materials.TungstenSteel), 'S', OrePrefixes.screw.get(Materials.TungstenSteel), 'W', OrePrefixes.cableGt01.get(Materials.Tungsten), 'P', OrePrefixes.pipeMedium.get(Materials.TungstenSteel)}); - ItemList.Steam_Valve_LV.set(addItem(620, "Steam Valve (LV)", GT_Utility.formatNumbers(1024) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); - ItemList.Steam_Valve_MV.set(addItem(621, "Steam Valve (MV)", GT_Utility.formatNumbers(2048) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); - ItemList.Steam_Valve_HV.set(addItem(622, "Steam Valve (HV)", GT_Utility.formatNumbers(4096) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); - ItemList.Steam_Valve_EV.set(addItem(623, "Steam Valve (EV)", GT_Utility.formatNumbers(8192) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); - ItemList.Steam_Valve_IV.set(addItem(624, "Steam Valve (IV)", GT_Utility.formatNumbers(16384) + PartCoverText, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); + ItemList.Steam_Valve_LV.set(addItem(620, "Steam Valve (LV)", GT_Utility.formatNumbers(1024) + PartCoverText + GT_Utility.formatNumbers(1024 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L))); + ItemList.Steam_Valve_MV.set(addItem(621, "Steam Valve (MV)", GT_Utility.formatNumbers(2048) + PartCoverText + GT_Utility.formatNumbers(2048 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.Steam_Valve_HV.set(addItem(622, "Steam Valve (HV)", GT_Utility.formatNumbers(4096) + PartCoverText + GT_Utility.formatNumbers(4096 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L))); + ItemList.Steam_Valve_EV.set(addItem(623, "Steam Valve (EV)", GT_Utility.formatNumbers(8192) + PartCoverText + GT_Utility.formatNumbers(8192 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L))); + ItemList.Steam_Valve_IV.set(addItem(624, "Steam Valve (IV)", GT_Utility.formatNumbers(16384) + PartCoverText + GT_Utility.formatNumbers(16384 * 20) + PartCoverText2, new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 16L))); GregTech_API.registerCover(ItemList.Steam_Valve_LV.get(1L), TextureFactory.of(MACHINE_CASINGS[1][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(1024)); GregTech_API.registerCover(ItemList.Steam_Valve_MV.get(1L), TextureFactory.of(MACHINE_CASINGS[2][0], TextureFactory.of(OVERLAY_VALVE)), new GT_Cover_SteamValve(2048)); -- cgit From 4923b13c5a5e1c7798acd6ff45d8360a78474f7b Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Tue, 30 Nov 2021 03:07:30 +0800 Subject: Bug fix pass in UO and Pollution Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- .../gregtech/api/util/GT_ChunkAssociatedData.java | 69 ++++++++++++++-------- src/main/java/gregtech/common/GT_Pollution.java | 59 ++++++++++++++---- .../java/gregtech/common/GT_UndergroundOil.java | 32 ++++++++-- .../common/render/GT_PollutionRenderer.java | 4 ++ 4 files changed, 124 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java b/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java index aa779b0359..184f6f1011 100644 --- a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java +++ b/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java @@ -104,7 +104,7 @@ public abstract class GT_ChunkAssociatedData stream) { - stream.filter(r -> !r.isDirty()) + stream.filter(r -> r.isDirty()) .map(c -> (Runnable) c::save) .map(r -> CompletableFuture.runAsync(r, IO_WORKERS)) .reduce(CompletableFuture::allOf) @@ -242,7 +242,12 @@ public abstract class GT_ChunkAssociatedData world; + /** + * Be aware, this means region coord, not bottom-left chunk coord + */ private final ChunkCoordIntPair coord; - private SuperRegion(World world, int chunkX, int chunkZ) { + private SuperRegion(World world, int regionX, int regionZ) { this.world = new WeakReference<>(world); - this.coord = new ChunkCoordIntPair(chunkX, chunkZ); - backingStorage = new File(getSaveDirectory(world), String.format("%s.%d.%d.dat", mId, chunkX, chunkZ)); + this.coord = new ChunkCoordIntPair(regionX, regionZ); + backingStorage = new File(getSaveDirectory(world), String.format("%s.%d.%d.dat", mId, regionX, regionZ)); if (backingStorage.isFile()) load(); } - private SuperRegion(World world, ChunkCoordIntPair coord) { + private SuperRegion(World world, ChunkCoordIntPair regionCoord) { this.world = new WeakReference<>(world); - this.coord = coord; - backingStorage = new File(getSaveDirectory(world), String.format("%s.%d.%d.dat", mId, coord.chunkXPos, coord.chunkZPos)); + this.coord = regionCoord; + backingStorage = new File(getSaveDirectory(world), String.format("%s.%d.%d.dat", mId, regionCoord.chunkXPos, regionCoord.chunkZPos)); if (backingStorage.isFile()) load(); } @@ -308,16 +316,16 @@ public abstract class GT_ChunkAssociatedData new GT_Pollution(world)); } + /** @see #addPollution(World, int, int, int) */ public static void addPollution(IGregTechTileEntity te, int aPollution) { - if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0) return; + if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0 || te.isClientSide()) return; mutatePollution(te.getWorld(), te.getXCoord() >> 4, te.getZCoord() >> 4, d -> d.changeAmount(aPollution), null); } + /** @see #addPollution(World, int, int, int) */ public static void addPollution(Chunk ch, int aPollution) { - if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0) return; + if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0 || ch.worldObj.isRemote) return; mutatePollution(ch.worldObj, ch.xPosition, ch.zPosition, d -> d.changeAmount(aPollution), null); } + /** + * Add some pollution to given chunk. Can pass in negative to remove pollution. + * Will clamp the final pollution number to 0 if it would be changed into negative. + * + * @param w world to modify. do nothing if it's a client world + * @param chunkX chunk coordinate X, i.e. blockX >> 4 + * @param chunkZ chunk coordinate Z, i.e. blockZ >> 4 + * @param aPollution desired delta. Positive means the pollution in chunk would go higher. + */ + public static void addPollution(World w, int chunkX, int chunkZ, int aPollution) { + if (!GT_Mod.gregtechproxy.mPollution || aPollution == 0 || w.isRemote) return; + mutatePollution(w, chunkX, chunkZ, d -> d.changeAmount(aPollution), null); + } + private static void mutatePollution(World world, int x, int z, Consumer mutator, @Nullable Set chunks) { ChunkData data = STORAGE.get(world, x, z); boolean hadPollution = data.getAmount() > 0; @@ -303,14 +321,36 @@ public class GT_Pollution { } } + /** @see #getPollution(World, int, int) */ public static int getPollution(IGregTechTileEntity te) { - return getPollution(te.getWorld().getChunkFromBlockCoords(te.getXCoord(), te.getZCoord())); + return getPollution(te.getWorld(), te.getXCoord() >> 4, te.getZCoord() >> 4); } + /** @see #getPollution(World, int, int) */ public static int getPollution(Chunk ch) { + return getPollution(ch.worldObj, ch.xPosition, ch.zPosition); + } + + /** + * Get the pollution in specified chunk + * @param w world to look in. can be a client world, but that limits the knowledge to what server side send us + * @param chunkX chunk coordinate X, i.e. blockX >> 4 + * @param chunkZ chunk coordinate Z, i.e. blockZ >> 4 + * @return pollution amount. may be 0 if pollution is disabled, or if it's a client world and server did not send + * us info about this chunk + */ + public static int getPollution(World w, int chunkX, int chunkZ) { if (!GT_Mod.gregtechproxy.mPollution) return 0; - return STORAGE.get(ch).getAmount(); + if (w.isRemote) + // it really should be querying the client side stuff instead + return GT_PollutionRenderer.getKnownPollution(chunkX << 4, chunkZ << 4); + return STORAGE.get(w, chunkX, chunkZ).getAmount(); + } + + @Deprecated + public static int getPollution(ChunkCoordIntPair aCh, int aDim) { + return getPollution(DimensionManager.getWorld(aDim), aCh.chunkXPos, aCh.chunkZPos); } public static boolean hasPollution(Chunk ch) { @@ -319,12 +359,6 @@ public class GT_Pollution { return STORAGE.isCreated(ch.worldObj, ch.getChunkCoordIntPair()) && STORAGE.get(ch).getAmount() > 0; } - public static int getPollution(ChunkCoordIntPair aCh, int aDim) { - if (!GT_Mod.gregtechproxy.mPollution) - return 0; - return STORAGE.get(DimensionManager.getWorld(aDim), aCh.chunkXPos, aCh.chunkZPos).getAmount(); - } - //Add compatibility with old code @Deprecated /*Don't use it... too weird way of passing position*/ public static void addPollution(World aWorld, ChunkPosition aPos, int aPollution) { @@ -352,7 +386,8 @@ public class GT_Pollution { @SubscribeEvent public void onWorldLoad(WorldEvent.Load e) { // super class loads everything lazily. We force it to load them all. - STORAGE.loadAll(e.world); + if (!e.world.isRemote) + STORAGE.loadAll(e.world); } } @@ -369,6 +404,8 @@ public class GT_Pollution { @Override protected ChunkData readElement(DataInput input, int version, World world, int chunkX, int chunkZ) throws IOException { + if (version != 0) + throw new IOException("Region file corrupted"); ChunkData data = new ChunkData(input.readInt()); if (data.getAmount() > 0) getPollutionManager(world).pollutedChunks.add(new ChunkCoordIntPair(chunkX, chunkZ)); diff --git a/src/main/java/gregtech/common/GT_UndergroundOil.java b/src/main/java/gregtech/common/GT_UndergroundOil.java index 21b681de4a..b725b4bbb6 100644 --- a/src/main/java/gregtech/common/GT_UndergroundOil.java +++ b/src/main/java/gregtech/common/GT_UndergroundOil.java @@ -31,22 +31,46 @@ public class GT_UndergroundOil { private static final GT_UndergroundOilStore STORAGE = new GT_UndergroundOilStore(); private static final ChunkData NIL_FLUID_STACK = new ChunkData(-1, null, null, false); + /** + * Effectively just call {@code undergroundOil(te, -1)} for you + * @see #undergroundOil(World, int, int, float) + */ public static FluidStack undergroundOilReadInformation(IGregTechTileEntity te){ return undergroundOil(te.getWorld().getChunkFromBlockCoords(te.getXCoord(),te.getZCoord()),-1); } + /** + * Effectively just call {@code undergroundOil(chunk, -1)} for you + * @see #undergroundOil(World, int, int, float) + */ public static FluidStack undergroundOilReadInformation(Chunk chunk) { return undergroundOil(chunk,-1); } + /** @see #undergroundOil(World, int, int, float) */ public static FluidStack undergroundOil(IGregTechTileEntity te, float readOrDrainCoefficient){ return undergroundOil(te.getWorld().getChunkFromBlockCoords(te.getXCoord(),te.getZCoord()),readOrDrainCoefficient); } //Returns whole content for information purposes -> when drainSpeedCoefficient < 0 //Else returns extracted fluidStack if amount > 0, or null otherwise + /** @see #undergroundOil(World, int, int, float) */ public static FluidStack undergroundOil(Chunk chunk, float readOrDrainCoefficient) { - ChunkData chunkData = STORAGE.get(chunk); + return undergroundOil(chunk.worldObj, chunk.xPosition, chunk.zPosition, readOrDrainCoefficient); + } + + /** + * Pump fluid or read info. + * @param w a remote World. For a WorldClient it will always tell you null + * @param chunkX chunk coordinate X, i.e. blockX >> 4 + * @param chunkZ chunk coordinate Z, i.e. blockZ >> 4 + * @param readOrDrainCoefficient how fast to pump. The higher the faster. use negative to read expected current output + * @return null if nothing here, or depleted already, or a client side world + */ + public static FluidStack undergroundOil(World w, int chunkX, int chunkZ, float readOrDrainCoefficient) { + if (w.isRemote) + return null; // troublemakers go away + ChunkData chunkData = STORAGE.get(w, chunkX, chunkZ); if (chunkData.getVein() == null || chunkData.getFluid() == null) // nothing here... return null; //do stuff on it if needed @@ -102,7 +126,7 @@ public class GT_UndergroundOil { ChunkData chunkData = STORAGE.get(e.getChunk()); Fluid fluid = chunkData.getFluid(); if (fluid != null && fluid.getID() == e.getData().getInteger("GTOILFLUID")) - chunkData.setAmount(Math.min(0, Math.min(chunkData.getAmount(), e.getData().getInteger("GTOIL")))); + chunkData.setAmount(Math.min(chunkData.getAmount(), e.getData().getInteger("GTOIL"))); } } @@ -250,7 +274,7 @@ public class GT_UndergroundOil { public void changeAmount(int delta) { if (delta != 0) dirty = true; - this.amount = Math.max(0, amount - delta); + this.amount = Math.max(amount + delta, 0); } @Nullable @@ -272,7 +296,7 @@ public class GT_UndergroundOil { @Override public boolean isSameAsDefault() { - return dirty; + return !dirty; } } } diff --git a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java index 305eadf145..5128af1c36 100644 --- a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java +++ b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java @@ -101,6 +101,10 @@ public class GT_PollutionRenderer { return color(oColor, pollutionMap.getPollution(x, z)/1000, 300, 500, foliageColor); } + public static int getKnownPollution(int x, int z) { + return pollutionMap.getPollution(x, z); + } + @SubscribeEvent(priority = EventPriority.LOW) public void manipulateColor(EntityViewRenderEvent.FogColors event) { if (!DEBUG && Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) -- cgit From a07d8b58642eb9161479dcb3a285ad9979a74d2c Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Tue, 30 Nov 2021 21:44:02 +0800 Subject: fix wrong Arrays being used in assline datasticks Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java index f35f1962d1..62238a8112 100644 --- a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java +++ b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java @@ -2,6 +2,7 @@ package gregtech.api.util; import static gregtech.GT_Mod.GT_FML_LOGGER; +import java.util.Arrays; import java.util.HashMap; import cpw.mods.fml.common.FMLCommonHandler; @@ -14,7 +15,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagString; import net.minecraftforge.fluids.FluidStack; -import scala.actors.threadpool.Arrays; public class GT_AssemblyLineUtils { @@ -159,7 +159,7 @@ public class GT_AssemblyLineUtils { for (GT_Recipe_AssemblyLine aRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { if (aRecipe.mEUt == aEU && aRecipe.mDuration == aTime) { if (GT_Utility.areStacksEqual(aOutputs[0], aRecipe.mOutput, true)) { - if (Arrays.equals(aRecipe.mInputs, aInputs) && Arrays.equals(aRecipe.mFluidInputs, aFluidInputs)) { + if (Arrays.equals(aRecipe.mInputs, aInputs) && Arrays.equals(aRecipe.mFluidInputs, aFluidInputs)) { // Cache it String aRecipeHash = generateRecipeHash(aRecipe); sRecipeCacheByRecipeHash.put(aRecipeHash, aRecipe); -- cgit From 9d42b299def1c41bbc7a1f01efe445be28f54399 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 1 Dec 2021 02:52:15 +0800 Subject: Add a new ghost slot to single block machines for config circuits Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- build.properties | 2 +- src/main/java/gregtech/GT_Mod.java | 2 +- src/main/java/gregtech/api/GregTech_API.java | 51 ++++++++++++++++-- .../api/gui/GT_Container_BasicMachine.java | 60 +++++++++++++++++++--- .../gregtech/api/gui/GT_Container_BasicTank.java | 4 ++ .../api/metatileentity/BaseMetaTileEntity.java | 8 ++- .../api/metatileentity/MetaTileEntity.java | 2 + .../GT_MetaTileEntity_BasicMachine.java | 28 +++++++++- .../GT_MetaTileEntity_BasicMachine_GT_Recipe.java | 4 ++ .../common/items/GT_IntegratedCircuit_Item.java | 3 ++ 10 files changed, 146 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/build.properties b/build.properties index 00228f40fb..e4e8b23ca1 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,6 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614-1.7.10 -gt.version=5.09.39.01 +gt.version=5.09.40.00 structurelib.version=1.0.6 ae2.version=rv3-beta-22 applecore.version=1.7.10-1.2.1+107.59407 diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index d8ebca57a2..872055bcb8 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -115,7 +115,7 @@ import static gregtech.api.enums.GT_Values.MOD_ID_FR; " after:TConstruct;" + " after:Translocator;") public class GT_Mod implements IGT_Mod { - public static final int VERSION = 509, SUBVERSION = 39; + public static final int VERSION = 509, SUBVERSION = 40; public static final int TOTAL_VERSION = calculateTotalGTVersion(VERSION, SUBVERSION); public static final int REQUIRED_IC2 = 624; @Mod.Instance("gregtech") diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java index ff875c4884..12fc6b6814 100644 --- a/src/main/java/gregtech/api/GregTech_API.java +++ b/src/main/java/gregtech/api/GregTech_API.java @@ -19,7 +19,15 @@ import gregtech.api.objects.GT_HashSet; import gregtech.api.objects.GT_ItemStack; import gregtech.api.threads.GT_Runnable_Cable_Update; import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; -import gregtech.api.util.*; +import gregtech.api.util.GT_CircuitryBehavior; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.GT_CoverBehaviorBase; +import gregtech.api.util.GT_CreativeTab; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import gregtech.api.world.GT_Worldgen; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; @@ -30,10 +38,19 @@ import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import static gregtech.api.enums.GT_Values.*; +import static gregtech.api.enums.GT_Values.B; +import static gregtech.api.enums.GT_Values.L; +import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GT_Values.MOD_ID_IC2; /** * Please do not include this File in your Mod-download as it ruins compatiblity, like with the IC2-API @@ -161,6 +178,8 @@ public class GregTech_API { sHeatHazmatList = new GT_HashSet<>(), sRadioHazmatList = new GT_HashSet<>(), sElectroHazmatList = new GT_HashSet<>(); + private static final List sRealConfigurationList = new ArrayList<>(); + private static final List sConfigurationList = Collections.unmodifiableList(sRealConfigurationList); /** * The List of Dimensions, which are Whitelisted for the Teleporter. This list should not contain other Planets. * Mystcraft Dimensions and other Dimensional Things should be allowed. @@ -614,6 +633,31 @@ public class GregTech_API { } } + /** + * Register a new ItemStack as configuration circuits. + * Duplicates or invalid stacks will be silently ignored. + */ + public static void registerConfigurationCircuit(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) + return; + for (ItemStack tRegistered : sRealConfigurationList) + if (GT_Utility.areStacksEqual(tRegistered, aStack)) + return; + sRealConfigurationList.add(GT_Utility.copyAmount(0, aStack)); + } + + /** + * Get a list of Configuration circuits. All of these stacks will have a stack size of 0. + * Use {@link #registerConfigurationCircuit(ItemStack)} to add to this list. + * + * @return An unmodifiable view of actual list. + * It will reflect the changes to the underlying list as new circuits are registered. + * DO NOT MODIFY THE ItemStacks! + */ + public static List getConfigurationCircuitList() { + return sConfigurationList; + } + public static void registerCover(ItemStack aStack, ITexture aCover, GT_CoverBehavior aBehavior) { registerCover(aStack, aCover, (GT_CoverBehaviorBase) aBehavior); } @@ -812,5 +856,4 @@ public class GregTech_API { public static void setItemIconRegister(IIconRegister aIconRegister) { GregTech_API.sItemIcons = aIconRegister; } - } diff --git a/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java index fbae0b6752..712109b1eb 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java +++ b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java @@ -11,7 +11,8 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; + +import java.util.List; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT; @@ -36,10 +37,13 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank { addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 63, false, true, 1)); addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 26, 63, false, true, 1)); addSlotToContainer(new GT_Slot_Render(mTileEntity, 2, 107, 63)); + GT_MetaTileEntity_BasicMachine machine = (GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity(); + if (machine.allowSelectCircuit()) + addSlotToContainer(new GT_Slot_Render(mTileEntity, machine.getCircuitSlot(), 153, 63)); - int tStartIndex = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).getInputSlot(); + int tStartIndex = machine.getInputSlot(); - switch (((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mInputSlotCount) { + switch (machine.mInputSlotCount) { case 0: break; case 1: @@ -107,9 +111,9 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank { break; } - tStartIndex = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).getOutputSlot(); + tStartIndex = machine.getOutputSlot(); - switch (((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mOutputItems.length) { + switch (machine.mOutputItems.length) { case 0: break; case 1: @@ -182,19 +186,59 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank { addSlotToContainer(new GT_Slot_Render(mTileEntity, tStartIndex++, 53, 63)); } + private static int find(List aStacks, ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) + return -1; + for (int i = 0, aStacksSize = aStacks.size(); i < aStacksSize; i++) { + ItemStack tStack = aStacks.get(i); + if (GT_Utility.areStacksEqual(aStack, tStack)) + return i; + } + return -1; + } + @Override public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (mTileEntity.getMetaTileEntity() == null) return null; GT_MetaTileEntity_BasicMachine machine = (GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity(); if (machine == null) return null; ItemStack tResultStack; + System.out.printf("shift %d, index %d, mouse %d, client? %b\n", aShifthold, aSlotIndex, aMouseclick, mTileEntity.isClientSide()); switch (aSlotIndex) { case 0: machine.mFluidTransfer = !machine.mFluidTransfer; return null; case 1: - if (mTileEntity.getMetaTileEntity() == null) return null; machine.mItemTransfer = !machine.mItemTransfer; return null; + case 3: + if (machine.allowSelectCircuit() && aMouseclick < 2) { + ItemStack newCircuit; + if (aMouseclick == 1 && aShifthold == 1) { + // clear + newCircuit = null; + } else { + ItemStack cursorStack = aPlayer.inventory.getItemStack(); + List tCircuits = machine.getConfigurationCircuits(); + int index = find(tCircuits, cursorStack); + if (index < 0) { + int curIndex = find(tCircuits, machine.getStackInSlot(machine.getCircuitSlot())) + 1; + if (aMouseclick == 0) { + curIndex += 1; + } else { + curIndex -= 1; + } + curIndex = Math.floorMod(curIndex, tCircuits.size() + 1) - 1; + newCircuit = curIndex < 0 ? null : tCircuits.get(curIndex); + } else { + // set to whatever it is + newCircuit = tCircuits.get(index); + } + } + mTileEntity.setInventorySlotContents(machine.getCircuitSlot(), newCircuit); + return newCircuit; + } + return null; default: if (aSlotIndex == OTHER_SLOT_COUNT + 1 + machine.mInputSlotCount + machine.mOutputItems.length && aMouseclick < 2) { if (mTileEntity.isClientSide()) { @@ -255,12 +299,12 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank { @Override public int getSlotStartIndex() { - return 3; + return 4; } @Override public int getShiftClickStartIndex() { - return 3; + return 4; } @Override diff --git a/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java index e8810c14c0..79d3636068 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java +++ b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java @@ -28,6 +28,10 @@ public class GT_Container_BasicTank extends GT_ContainerMetaTile_Machine { super(aInventoryPlayer, aTileEntity); } + /** + * Subclasses must ensure third slot (aSlotIndex==2) is drainable fluid display item slot. + * Otherwise, subclasses must intercept the appropriate the slotClick event and call super.slotClick(2, xxx) if necessary + */ @Override public void addSlots(InventoryPlayer aInventoryPlayer) { addSlotToContainer(new Slot(mTileEntity, 0, 80, 17)); diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index bd2dbcd630..f2514f1290 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -270,7 +270,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE for (int i = 0; i < tItemList.tagCount(); i++) { NBTTagCompound tTag = tItemList.getCompoundTagAt(i); int tSlot = tTag.getInteger("IntSlot"); - tSlot = shiftInventoryIndex(tSlot, nbtVersion); + tSlot = migrateInventoryIndex(tSlot, nbtVersion); if (tSlot >= 0 && tSlot < mMetaTileEntity.getRealInventory().length) { mMetaTileEntity.getRealInventory()[tSlot] = GT_Utility.loadItem(tTag); } @@ -2309,9 +2309,13 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE * @param nbtVersion The GregTech version in which the original Inventory Index was saved. * @return The corrected Inventory index */ - private int shiftInventoryIndex(int slotIndex, int nbtVersion){ + private int migrateInventoryIndex(int slotIndex, int nbtVersion){ int oldInputSize, newInputSize, oldOutputSize, newOutputSize; int chemistryUpdateVersion = GT_Mod.calculateTotalGTVersion(509, 31); + int configCircuitAdditionVersion = GT_Mod.calculateTotalGTVersion(509, 40); + // 4 is old GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT + if (nbtVersion < configCircuitAdditionVersion && getMetaTileEntity() instanceof GT_MetaTileEntity_BasicMachine && slotIndex >= 4) + slotIndex += 1; if (mID >= 211 && mID <= 218) {//Assembler if (nbtVersion < chemistryUpdateVersion) { oldInputSize = 2; diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index b3c25ff345..3c499aea53 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -5,6 +5,8 @@ import appeng.me.helpers.AENetworkProxy; import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gnu.trove.list.TIntList; +import gnu.trove.list.array.TIntArrayList; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index e8cac808dd..8f77b6ac5a 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -31,6 +31,7 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; import java.util.Arrays; +import java.util.List; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.GT_Values.debugCleanroom; @@ -53,7 +54,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B DID_NOT_FIND_RECIPE = 0, FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2; - public static final int OTHER_SLOT_COUNT = 4; + public static final int OTHER_SLOT_COUNT = 5; public final ItemStack[] mOutputItems; public final int mInputSlotCount, mAmperage; public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false; @@ -694,8 +695,11 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B } protected ItemStack[] getAllInputs() { - ItemStack[] rInputs = new ItemStack[mInputSlotCount]; + int tRealInputSlotCount = this.mInputSlotCount + (allowSelectCircuit() ? 1 : 0); + ItemStack[] rInputs = new ItemStack[tRealInputSlotCount]; for (int i = 0; i < mInputSlotCount; i++) rInputs[i] = getInputAt(i); + if (allowSelectCircuit()) + rInputs[mInputSlotCount] = getStackInSlot(getCircuitSlot()); return rInputs; } @@ -850,6 +854,26 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B return mInventory[aIndex] == null; } + public boolean allowSelectCircuit() { + return false; + } + + /** + * This might be non-final in the future, but for now, no, don't change this. + */ + public final int getCircuitSlot() { + return 4; + } + + /** + * Return a list of possible configuration circuit this machine expects. + * + * This list is unmodifiable. Its elements are not supposed to be modified in any way! + */ + public List getConfigurationCircuits() { + return GregTech_API.getConfigurationCircuitList(); + } + /** * @return the Recipe List which is used for this Machine, this is a useful Default Handler */ diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java index 281d0f6541..7cd9fe65e1 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java @@ -813,6 +813,10 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ } } + @Override + public boolean allowSelectCircuit() { + return true; + } @Override public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java index 9cbdb2b832..4b7d294a25 100644 --- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java +++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java @@ -33,6 +33,9 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { ItemList.Circuit_Integrated.set(this); + for (int i = 1; i <= 24; i++) { + GregTech_API.registerConfigurationCircuit(new ItemStack(this, 0, i)); + } GT_ModHandler.addShapelessCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 0L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{OrePrefixes.circuit.get(Materials.Basic)}); long bits = GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE; -- cgit From 9082224a9e98b7c6149da5bc6f33ecbeae0403f3 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 1 Dec 2021 03:16:41 +0800 Subject: Remove debug message Signed-off-by: Glease <4586901+Glease@users.noreply.github.com> --- src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java index 712109b1eb..3c1d35c771 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java +++ b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java @@ -203,7 +203,6 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank { GT_MetaTileEntity_BasicMachine machine = (GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity(); if (machine == null) return null; ItemStack tResultStack; - System.out.printf("shift %d, index %d, mouse %d, client? %b\n", aShifthold, aSlotIndex, aMouseclick, mTileEntity.isClientSide()); switch (aSlotIndex) { case 0: machine.mFluidTransfer = !machine.mFluidTransfer; -- cgit