Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 19:10:09 +01:00
7c2dc4b342
* finish implementing all adventure components in codecs * add some initial tests * Add round trip tests for text and translatable components * Add more round trip test data (score component is failing) * Add more round trip test data * Fix SCORE_COMPONENT_MAP_CODEC * Improve test failure messages * Add failure cases * Add a couple more test data * Make use of AdventureCodecs * Update patches after rebase * Squash changes into adventure patch * Fix AT formatting * update comment --------- Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
25 Zeilen
1.6 KiB
Diff
25 Zeilen
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
|
|
Date: Mon, 21 Jun 2021 21:24:45 -0400
|
|
Subject: [PATCH] Add TameableDeathMessageEvent
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
|
|
index 8f085654f3b9c540346fe4e56c71d572da7a897c..1999cda5876bb12283d8c91a1b3e737c0d27bc38 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
|
|
@@ -197,7 +197,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
|
|
@Override
|
|
public void die(DamageSource damageSource) {
|
|
if (!this.level().isClientSide && this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
|
|
- this.getOwner().sendSystemMessage(this.getCombatTracker().getDeathMessage());
|
|
+ // Paper start - 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()) {
|
|
+ this.getOwner().sendSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.deathMessage()));
|
|
+ }
|
|
+ // Paper end - TameableDeathMessageEvent
|
|
}
|
|
|
|
super.die(damageSource);
|