From 29bb5a90edfa53e47b26b3e780bf26cf99b1071e Mon Sep 17 00:00:00 2001 From: HexedHero <6012891+HexedHero@users.noreply.github.com> Date: Fri, 5 Nov 2021 16:30:44 +0000 Subject: [PATCH] Add PlayerDeathEvent#getPlayer for clarity (#6859) --- patches/api/0149-Improve-death-events.patch | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/patches/api/0149-Improve-death-events.patch b/patches/api/0149-Improve-death-events.patch index f42921460c..de70d5fff4 100644 --- a/patches/api/0149-Improve-death-events.patch +++ b/patches/api/0149-Improve-death-events.patch @@ -179,3 +179,25 @@ index a5984ab06cce95d30e70511e125f69339b574c04..e19a3df9aa2204b44c0b029bda141ae6 + } + // Paper end } +diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java +index a01d4c21bedc7f1a54f5a330bb4c2909ce3a18e4..48f272747b8d5ab43f79a9d474713aca79f121b7 100644 +--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java ++++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java +@@ -63,6 +63,17 @@ public class PlayerDeathEvent extends EntityDeathEvent { + } + + // Paper start ++ /** ++ * Clarity method for getting the player. Not really needed except ++ * for reasons of clarity. ++ * ++ * @return Player who is involved in this event ++ */ ++ @NotNull ++ public Player getPlayer() { ++ return getEntity(); ++ } ++ + /** + * Set the death message that will appear to everyone on the server. + *