summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft
diff options
context:
space:
mode:
authorspeakeasy <mekevin1917@gmail.com>2011-01-20 04:07:52 +0800
committertahg <tahgtahv@gmail.com>2011-01-20 04:17:38 +0800
commiteabdc7ffa9d9062389cd7608768e021c04151a98 (patch)
tree9e3e8b23cfd8731ccdf14c8e99ca738946b93c77 /src/main/java/net/minecraft
parentbdd3c4dabe7fdcb8a5e1e1225c2789999fac7c7d (diff)
downloadcraftbukkit-eabdc7ffa9d9062389cd7608768e021c04151a98.tar
craftbukkit-eabdc7ffa9d9062389cd7608768e021c04151a98.tar.gz
craftbukkit-eabdc7ffa9d9062389cd7608768e021c04151a98.tar.lz
craftbukkit-eabdc7ffa9d9062389cd7608768e021c04151a98.tar.xz
craftbukkit-eabdc7ffa9d9062389cd7608768e021c04151a98.zip
Fix for NPE with dispenser+arrow bug.
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r--src/main/java/net/minecraft/server/EntityArrow.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index d05f3d4f..11ae6954 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -176,7 +176,13 @@ public class EntityArrow extends Entity {
//TODO decide if we should create DamageCause.ARROW, DamageCause.PROJECTILE
// or leave as DamageCause.ENTITY_ATTACK
- EntityDamageByProjectileEvent edbpe = new EntityDamageByProjectileEvent(b.getBukkitEntity(), entity.getBukkitEntity(), this.getBukkitEntity(), EntityDamageEvent.DamageCause.ENTITY_ATTACK, 4);
+ org.bukkit.entity.Entity shooter = null;
+ if ((EntityLiving)b != null) {
+ shooter = new org.bukkit.craftbukkit.entity.CraftLivingEntity(server, b);
+ } else if ((Entity)b != null) {
+ shooter = (org.bukkit.entity.Entity) b.getBukkitEntity();
+ }
+ EntityDamageByProjectileEvent edbpe = new EntityDamageByProjectileEvent(shooter, entity.getBukkitEntity(), this.getBukkitEntity(), EntityDamageEvent.DamageCause.ENTITY_ATTACK, 4);
server.getPluginManager().callEvent(edbpe);
if(!edbpe.isCancelled()) {