mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Add TameableDeathMessageEvent
This commit is contained in:
parent
30ccd487cf
commit
8f23a7f6af
1 changed files with 15 additions and 1 deletions
|
@ -31,7 +31,21 @@
|
|||
}
|
||||
|
||||
return false;
|
||||
@@ -295,7 +308,14 @@
|
||||
@@ -244,7 +257,12 @@
|
||||
if (entityliving instanceof ServerPlayer) {
|
||||
ServerPlayer entityplayer = (ServerPlayer) entityliving;
|
||||
|
||||
- entityplayer.sendSystemMessage(this.getCombatTracker().getDeathMessage());
|
||||
+ // Paper start - Add TameableDeathMessageEvent
|
||||
+ io.papermc.paper.event.entity.TameableDeathMessageEvent event = new io.papermc.paper.event.entity.TameableDeathMessageEvent((org.bukkit.entity.Tameable) getBukkitEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getCombatTracker().getDeathMessage()));
|
||||
+ if (event.callEvent()) {
|
||||
+ entityplayer.sendSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.deathMessage()));
|
||||
+ }
|
||||
+ // Paper end - Add TameableDeathMessageEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -295,7 +313,14 @@
|
||||
if (!this.canTeleportTo(new BlockPos(x, y, z))) {
|
||||
return false;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue