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

View file

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