Skip to content

Commit

Permalink
allow decimals in phrase delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jun 22, 2024
1 parent 34e1ea9 commit 60043c0
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 @@ -176,7 +176,7 @@ public class HytilsConfig extends Config {
category = "Chat", subcategory = "Automatic",
min = 0, max = 5
)
public static int autoGGFirstPhraseDelay = 1;
public static float autoGGFirstPhraseDelay = 1;

@Dropdown(
name = "Auto GG Second Message",
Expand All @@ -192,7 +192,7 @@ public class HytilsConfig extends Config {
category = "Chat", subcategory = "Automatic",
min = 0, max = 5
)
public static int autoGGSecondPhraseDelay = 1;
public static float autoGGSecondPhraseDelay = 1;

@Switch(
name = "Auto GL",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ private static String getGGMessageTwo() {
public void onMessageReceived(@NotNull ClientChatReceivedEvent event) {
String message = EnumChatFormatting.getTextWithoutFormattingCodes(event.message.getUnformattedText());
if (!hasGameEnded(message)) return;
Multithreading.schedule(() -> UChat.say("/ac " + getGGMessageOne()), HytilsConfig.autoGGFirstPhraseDelay, TimeUnit.SECONDS);
Multithreading.schedule(() -> UChat.say("/ac " + getGGMessageOne()), (long) (HytilsConfig.autoGGFirstPhraseDelay * 1000), TimeUnit.MILLISECONDS);
if (HytilsConfig.autoGGSecondMessage)
Multithreading.schedule(() -> UChat.say("/ac " + getGGMessageTwo()), HytilsConfig.autoGGSecondPhraseDelay + HytilsConfig.autoGGFirstPhraseDelay, TimeUnit.SECONDS);
Multithreading.schedule(() -> UChat.say("/ac " + getGGMessageTwo()), (long) ((HytilsConfig.autoGGSecondPhraseDelay + HytilsConfig.autoGGFirstPhraseDelay) * 1000), TimeUnit.MILLISECONDS);
}

private boolean hasGameEnded(String message) {
Expand Down

0 comments on commit 60043c0

Please sign in to comment.