diff options
Diffstat (limited to 'patches/unapplied/server/0146-LivingEntity-setKiller.patch')
-rw-r--r-- | patches/unapplied/server/0146-LivingEntity-setKiller.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/patches/unapplied/server/0146-LivingEntity-setKiller.patch b/patches/unapplied/server/0146-LivingEntity-setKiller.patch new file mode 100644 index 0000000000..1a07e6b288 --- /dev/null +++ b/patches/unapplied/server/0146-LivingEntity-setKiller.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath <[email protected]> +Date: Mon, 31 Jul 2017 01:49:48 -0500 +Subject: [PATCH] LivingEntity#setKiller + +== AT == +public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +index 6bb32e4eab357c5f67a3daafa2de035b0d125635..452fe788152f7c38ab4b6c627e3ba37da3d9b9d9 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +@@ -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); |