From b2af70e5c7b228efb2a7cdb429d5f2a96bf31fa0 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 11 Dec 2011 16:05:27 +0000 Subject: [PATCH] Implemented getKiller in LivingEntity --- src/main/java/net/minecraft/server/EntityLiving.java | 2 +- .../org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index 40a9f5bc0a..f4e2414d6d 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -56,7 +56,7 @@ public abstract class EntityLiving extends Entity { public float aC; public float aD; public float aE; - protected EntityHuman aF = null; + public EntityHuman aF = null; // CraftBukkit - prot to pub - "killer" protected int aG = 0; public int aH = 0; public int aI = 0; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index ee476d04f4..baf7ee5f17 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -15,6 +15,7 @@ import org.bukkit.block.Block; import org.bukkit.entity.Arrow; import org.bukkit.entity.Egg; import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; import org.bukkit.entity.Snowball; import org.bukkit.entity.Vehicle; import org.bukkit.util.BlockIterator; @@ -24,6 +25,7 @@ import java.util.HashSet; import java.util.ArrayList; import java.util.Iterator; import net.minecraft.server.DamageSource; +import net.minecraft.server.EntityHuman; import org.bukkit.entity.HumanEntity; public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -223,4 +225,8 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public String toString() { return "CraftLivingEntity{" + "id=" + getEntityId() + '}'; } + + public Player getKiller() { + return getHandle().aF == null ? null : (Player)getHandle().aF.getBukkitEntity(); + } }