summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r--src/main/java/net/minecraft/server/Entity.java2
-rw-r--r--src/main/java/net/minecraft/server/EntityEnderDragon.java1
-rw-r--r--src/main/java/net/minecraft/server/EntityEnderPearl.java1
-rw-r--r--src/main/java/net/minecraft/server/Explosion.java5
4 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index a925d5e3..c7a67cfa 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -804,6 +804,7 @@ public abstract class Entity {
}
i = event.getDamage();
+ event.getEntity().setLastDamageCause(event);
}
// CraftBukkit end
this.damageEntity(DamageSource.FIRE, i);
@@ -1449,6 +1450,7 @@ public abstract class Entity {
return;
}
+ thisBukkitEntity.setLastDamageCause(event);
this.burn(event.getDamage());
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
index 68a44808..9c7c14b2 100644
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
@@ -402,6 +402,7 @@ public class EntityEnderDragon extends EntityComplex {
Bukkit.getPluginManager().callEvent(damageEvent);
if (!damageEvent.isCancelled()) {
+ entity.getBukkitEntity().setLastDamageCause(damageEvent);
entity.damageEntity(DamageSource.mobAttack(this), damageEvent.getDamage());
}
} else {
diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java
index 7be7bbda..4e66b050 100644
--- a/src/main/java/net/minecraft/server/EntityEnderPearl.java
+++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java
@@ -67,6 +67,7 @@ public class EntityEnderPearl extends EntityProjectile {
if (!damageEvent.isCancelled()) {
org.bukkit.entity.Player bPlayer = Bukkit.getPlayerExact(((EntityPlayer) this.shooter).name);
((CraftPlayer) bPlayer).getHandle().invulnerableTicks = -1; // Remove spawning invulnerability.
+ bPlayer.setLastDamageCause(damageEvent);
((CraftPlayer) bPlayer).getHandle().damageEntity(DamageSource.FALL, damageEvent.getDamage()); // Damage the new player instead of the old
}
}
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index ebf4a478..3fc462bb 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -137,9 +137,7 @@ public class Explosion {
if (damagee == null) {
// nothing was hurt
- } else if (this.source == null) { // Block explosion
- // TODO: get the x/y/z of the tnt block?
- // does this even get called ever? @see EntityTNTPrimed - not BlockTNT or whatever
+ } else if (this.source == null) { // Block explosion (without an entity source; bed etc.)
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(null, damagee, EntityDamageEvent.DamageCause.BLOCK_EXPLOSION, damageDone);
Bukkit.getPluginManager().callEvent(event);
@@ -162,6 +160,7 @@ public class Explosion {
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
+ entity.getBukkitEntity().setLastDamageCause(event);
entity.damageEntity(DamageSource.EXPLOSION, event.getDamage());
entity.motX += d0 * d10;