Also emulate damage sound when drowning

This commit is contained in:
KennyTV 2020-11-15 14:21:32 +01:00
parent 9fbfcb3851
commit 0f631eb1d9
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -20,9 +20,12 @@ public class FireDamageListener extends ViaBukkitListener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onFireDamage(EntityDamageEvent event) {
if (event.getEntityType() != EntityType.PLAYER) return;
if (event.getCause() != EntityDamageEvent.DamageCause.FIRE
&& event.getCause() != EntityDamageEvent.DamageCause.FIRE_TICK
&& event.getCause() != EntityDamageEvent.DamageCause.LAVA) {
EntityDamageEvent.DamageCause cause = event.getCause();
if (cause != EntityDamageEvent.DamageCause.FIRE
&& cause != EntityDamageEvent.DamageCause.FIRE_TICK
&& cause != EntityDamageEvent.DamageCause.LAVA
&& cause != EntityDamageEvent.DamageCause.DROWNING) {
return;
}