Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default getName() NameStyle to VERBOSE #1296

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion util/src/main/java/tc/oc/pgm/util/named/Named.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public interface Named {
Component getName(NameStyle style);

default Component getName() {
return getName(NameStyle.FANCY);
return getName(NameStyle.VERBOSE);
}

// TODO: Maybe add a note here explaining to prefer Named#getName()
Expand Down
Loading