diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-21 00:50:35 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-21 00:50:35 +0100 |
commit | e4d58faf5bb89bb4dd89d713e31431688c760e83 (patch) | |
tree | 968a2b71ddcd5301f4f8b37be954e8fc0ecf3b19 /src/main/java/net | |
parent | a0216584b0d9e22f133535375f05a19b92f9b5b0 (diff) | |
download | craftbukkit-e4d58faf5bb89bb4dd89d713e31431688c760e83.tar craftbukkit-e4d58faf5bb89bb4dd89d713e31431688c760e83.tar.gz craftbukkit-e4d58faf5bb89bb4dd89d713e31431688c760e83.tar.lz craftbukkit-e4d58faf5bb89bb4dd89d713e31431688c760e83.tar.xz craftbukkit-e4d58faf5bb89bb4dd89d713e31431688c760e83.zip |
Fixed NPE when players are killed by (for example) dispensers
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java b/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java new file mode 100644 index 00000000..b6d310d3 --- /dev/null +++ b/src/main/java/net/minecraft/server/EntityDamageSourceIndirect.java @@ -0,0 +1,22 @@ +package net.minecraft.server; + +public class EntityDamageSourceIndirect extends EntityDamageSource { + + private Entity n; + + public EntityDamageSourceIndirect(String s, Entity entity, Entity entity1) { + super(s, entity); + this.n = entity1; + } + + public Entity getEntity() { + return this.n; + } + + public String a(EntityHuman entityhuman) { + // CraftBukkit start + String source = (this.n == null) ? "Herobrine" : this.n.Y(); + return StatisticCollector.a("death." + this.m, new Object[] { entityhuman.name, source}); + // CraftBukkit end + } +}
\ No newline at end of file |