Skip to content

Commit

Permalink
Change click event yet again to send run a command to send in chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Emirlol committed Nov 1, 2024
1 parent cf9ad00 commit 2a971dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

/**
* <p>A helper class for the Math Teachers that can spawn after killing Primal Fears in the Great Spook event.</p>
* <p>It only shows the result and allows for easily copying rather than sending the result to chat to not breach any hypixel rules.</p>
*/
public final class MathTeacherHelper {
@Init
Expand All @@ -24,7 +23,7 @@ public static void init() {
}

/**
* Appends the result of the math expression to the message and a copy to clipboard text for, well, copying the result to the clipboard.
* Appends the result of the math expression to the message and a send in chat text that, well, sends the result in chat.
*/
public static Text onMessage(Text message, boolean overlay) {
if (overlay) return message;
Expand All @@ -41,11 +40,11 @@ public static Text onMessage(Text message, boolean overlay) {
.append(Text.literal(result)
.formatted(Formatting.AQUA))
.append(ScreenTexts.SPACE)
.append(Text.translatable("text.skyblocker.clickToSuggest")
.append(Text.translatable("text.skyblocker.clickToSend")
.formatted(Formatting.GREEN)
.styled(style ->
style.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, result))
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Constants.PREFIX.get().append(Text.translatable("text.skyblocker.clickToSuggest.@Tooltip"))))
style.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ac " + result))
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Constants.PREFIX.get().append(Text.translatable("text.skyblocker.clickToSend.@Tooltip"))))
));
} catch (Exception e) {
return message;
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/skyblocker/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"text.skyblocker.translate": "Translate",
"text.skyblocker.modrinth": "Modrinth",
"text.skyblocker.discord": "Discord",
"text.skyblocker.clickToSuggest": "[Click To Suggest In Chat]",
"text.skyblocker.clickToSuggest.@Tooltip": "Click to suggest this in chat.",
"text.skyblocker.clickToSend": "[Click To Send In Chat]",
"text.skyblocker.clickToSend.@Tooltip": "Click to send this in chat.",

"skyblocker.skyblockerScreen": "Skyblocker Main Screen",

Expand Down

0 comments on commit 2a971dd

Please sign in to comment.