2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
|
|
|
|
|
|
|
|
2019-05-06 02:58:04 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2020-06-25 01:10:30 +00:00
|
|
|
index 28d873d8fe7bb79d2a84eb9bf234ac8ba0223813..ca2620548c7c80beab09554b96d8e55e499614f8 100644
|
2019-05-06 02:58:04 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2019-12-11 23:43:22 +00:00
|
|
|
@@ -80,7 +80,7 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
public float aL;
|
|
|
|
public float aM;
|
2019-05-06 02:58:04 +00:00
|
|
|
public EntityHuman killer;
|
|
|
|
- protected int lastDamageByPlayerTime;
|
|
|
|
+ public int lastDamageByPlayerTime; // Paper - protected -> public
|
|
|
|
protected boolean killed;
|
|
|
|
protected int ticksFarFromPlayer;
|
2019-12-11 23:43:22 +00:00
|
|
|
protected float aR;
|
2017-08-24 19:18:41 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2020-05-06 09:48:49 +00:00
|
|
|
index da86ee41499b02959755328544307aed39752483..1760dfa7a312b63d7608d890c977452ad995d7ae 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
|
2020-02-25 18:57:15 +00:00
|
|
|
@@ -318,6 +318,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
|
|
|
|
+
|
2019-05-06 02:58:04 +00:00
|
|
|
@Override
|
2017-08-24 19:18:41 +00:00
|
|
|
public boolean addPotionEffect(PotionEffect effect) {
|
|
|
|
return addPotionEffect(effect, false);
|