cleanup player death event adventure logic (#10095)

There was a TODO left there regarding the translated death
message being used by plugins to identify the cause of death. This
should be mitigated now because the LegacyComponentSerializer default
implemenation uses our custom flattener which renders vanilla
translatable components to their English representation.
This commit is contained in:
Jake Potrebic
2023-12-29 12:28:58 -08:00
parent e1faa8e814
commit ee6a9c50d8
7 changed files with 76 additions and 78 deletions

View File

@@ -183,20 +183,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
@@ -0,0 +0,0 @@ public class PlayerDeathEvent extends EntityDeathEvent {
return (Player) entity;
}
// Paper start
+ // Paper start - improve death events
+ /**
+ * 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();
+ public @NotNull Player getPlayer() {
+ return this.getEntity();
+ }
+
+ // Paper end - improve death events
+
// Paper start - adventure
/**
* Set the death message that will appear to everyone on the server.
*