mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-20 03:59:37 +00:00
Prevent Osmium Compressor and Combiner from using secondary energy upgrades.
Also make them deterministic again to prevent them getting stuck
This commit is contained in:
1 parent
0819c0ad5f
commit
17f9f88b34
4 files changed
+50
-13
No files matched your search
@@ -99,7 +99,21 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
||||
|
||||
boolean changed = false;
|
||||
|
||||
if(canOperate() && MekanismUtils.canFunction(this) && getEnergy() >= MekanismUtils.getEnergyPerTick(this, ENERGY_PER_TICK) && gasTank.getStored() >= (int)MekanismUtils.getSecondaryEnergyPerTick(this, SECONDARY_ENERGY_PER_TICK))
|
||||
double secondaryToUse = SECONDARY_ENERGY_PER_TICK;
|
||||
|
||||
if(upgradeableSecondaryEfficiency())
|
||||
{
|
||||
secondaryToUse = MekanismUtils.getSecondaryEnergyPerTickMean(this, SECONDARY_ENERGY_PER_TICK);
|
||||
}
|
||||
|
||||
int actualSecondaryToUse = (int)Math.ceil(secondaryToUse);
|
||||
|
||||
if(useStatisticalMechanics())
|
||||
{
|
||||
actualSecondaryToUse = StatUtils.inversePoisson(secondaryToUse);
|
||||
}
|
||||
|
||||
if(canOperate() && MekanismUtils.canFunction(this) && getEnergy() >= MekanismUtils.getEnergyPerTick(this, ENERGY_PER_TICK) && gasTank.getStored() >= actualSecondaryToUse)
|
||||
{
|
||||
setActive(true);
|
||||
|
||||
@@ -112,7 +126,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
||||
operatingTicks = 0;
|
||||
}
|
||||
|
||||
gasTank.draw(StatUtils.inversePoisson(MekanismUtils.getSecondaryEnergyPerTickMean(this, SECONDARY_ENERGY_PER_TICK)), true);
|
||||
gasTank.draw(actualSecondaryToUse, true);
|
||||
electricityStored -= MekanismUtils.getEnergyPerTick(this, ENERGY_PER_TICK);
|
||||
}
|
||||
else {
|
||||
@@ -178,6 +192,16 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
||||
}
|
||||
}
|
||||
|
||||
public boolean upgradeableSecondaryEfficiency()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean useStatisticalMechanics()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slotID, ItemStack itemstack)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user