Skip to content

Commit

Permalink
Minor Edit, Comment Cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
MeAlam1 committed Nov 24, 2024
1 parent f375eb2 commit 80de2a1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ neoforge/.gradle/*
neoforge/runs/*
neoforge/run/*
build/reports/problems/problems-report.html
build/tmp/spotless-register-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ private static String escapeRegex(String pInput) {
* </p>
*
* @param pMessage {@link Component} - The message component containing the text to format.
* @return A {@link MutableComponent} with the Markdown formatting applied.
* @author MeAlam
* @since 1.1.0
*/
public static MutableComponent parseMarkdown(Component pMessage, ServerPlayer pPlayer) {
public static MutableComponent parseMarkdown(Component pMessage) {
if (!globalMarkdownEnabled) {
BaseLogger.log(BaseLogLevel.INFO, "Global markdown is disabled, returning original message", true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class ChatHandler {
*/
public static boolean onAllowChat(PlayerChatMessage pPlayerChatMessage, ServerPlayer pServerPlayer, ChatType.Bound pBound) {
Component originalMessage = pPlayerChatMessage.decoratedContent();
Component formattedMessage = MarkdownParser.parseMarkdown(originalMessage, pServerPlayer);
Component formattedMessage = MarkdownParser.parseMarkdown(originalMessage);
if (!formattedMessage.equals(originalMessage)) {
PlayerChatMessage newPlayerChatMessage = new PlayerChatMessage(
pPlayerChatMessage.link(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class ChatHandler {
@SubscribeEvent
public static void onServerChat(ServerChatEvent pEvent) {
Component originalMessage = pEvent.getMessage();
Component formattedMessage = MarkdownParser.parseMarkdown(originalMessage, pEvent.getPlayer());
Component formattedMessage = MarkdownParser.parseMarkdown(originalMessage);
pEvent.setMessage(formattedMessage);
}
}

0 comments on commit 80de2a1

Please sign in to comment.