mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-03 05:26:50 +01:00
Implemented getKiller in LivingEntity
This commit is contained in:
parent
1fc8092ea6
commit
b2af70e5c7
2 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue