Skip to content

Commit

Permalink
Update stats module to use verbose names
Browse files Browse the repository at this point in the history
Signed-off-by: William Jeffcock <[email protected]>
  • Loading branch information
dentmaged committed Feb 4, 2024
1 parent 26c5bf9 commit 2dbca19
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion core/src/main/java/tc/oc/pgm/loot/LootableMatchModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ public void onInventoryOpen(InventoryOpenEvent event) {
if (filterPredicate == null) return;

logger.fine(
() -> opener.getName() + " opened a " + inventory.getHolder().getClass().getSimpleName());
() ->
opener.getNameLegacy()
+ " opened a "
+ inventory.getHolder().getClass().getSimpleName());

// Find all Fillers that apply to the holder of the opened inventory
final List<FillerDefinition> fillers =
Expand Down
6 changes: 4 additions & 2 deletions core/src/main/java/tc/oc/pgm/stats/StatsMatchModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public void onStatsDisplay(MatchStatsEvent event) {
best.add(
translatable(
"match.stats.damage",
player(bestDamage.getKey(), NameStyle.FANCY),
player(bestDamage.getKey(), NameStyle.VERBOSE),
damageComponent(bestDamage.getValue(), NamedTextColor.GREEN)));
}
}
Expand Down Expand Up @@ -462,7 +462,9 @@ private Map.Entry<UUID, Double> sortStatsDouble(Map<UUID, Double> map) {
Component getMessage(
String messageKey, Map.Entry<UUID, ? extends Number> mapEntry, TextColor color) {
return translatable(
messageKey, player(mapEntry.getKey(), NameStyle.FANCY), number(mapEntry.getValue(), color));
messageKey,
player(mapEntry.getKey(), NameStyle.VERBOSE),
number(mapEntry.getValue(), color));
}

/** Formats raw damage to damage relative to the amount of hearths the player would have broken */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public ItemStack createItem(Player player) {
Component playerComponent =
stats.getPlayerComponent() != null
? stats.getPlayerComponent()
: player(uuid, NameStyle.FANCY);
: player(uuid, NameStyle.VERBOSE);

meta.setDisplayName(
TextTranslations.translateLegacy(
Expand Down

0 comments on commit 2dbca19

Please sign in to comment.