fix splash being shown twice

This commit is contained in:
Julian Krings 2025-06-23 12:20:43 +02:00
parent 80548f753c
commit 0a0f77ff58
No known key found for this signature in database
GPG Key ID: 208C6E08C3B718D2
2 changed files with 11 additions and 7 deletions

View File

@ -470,7 +470,7 @@ public class Iris extends VolmitPlugin implements Listener {
ServerConfigurator.configure(); ServerConfigurator.configure();
IrisSafeguard.IrisSafeguardSystem(); IrisSafeguard.IrisSafeguardSystem();
getSender().setTag(getTag()); getSender().setTag(getTag());
IrisSafeguard.earlySplash(); IrisSafeguard.splash(true);
linkMultiverseCore = new MultiverseCoreLink(); linkMultiverseCore = new MultiverseCoreLink();
linkMythicMobs = new MythicMobsLink(); linkMythicMobs = new MythicMobsLink();
configWatcher = new FileWatcher(getDataFile("settings.json")); configWatcher = new FileWatcher(getDataFile("settings.json"));
@ -485,8 +485,7 @@ public class Iris extends VolmitPlugin implements Listener {
J.sr(this::tickQueue, 0); J.sr(this::tickQueue, 0);
J.s(this::setupPapi); J.s(this::setupPapi);
J.a(ServerConfigurator::configure, 20); J.a(ServerConfigurator::configure, 20);
splash(); IrisSafeguard.splash(false);
UtilsSFG.splash();
autoStartStudio(); autoStartStudio();
checkForBukkitWorlds(); checkForBukkitWorlds();

View File

@ -3,7 +3,10 @@ package com.volmit.iris.core.safeguard;
import com.volmit.iris.Iris; import com.volmit.iris.Iris;
import com.volmit.iris.core.IrisSettings; import com.volmit.iris.core.IrisSettings;
import java.util.concurrent.atomic.AtomicBoolean;
public class IrisSafeguard { public class IrisSafeguard {
private static final AtomicBoolean sfg = new AtomicBoolean(false);
public static boolean unstablemode = false; public static boolean unstablemode = false;
public static boolean warningmode = false; public static boolean warningmode = false;
public static boolean stablemode = false; public static boolean stablemode = false;
@ -13,12 +16,14 @@ public class IrisSafeguard {
ServerBootSFG.BootCheck(); ServerBootSFG.BootCheck();
} }
public static void earlySplash() { public static void splash(boolean early) {
if (ServerBootSFG.safeguardPassed || IrisSettings.get().getGeneral().DoomsdayAnnihilationSelfDestructMode) if (early && (ServerBootSFG.safeguardPassed || IrisSettings.get().getGeneral().DoomsdayAnnihilationSelfDestructMode))
return; return;
Iris.instance.splash(); if (!sfg.getAndSet(true)) {
UtilsSFG.splash(); Iris.instance.splash();
UtilsSFG.splash();
}
} }
public static String mode() { public static String mode() {