make update message stay for 30s
All checks were successful
/ Build BaseBand (push) Successful in 3m9s

This commit is contained in:
Daniella / Tove 2024-10-04 23:17:56 +02:00
parent e72db8f9ff
commit 091c8c2ca6
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
2 changed files with 11 additions and 3 deletions

View file

@ -110,9 +110,13 @@ public class BaseBand {
}
public static void notify(String text) {
notify(text, 10000);
}
public static void notify(String text, int time) {
Client c = Features.getFeature(Client.class);
if(Features.isFeatureEnabled(HUD.class) && c.notificationDest != Client.NotificationDest.Chat) {
HUD.notifs.add(new NotificationRender.Notification(text));
HUD.notifs.add(new NotificationRender.Notification(text, time));
if(c.notificationDest == Client.NotificationDest.Both)
Chat.print(text);
else
@ -122,8 +126,12 @@ public class BaseBand {
}
public static void notifyAll(String text) {
notifyAll(text, 10000);
}
public static void notifyAll(String text, int time) {
if(Features.isFeatureEnabled(HUD.class)) {
HUD.notifs.add(new NotificationRender.Notification(text));
HUD.notifs.add(new NotificationRender.Notification(text, time));
}
Chat.print(text);
}

View file

@ -80,7 +80,7 @@ public class WebServiceClient {
BaseBand.LOGGER.info("Connected to BaseBand server");
if(!packet.getString("commit").equals(GitHash.GIT_HASH) && !outdated) {
outdated = true;
BaseBand.notify("§d§lBaseBand has updated. To update, restart Minecraft.");
BaseBand.notifyAll("§d§lBaseBand has updated. To update, restart Minecraft.", 30000);
}
}
}