Implemented getKiller in LivingEntity

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot 2011-12-11 16:05:27 +00:00
parent a163a97e1c
commit dd1048102f

View file

@ -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();
}
}