2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
|
|
|
|
|
|
|
|
2019-05-06 04:58:04 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2020-06-25 15:11:48 +02:00
|
|
|
index 34f2821a64c7893ff0a8c33ae4b77ce883227f0c..7ec1a572efd99928e8aae9b75c0eed73430aa337 100644
|
2019-05-06 04:58:04 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
2020-06-25 15:11:48 +02:00
|
|
|
@@ -86,7 +86,7 @@ public abstract class EntityLiving extends Entity {
|
2019-12-12 00:43:22 +01:00
|
|
|
public float aL;
|
2020-06-25 15:11:48 +02:00
|
|
|
@Nullable
|
2019-05-06 04:58:04 +02:00
|
|
|
public EntityHuman killer;
|
|
|
|
- protected int lastDamageByPlayerTime;
|
|
|
|
+ public int lastDamageByPlayerTime; // Paper - protected -> public
|
|
|
|
protected boolean killed;
|
|
|
|
protected int ticksFarFromPlayer;
|
2020-06-25 15:11:48 +02:00
|
|
|
protected float aQ;
|
2017-08-24 21:18:41 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2020-06-25 16:09:55 +02:00
|
|
|
index d5b165e8275c012d775b77b8440489716a6c3c08..5e2642b33d36e0695d6adc879f9595030adaaf31 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
|
2020-06-25 16:09:55 +02:00
|
|
|
@@ -321,6 +321,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) {
|
2018-01-05 08:30:03 +01:00
|
|
|
+ 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
|
|
|
|
+
|
2019-05-06 04:58:04 +02:00
|
|
|
@Override
|
2017-08-24 21:18:41 +02:00
|
|
|
public boolean addPotionEffect(PotionEffect effect) {
|
|
|
|
return addPotionEffect(effect, false);
|