Skip to content

Commit

Permalink
Fix it not working when chat is opened prior to the msg being sent
Browse files Browse the repository at this point in the history
  • Loading branch information
AzureAaron committed Dec 21, 2024
1 parent 20644ca commit 9ddf1e4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public class ConfirmationPromptHelper {
public static void init() {
ClientReceiveMessageEvents.GAME.register(ConfirmationPromptHelper::onMessage);
ScreenEvents.AFTER_INIT.register((_client, screen, _scaledWidth, _scaledHeight) -> {
if (Utils.isOnSkyblock() && screen instanceof ChatScreen && SkyblockerConfigManager.get().chat.confirmationPromptHelper && hasCommand()) {
//Don't check for the command being present in case the user opens the chat before the prompt is sent
if (Utils.isOnSkyblock() && screen instanceof ChatScreen && SkyblockerConfigManager.get().chat.confirmationPromptHelper) {
ScreenMouseEvents.beforeMouseClick(screen).register((_screen1, _mouseX, _mouseY, _button) -> {
if (hasCommand()) {
MessageScheduler.INSTANCE.sendMessageAfterCooldown(command);
Expand Down

0 comments on commit 9ddf1e4

Please sign in to comment.