mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 06:57:30 +01:00
BUGFIX: Damage events should be using getDamage() to set damage.
This commit is contained in:
parent
41fea9b40e
commit
76d8016b32
2 changed files with 5 additions and 2 deletions
|
@ -370,6 +370,8 @@ public abstract class EntityHuman extends EntityLiving {
|
|||
if (event.isCancelled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
i = event.getDamage();
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
|
|
|
@ -124,12 +124,13 @@ public abstract class EntityLiving extends Entity {
|
|||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.entity.Entity victim = this.getBukkitEntity();
|
||||
DamageCause damageType = EntityDamageEvent.DamageCause.SUFFOCATION;
|
||||
int damage = 1;
|
||||
|
||||
EntityDamageEvent event = new EntityDamageEvent(victim, damageType, 1);
|
||||
EntityDamageEvent event = new EntityDamageEvent(victim, damageType, damage);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.a((Entity) null, 1);
|
||||
this.a((Entity) null, event.getDamage());
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue