diff options
author | feildmaster <admin@feildmaster.com> | 2012-06-03 08:23:30 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-07-03 14:09:51 -0500 |
commit | 3b42b1d170d8c1a9d7174461981b6c0ad4e0ba87 (patch) | |
tree | 5c1ab8d91045f128e0caea28289158f257d34b93 /src/main/java | |
parent | 16d0694dcf9f44d329f1ed17ad97084ffc7afcdf (diff) | |
download | bukkit-3b42b1d170d8c1a9d7174461981b6c0ad4e0ba87.tar bukkit-3b42b1d170d8c1a9d7174461981b6c0ad4e0ba87.tar.gz bukkit-3b42b1d170d8c1a9d7174461981b6c0ad4e0ba87.tar.lz bukkit-3b42b1d170d8c1a9d7174461981b6c0ad4e0ba87.tar.xz bukkit-3b42b1d170d8c1a9d7174461981b6c0ad4e0ba87.zip |
Don't "setLastDamageCause" in the DamageEvent constructor. Addresses BUKKIT-1881
This is now done after the event to allow you to be able to get previous damageCauses, and is now only applied if the event is not canceled.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/command/defaults/KillCommand.java | 1 | ||||
-rw-r--r-- | src/main/java/org/bukkit/event/entity/EntityDamageEvent.java | 7 |
2 files changed, 1 insertions, 7 deletions
diff --git a/src/main/java/org/bukkit/command/defaults/KillCommand.java b/src/main/java/org/bukkit/command/defaults/KillCommand.java index e9d6f2a7..0deff08c 100644 --- a/src/main/java/org/bukkit/command/defaults/KillCommand.java +++ b/src/main/java/org/bukkit/command/defaults/KillCommand.java @@ -24,6 +24,7 @@ public class KillCommand extends VanillaCommand { Bukkit.getPluginManager().callEvent(ede); if (ede.isCancelled()) return true; + ede.getEntity().setLastDamageCause(ede); player.damage(ede.getDamage()); } else { sender.sendMessage("You can only perform this command as a player"); diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java index 2fa2c465..f059b407 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java @@ -1,6 +1,5 @@ package org.bukkit.event.entity; -import org.bukkit.entity.ComplexEntityPart; import org.bukkit.entity.Entity; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; @@ -18,12 +17,6 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { super(damagee); this.cause = cause; this.damage = damage; - - if (damagee instanceof ComplexEntityPart) { - ((ComplexEntityPart) damagee).getParent().setLastDamageCause(this); - } else { - damagee.setLastDamageCause(this); - } } public boolean isCancelled() { |