Add some safety against and so that very small numbers don't end up becoming zero due to precision or configs being set to zero
@@ -265,9 +265,16 @@ public class ItemMekaSuitArmor extends ArmorItem implements IModuleContainerItem
IEnergyContainer energyContainer = StorageUtils.getEnergyContainer(stack, 0);
if (energyContainer != null && amount > 0) {
float toAbsorb = amount * absorption;
+ if (toAbsorb > 0) {
FloatingLong usage = MekanismConfig.gear.mekaSuitEnergyUsageDamage.get().multiply(toAbsorb);
+ if (usage.isZero()) {
+ //No energy is actually needed to absorb the damage, either because of the config
+ // or how small the amount to absorb is
+ return absorption;
+ }
return absorption * energyContainer.extract(usage, Action.EXECUTE, AutomationType.MANUAL).divide(usage).floatValue();
}
+ }
return 0;
}
