mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 04:02:50 +01:00
Made snowmen in rain or water fire EntityDamage events with DamageCause DROWNING. Fixes BUKKIT-1165
This commit is contained in:
parent
373afd1b22
commit
2a4167d8a5
1 changed files with 6 additions and 1 deletions
|
@ -33,7 +33,12 @@ public class EntitySnowman extends EntityGolem {
|
|||
public void e() {
|
||||
super.e();
|
||||
if (this.aS()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1);
|
||||
EntityDamageEvent event = new EntityDamageEvent(this.getBukkitEntity(), EntityDamageEvent.DamageCause.DROWNING, 1);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.damageEntity(DamageSource.DROWN, event.getDamage());
|
||||
}
|
||||
}
|
||||
|
||||
int i = MathHelper.floor(this.locX);
|
||||
|
|
Loading…
Reference in a new issue