Skip to content

Commit

Permalink
stop config from corrupting
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jul 22, 2024
1 parent 03697f5 commit 82cec3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/polyfrost/hytils/config/HytilsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public class HytilsConfig extends Config {
description = "Choose what message is said on game completion.",
category = "Chat", subcategory = "Automatic"
)
public static String autoGGMessage = "gg";
public static String ggMessage = "gg";

@Slider(
name = "Auto GG First Phrase Delay",
Expand All @@ -182,7 +182,7 @@ public class HytilsConfig extends Config {
description = "Send a secondary message sent after the first GG message.",
category = "Chat", subcategory = "Automatic"
)
public static String autoGGMessage2 = "Have a good day!";
public static String ggMessage2 = "Have a good day!";

@Slider(
name = "Auto GG Second Phrase Delay",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public class AutoGG implements ChatReceiveModule {
public void onMessageReceived(@NotNull ClientChatReceivedEvent event) {
String message = EnumChatFormatting.getTextWithoutFormattingCodes(event.message.getUnformattedText());
if (!hasGameEnded(message)) return;
Multithreading.schedule(() -> UChat.say("/ac " + HytilsConfig.autoGGMessage), (long) (HytilsConfig.autoGGFirstPhraseDelay * 1000), TimeUnit.MILLISECONDS);
Multithreading.schedule(() -> UChat.say("/ac " + HytilsConfig.ggMessage), (long) (HytilsConfig.autoGGFirstPhraseDelay * 1000), TimeUnit.MILLISECONDS);
if (HytilsConfig.autoGGSecondMessage)
Multithreading.schedule(() -> UChat.say("/ac " + HytilsConfig.autoGGMessage2), (long) ((HytilsConfig.autoGGSecondPhraseDelay + HytilsConfig.autoGGFirstPhraseDelay) * 1000), TimeUnit.MILLISECONDS);
Multithreading.schedule(() -> UChat.say("/ac " + HytilsConfig.ggMessage2), (long) ((HytilsConfig.autoGGSecondPhraseDelay + HytilsConfig.autoGGFirstPhraseDelay) * 1000), TimeUnit.MILLISECONDS);
}

private boolean hasGameEnded(String message) {
Expand Down

0 comments on commit 82cec3e

Please sign in to comment.