mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
LivingEntity#setKiller
== AT == public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
This commit is contained in:
parent
0dcb203960
commit
c2f10d08a9
@ -417,6 +417,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return this.getHandle().lastHurtByPlayer == null ? null : (Player) this.getHandle().lastHurtByPlayer.getBukkitEntity();
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public void setKiller(Player killer) {
|
||||
net.minecraft.server.level.ServerPlayer entityPlayer = killer == null ? null : ((CraftPlayer) killer).getHandle();
|
||||
getHandle().lastHurtByPlayer = entityPlayer;
|
||||
getHandle().lastHurtByMob = entityPlayer;
|
||||
getHandle().lastHurtByPlayerTime = entityPlayer == null ? 0 : 100; // 100 value taken from EntityLiving#damageEntity
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@Override
|
||||
public boolean addPotionEffect(PotionEffect effect) {
|
||||
return this.addPotionEffect(effect, false);
|
||||
|
Loading…
Reference in New Issue
Block a user