mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 18:37:35 +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
@ -33,7 +33,12 @@ public class EntitySnowman extends EntityGolem {
|
|||||||
public void e() {
|
public void e() {
|
||||||
super.e();
|
super.e();
|
||||||
if (this.aS()) {
|
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);
|
int i = MathHelper.floor(this.locX);
|
||||||
|
Loading…
Reference in New Issue
Block a user