Fix MtE burn not awarded for outer battery

This commit is contained in:
DBotThePony 2021-08-24 19:16:44 +07:00
parent dc76513dc8
commit e7b810f1a8
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -389,6 +389,10 @@ public class AndroidCapability implements ICapabilityProvider, IAndroidCapabilit
howMuch = howMuch.subtract(changed, MatteryCapability.ROUND_RULES);
if (howMuch.compareTo(BigDecimal.ZERO) <= 0) {
if (!simulate && ent instanceof ServerPlayer ply) {
ply.awardStat(Registry.Names.POWER_CONSUMED, drained.intValue() * 10);
}
return drained;
}
}
@ -405,6 +409,10 @@ public class AndroidCapability implements ICapabilityProvider, IAndroidCapabilit
howMuch = howMuch.subtract(changed, MatteryCapability.ROUND_RULES);
if (howMuch.compareTo(BigDecimal.ZERO) <= 0) {
if (!simulate && ent instanceof ServerPlayer ply) {
ply.awardStat(Registry.Names.POWER_CONSUMED, drained.intValue() * 10);
}
return drained;
}
}