Add PlayerDeathEvent#getPlayer for clarity (#6859)

This commit is contained in:
HexedHero 2021-11-05 16:30:44 +00:00 committed by GitHub
parent c20c9d39d3
commit 29bb5a90ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.
*