Skip to content

Commit

Permalink
Merge pull request #9 from CalXee/patch-1
Browse files Browse the repository at this point in the history
Make the @ gray and italicized
  • Loading branch information
Genau6502 authored Jun 8, 2021
2 parents 44bf5fc + 335a928 commit 1536cc0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void sendMessageToGame(MinecraftServer server, MessageReceivedEvent even
String msg = event.getMessage().getContentDisplay();
int colour = Objects.requireNonNull(event.getMember()).getColorRaw();
Text message = new LiteralText(msg);
MutableText sender = new LiteralText("<@").append(new LiteralText(event.getMember().getEffectiveName()).styled(style -> style.withColor(TextColor.fromRgb(colour)))).append(new LiteralText("> "));
MutableText sender = new LiteralText("<§7§o@§r").append(new LiteralText(event.getMember().getEffectiveName()).styled(style -> style.withColor(TextColor.fromRgb(colour)))).append(new LiteralText("> "));
if (!event.getMessage().getAttachments().isEmpty()) {
event.getMessage().getAttachments().forEach(attachment -> server.getPlayerManager().broadcastChatMessage(sender.append(new LiteralText(attachment.getUrl()).styled(s -> s.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, attachment.getUrl())))), MessageType.SYSTEM, Util.NIL_UUID));
if (!msg.equals("")) server.getPlayerManager().broadcastChatMessage(sender.append(message), MessageType.SYSTEM, Util.NIL_UUID);
Expand Down

0 comments on commit 1536cc0

Please sign in to comment.