2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
|
|
Date: Mon, 31 Jul 2017 01:49:48 -0500
|
|
|
|
Subject: [PATCH] LivingEntity#setKiller
|
|
|
|
|
2022-11-20 00:53:20 +01:00
|
|
|
== AT ==
|
|
|
|
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2023-12-25 23:51:56 +01:00
|
|
|
index b93d03c1af8b82c009c3f6007cc30e888f6764e0..f1195a4dd11370066008aaf6c7c4a8b4d628d822 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2023-12-25 23:51:56 +01:00
|
|
|
@@ -364,6 +364,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
2021-06-12 13:18:01 +02:00
|
|
|
return this.getHandle().lastHurtByPlayer == null ? null : (Player) this.getHandle().lastHurtByPlayer.getBukkitEntity();
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public void setKiller(Player killer) {
|
2022-09-12 13:31:45 +02:00
|
|
|
+ net.minecraft.server.level.ServerPlayer entityPlayer = killer == null ? null : ((CraftPlayer) killer).getHandle();
|
2021-06-11 14:02:28 +02:00
|
|
|
+ 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) {
|
2021-06-12 13:18:01 +02:00
|
|
|
return this.addPotionEffect(effect, false);
|