mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-03 01:10:37 +01:00
e15167251b
* Drop original implementation for old player sample API * Add extended PaperServerListPingEvent Add a new event that extends the original ServerListPingEvent and allows full control of the response sent to the client. * Implement deprecated player sample API
31 lines
1.3 KiB
Diff
31 lines
1.3 KiB
Diff
From a3a43308ff532e716ed9c416bc8c437b271e90cf 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
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
index d4d51688c..a7b076377 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -252,6 +252,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
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();
|
|
+ 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.16.2
|
|
|