aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java28
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java3
2 files changed, 24 insertions, 7 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
index 00cf42bae2..ee61956770 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java
@@ -8,7 +8,6 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-import gregtech.api.enums.Materials;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -25,10 +24,6 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur
private static final HashSet<Fluid> BLACKLIST = new HashSet<>();
- static {
- BLACKLIST.add(Materials.Helium.getPlasma(0).getFluid());
- }
-
public GT_MTE_LargeTurbine_Plasma(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
@@ -129,8 +124,16 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur
Float.MIN_NORMAL,
((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier()
* GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed
- * 50))
- * getSpeedMultiplier();
+ * 50));
+
+ // Calculate total EU/t (as shown on turbine tooltip (Fast mode doesn't affect))
+ double aEUPerTurbine = aTotalOptimalFlow * 40
+ * 0.0105
+ * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mPlasmaMultiplier
+ * (50.0f + (10.0f
+ * ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)));
+ aTotalOptimalFlow *= getSpeedMultiplier();
+
if (aTotalOptimalFlow < 0) {
log("Int overflow, report to issue tracker");
aTotalOptimalFlow = 100;
@@ -141,6 +144,7 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur
flowMultipliers[2] = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mPlasmaMultiplier;
baseEff = MathUtils.roundToClosestInt(aTotalBaseEff);
optFlow = MathUtils.roundToClosestInt(aTotalOptimalFlow);
+ euPerTurbine = MathUtils.roundToClosestInt(aEUPerTurbine);
if (optFlow <= 0 || baseEff <= 0) {
stopMachine(); // in case the turbine got removed
return false;
@@ -152,7 +156,17 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur
// How much the turbine should be producing with this flow
int newPower = fluidIntoPower(tFluids, optFlow, baseEff, flowMultipliers);
+
+ // Reduce produced power depending on the ratio between fuel value and turbine EU/t with the following
+ // formula:
+ // EU/t = EU/t * MIN(1, ( ( (FuelValue / 100) ^ 2 ) / EUPerTurbine))
+ int fuelValue = getFuelValue(new FluidStack(tFluids.get(0), 0));
+ float magicValue = (fuelValue * 0.01f) * (fuelValue * 0.01f);
+ float efficiencyLoss = Math.min(1.0f, magicValue / euPerTurbine);
+ newPower *= efficiencyLoss;
+
long difference = newPower - this.lEUt; // difference between current output and new output
+
// Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the
// difference in power level (per tick)
// This is how much the turbine can actually change during this tick
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java
index 90a4016f2f..28058a3eee 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java
@@ -57,6 +57,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends
protected int baseEff = 0;
protected long optFlow = 0;
+ protected long euPerTurbine = 0;
protected double realOptFlow = 0;
protected int storedFluid = 0;
protected int counter = 0;
@@ -101,6 +102,8 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends
.addInfo("Fast Mode increases speed to 48x instead of 16x, with some penalties")
.addInfo("Maintenance problems and turbine damage happen 12x as often in Fast Mode")
.addInfo("XL Steam Turbines can use Loose Mode with either Slow or Fast Mode")
+ .addInfo("Plasma fuel efficiency is lower for high tier turbines when using low-grade plasmas")
+ .addInfo("Efficiency = ((FuelValue / 100000)^2) / (EU per Turbine)")
.addPollutionAmount(getPollutionPerSecond(null)).addInfo("Pollution is 3x higher in Fast Mode")
.addSeparator().beginStructureBlock(7, 9, 7, false).addController("Top Middle")
.addCasingInfoMin(getCasingName(), 360, false).addCasingInfoMin("Rotor Shaft", 30, false)