Don't show the 1 minute grace period if forced
All checks were successful
/ deploy (push) Successful in 4m44s

This commit is contained in:
Minecon724 2024-12-01 19:34:09 +01:00
parent d55afa26ea
commit b53dfd096d
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -6,7 +6,6 @@
package eu.m724.tweaks.pomodoro; package eu.m724.tweaks.pomodoro;
import eu.m724.tweaks.TweaksConfig;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.BaseComponent; import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.ComponentBuilder;
@ -17,8 +16,6 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
public class Pomodoros { public class Pomodoros {
private static final boolean force = TweaksConfig.getConfig().pomodoroForce();
static final Map<UUID, PlayerPomodoro> timers = new HashMap<>(); static final Map<UUID, PlayerPomodoro> timers = new HashMap<>();
public static PlayerPomodoro get(Player player) { public static PlayerPomodoro get(Player player) {
@ -51,14 +48,8 @@ public class Pomodoros {
.append("%02d:%02d".formatted(remaining / 60, remaining % 60)) .append("%02d:%02d".formatted(remaining / 60, remaining % 60))
.color(ChatColor.GRAY); .color(ChatColor.GRAY);
} else { } else {
// TODO I think it's bad to put this here
if (force) {
remaining += 60;
} else {
remaining = 0;
}
builder builder
.append("%02d:%02d".formatted(remaining / 60, remaining % 60)) .append("00:00")
.color(remaining % 2 == 0 ? ChatColor.RED : ChatColor.YELLOW); .color(remaining % 2 == 0 ? ChatColor.RED : ChatColor.YELLOW);
} }
} }