3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-19 04:50:06 +01:00

BUGFIX: Damage events should be using getDamage() to set damage.

Dieser Commit ist enthalten in:
Andrew Ardill 2011-02-28 17:43:56 +11:00
Ursprung 41fea9b40e
Commit 76d8016b32
2 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -370,6 +370,8 @@ public abstract class EntityHuman extends EntityLiving {
if (event.isCancelled()) { if (event.isCancelled()) {
return false; return false;
} }
i = event.getDamage();
} }
// CraftBukkit end // CraftBukkit end

Datei anzeigen

@ -124,12 +124,13 @@ public abstract class EntityLiving extends Entity {
CraftServer server = ((WorldServer) this.world).getServer(); CraftServer server = ((WorldServer) this.world).getServer();
org.bukkit.entity.Entity victim = this.getBukkitEntity(); org.bukkit.entity.Entity victim = this.getBukkitEntity();
DamageCause damageType = EntityDamageEvent.DamageCause.SUFFOCATION; 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); server.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
this.a((Entity) null, 1); this.a((Entity) null, event.getDamage());
} }
// CraftBukkit end // CraftBukkit end
} }