2018-12-15 01:17:27 +00:00
|
|
|
From bd1155c27e1a0fa98e542d14396d71befd73985d Mon Sep 17 00:00:00 2001
|
2017-08-24 19:18:41 +00: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
|
2018-10-27 04:02:22 +00:00
|
|
|
index 716eda990..2f96842bb 100644
|
2017-08-24 19:18:41 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2018-10-27 04:02:22 +00:00
|
|
|
@@ -278,6 +278,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
2017-08-24 19:18:41 +00:00
|
|
|
return getHandle().killer == null ? null : (Player) getHandle().killer.getBukkitEntity();
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public void setKiller(Player killer) {
|
2018-01-05 07:30:03 +00:00
|
|
|
+ net.minecraft.server.EntityPlayer entityPlayer = killer == null ? null : ((CraftPlayer) killer).getHandle();
|
2017-08-24 19:18:41 +00:00
|
|
|
+ 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);
|
|
|
|
}
|
|
|
|
--
|
2018-12-15 01:17:27 +00:00
|
|
|
2.20.0
|
2017-08-24 19:18:41 +00:00
|
|
|
|