Skip to content

Commit e9a363e

Browse files
committed
Allow custom PLAYER_REPUTATION as bar or number
1 parent 60fcedf commit e9a363e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/main/java/adhdmc/villagerinfo/VillagerHandling/ComponentHandler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ public static Component villagerRestocks(Villager villager) {
214214
public static Component villagerPlayerReputation(Reputation reputation) {
215215
Component villagerReputationFinal;
216216
int reputationRawTotal = reputationTotal(reputation);
217-
String playerReputation = ReputationHandler.villagerReputation(reputationRawTotal);
218-
villagerReputationFinal = miniMessage.deserialize(VIMessage.PLAYER_REPUTATION.getMessage(), Placeholder.unparsed("reputation", playerReputation));
217+
villagerReputationFinal = miniMessage.deserialize(
218+
VIMessage.PLAYER_REPUTATION.getMessage(),
219+
Placeholder.unparsed("reputation", ReputationHandler.villagerReputation(reputationRawTotal)),
220+
Placeholder.unparsed("reputation_number", String.valueOf(reputationRawTotal)));
219221
return villagerReputationFinal;
220222

221223
}

src/main/resources/locale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"VILLAGER_SLEPT": "<#05bff7><hover:show_text:'<aqua>Last Slept: <grey><sleeptime>'>[<#c4fff7>Last Slept</#c4fff7>]"
2222
"VILLAGER_INVENTORY": "<#05bff7><hover:show_text:'<aqua>Inventory: <grey><contents>'>[<#c4fff7>Villager Inventory</#c4fff7>]"
2323
"INVENTORY_CONTENTS": "\n • <lang:item.minecraft.<item>> (<amount>)"
24-
"PLAYER_REPUTATION": "<#05bff7><hover:show_text:'<#05bff7>[<#c4fff7>Player Reputation</#c4fff7>]'><reputation>"
24+
"PLAYER_REPUTATION": "<#05bff7><hover:show_text:'<#05bff7>[<#c4fff7>Player Reputation</#c4fff7>]'><reputation>" # <reputation> or <reputation_number>
2525
"TRUE": "<grey>True"
2626
"FALSE": "<grey>False"
2727
"NONE": "<grey>None"

0 commit comments

Comments
 (0)