Skip to content

Commit

Permalink
Fix time tower reminder not respecting config
Browse files Browse the repository at this point in the history
  • Loading branch information
Emirlol committed May 26, 2024
1 parent 8422b47 commit 382525b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mojang.brigadier.Message;
import de.hysky.skyblocker.SkyblockerMod;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.events.SkyblockEvents;
import de.hysky.skyblocker.utils.Constants;
import de.hysky.skyblocker.utils.Utils;
Expand Down Expand Up @@ -49,16 +50,17 @@ public static void checkIfTimeTower(Message message, boolean overlay) {
}

try (FileWriter writer = new FileWriter(tempFile)) {
writer.write(String.valueOf(System.currentTimeMillis()));
writer.write(String.valueOf(System.currentTimeMillis())); //Overwrites the file so no need to handle case where the file already exists and has text
} catch (IOException e) {
LOGGER.error("[Skyblocker Time Tower Reminder] Failed to write to temp file for Time Tower Reminder!", e);
}
}

private static void sendMessage() {
if (MinecraftClient.getInstance().player == null || !Utils.isOnSkyblock()) return;
MinecraftClient.getInstance().player.sendMessage(Constants.PREFIX.get().append(Text.literal("Your Chocolate Factory's Time Tower has deactivated!").formatted(Formatting.RED)));

if (SkyblockerConfigManager.get().helpers.chocolateFactory.enableTimeTowerReminder) {
MinecraftClient.getInstance().player.sendMessage(Constants.PREFIX.get().append(Text.literal("Your Chocolate Factory's Time Tower has deactivated!").formatted(Formatting.RED)));
}
File tempFile = SkyblockerMod.CONFIG_DIR.resolve(TIME_TOWER_FILE).toFile();
try {
scheduled = false;
Expand Down

0 comments on commit 382525b

Please sign in to comment.