Paper/Spigot-Server-Patches/0207-LivingEntity-setKiller.patch

31 lines
1.3 KiB
Diff
Raw Normal View History

2018-07-23 10:39:55 +02:00
From 60f41c74b9da92c99db52fdbb77e577b5cd83bf1 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
2018-07-23 10:39:55 +02:00
index bd2d90349e..524cfd99b7 100644
2017-08-24 21:18:41 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
2018-07-20 21:57:43 +02:00
@@ -255,6 +255,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
2017-08-24 21:18:41 +02:00
return getHandle().killer == null ? null : (Player) getHandle().killer.getBukkitEntity();
}
+ // Paper start
+ @Override
+ public void setKiller(Player killer) {
+ net.minecraft.server.EntityPlayer entityPlayer = killer == null ? null : ((CraftPlayer) killer).getHandle();
2017-08-24 21:18:41 +02: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);
}
--
2.18.0
2017-08-24 21:18:41 +02:00