2017-10-05 15:38:21 +02:00
|
|
|
From e1494a3b11e1ee5bf25e227cb8a7118234101ffd Mon Sep 17 00:00:00 2001
|
2017-08-24 21:18:41 +02:00
|
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
|
|
Date: Mon, 31 Jul 2017 01:49:48 -0500
|
|
|
|
Subject: [PATCH] LivingEntity#setKiller
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
index 1eafdecb4..f81622a34 100644
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
@@ -256,6 +256,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
|
|
return getHandle().killer == null ? null : (Player) getHandle().killer.getBukkitEntity();
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public void setKiller(Player killer) {
|
|
|
|
+ EntityPlayer entityPlayer = killer == null ? null : ((CraftPlayer) killer).getHandle();
|
|
|
|
+ getHandle().killer = entityPlayer;
|
|
|
|
+ getHandle().lastDamager = entityPlayer;
|
|
|
|
+ getHandle().lastDamageByPlayerTime = entityPlayer == null ? 0 : 100; // 100 value taken from EntityLiving#damageEntity
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
public boolean addPotionEffect(PotionEffect effect) {
|
|
|
|
return addPotionEffect(effect, false);
|
|
|
|
}
|
|
|
|
--
|
2017-10-05 15:38:21 +02:00
|
|
|
2.14.2
|
2017-08-24 21:18:41 +02:00
|
|
|
|