Skip to content

Commit 29bb5a9

Browse files
authored
Add PlayerDeathEvent#getPlayer for clarity (#6859)
1 parent c20c9d3 commit 29bb5a9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

patches/api/0149-Improve-death-events.patch

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,25 @@ index a5984ab06cce95d30e70511e125f69339b574c04..e19a3df9aa2204b44c0b029bda141ae6
179179
+ }
180180
+ // Paper end
181181
}
182+
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
183+
index a01d4c21bedc7f1a54f5a330bb4c2909ce3a18e4..48f272747b8d5ab43f79a9d474713aca79f121b7 100644
184+
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
185+
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
186+
@@ -63,6 +63,17 @@ public class PlayerDeathEvent extends EntityDeathEvent {
187+
}
188+
189+
// Paper start
190+
+ /**
191+
+ * Clarity method for getting the player. Not really needed except
192+
+ * for reasons of clarity.
193+
+ *
194+
+ * @return Player who is involved in this event
195+
+ */
196+
+ @NotNull
197+
+ public Player getPlayer() {
198+
+ return getEntity();
199+
+ }
200+
+
201+
/**
202+
* Set the death message that will appear to everyone on the server.
203+
*

0 commit comments

Comments
 (0)