Fix sonic boom duration ticking below zero

This commit is contained in:
davchoo 2022-05-31 15:15:15 -04:00
parent 365f8cf7e3
commit 2e3e7c6949
No known key found for this signature in database
GPG Key ID: A0168C8E45799B7D
1 changed files with 6 additions and 3 deletions

View File

@ -80,9 +80,12 @@ public class WardenEntity extends MonsterEntity implements Tickable {
session.sendUpstreamPacket(packet);
}
if (--sonicBoomTickDuration == 0) {
setFlag(EntityFlag.SONIC_BOOM, false);
updateBedrockMetadata();
if (sonicBoomTickDuration > 0) {
sonicBoomTickDuration--;
if (sonicBoomTickDuration == 0) {
setFlag(EntityFlag.SONIC_BOOM, false);
updateBedrockMetadata();
}
}
}