Skip to content

Commit ddaadf2

Browse files
authored
Add socialSpyCmdFormat message key for command social spy (#6489)
Fixes #6049
1 parent 4db09f2 commit ddaadf2

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,10 +808,9 @@ public void handlePlayerCommandPreprocess(final PlayerCommandPreprocessEvent eve
808808
final ComponentHolder base = (user.isMuted() && ess.getSettings().getSocialSpyListenMutedPlayers())
809809
? spyer.tlComponent("socialSpyMutedPrefix")
810810
: spyer.tlComponent("socialSpyPrefix");
811-
final ComponentHolder nameComponent = ess.getAdventureFacet().legacyToAdventure(playerName);
812-
final ComponentHolder messageComponent = ess.getAdventureFacet().text(": " + event.getMessage());
811+
final ComponentHolder formatted = ess.getAdventureFacet().deserializeMiniMessage(spyer.playerTl("socialSpyCmdFormat", playerName, event.getMessage()));
813812

814-
spyer.sendComponent(ess.getAdventureFacet().append(base, nameComponent, messageComponent));
813+
spyer.sendComponent(ess.getAdventureFacet().append(base, formatted));
815814
}
816815
}
817816
}

Essentials/src/main/resources/messages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,7 @@ slimeMalformedSize=<dark_red>Malformed size.
12341234
smithingtableCommandDescription=Opens up a smithing table.
12351235
smithingtableCommandUsage=/<command>
12361236
socialSpy=<primary>SocialSpy for <secondary>{0}<primary>\: <secondary>{1}
1237+
socialSpyCmdFormat=<gray>{0}\: {1}
12371238
socialSpyMsgFormat=<primary>[<secondary>{0}<gray> -> <secondary>{1}<primary>] <gray>{2}
12381239
socialSpyMutedPrefix=<white>[<primary>SS<white>] <gray>(muted) <reset>
12391240
socialspyCommandDescription=Toggles if you can see msg/mail commands in chat.

Essentials/src/main/resources/messages_en.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,7 @@ slimeMalformedSize=<dark_red>Malformed size.
12251225
smithingtableCommandDescription=Opens up a smithing table.
12261226
smithingtableCommandUsage=/<command>
12271227
socialSpy=<primary>SocialSpy for <secondary>{0}<primary>\: <secondary>{1}
1228+
socialSpyCmdFormat=<gray>{0}\: {1}
12281229
socialSpyMsgFormat=<primary>[<secondary>{0}<gray> -> <secondary>{1}<primary>] <gray>{2}
12291230
socialSpyMutedPrefix=<white>[<primary>SS<white>] <gray>(muted) <reset>
12301231
socialspyCommandDescription=Toggles if you can see msg/mail commands in chat.

0 commit comments

Comments
 (0)