Fix Electrolytic Breathing Unit working without water
@@ -44,6 +44,7 @@ public abstract class ModuleMekaSuit extends Module {
@Override
public void tickServer(PlayerEntity player) {
+ if (player.isInWater()) {
FloatingLong usage = MekanismConfig.general.FROM_H2.get().multiply(2);
long maxRate = Math.min(getMaxRate(), getContainerEnergy().divide(usage).intValue());
long hydrogenUsed = 0;
@@ -58,6 +59,7 @@ public abstract class ModuleMekaSuit extends Module {
useEnergy(player, usage.multiply(used));
player.setAir(player.getAir() + (int) oxygenUsed);
}
+ }
private int getMaxRate() {
return (int) Math.pow(2, getInstalledCount());
