Skip to content

Commit

Permalink
Fallback to %killer% if the killer is not player when using `%kille…
Browse files Browse the repository at this point in the history
…r_display%`
  • Loading branch information
Dreeam-qwq committed Feb 8, 2025
1 parent cc81481 commit 32c2f3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,8 @@ public static Component playerDeathPlaceholders(Component msg, PlayerManager pm,
if (mob instanceof Player) {
Player p = (Player) mob;
msg = msg.replaceText(Util.replace("%killer_display%", Util.getPlayerDisplayName(p)));
} else {
msg = msg.replaceText(Util.replace("%killer_display%", mobName)); // Fallback to mob name if not player
}
}

Expand Down Expand Up @@ -1070,6 +1072,8 @@ public static String playerDeathPlaceholders(String msg, PlayerManager pm, Entit
if (mob instanceof Player) {
Player p = (Player) mob;
msg = msg.replaceAll("%killer_display%", Util.getPlayerDisplayName(p));
} else {
msg = msg.replaceAll("%killer_display%", mobName); // Fallback to mob name if not player
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,8 @@ public static Component playerDeathPlaceholders(Component msg, PlayerManager pm,
if (mob instanceof Player) {
Player p = (Player) mob;
msg = msg.replaceText(Util.replace("%killer_display%", Util.getPlayerDisplayNameComponent(p)));
} else {
msg = msg.replaceText(Util.replace("%killer_display%", mobName)); // Fallback to mob name if not player
}
}

Expand Down Expand Up @@ -1054,6 +1056,8 @@ public static String playerDeathPlaceholders(String msg, PlayerManager pm, Entit
if (mob instanceof Player) {
Player p = (Player) mob;
msg = msg.replaceAll("%killer_display%", Util.getPlayerDisplayName(p));
} else {
msg = msg.replaceAll("%killer_display%", mobName); // Fallback to mob name if not player
}
}

Expand Down

0 comments on commit 32c2f3a

Please sign in to comment.