generated from MrSphay/codex-agent-repository-kit
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.vinlanx.explosionoverhaul.client;
|
||||
|
||||
import com.vinlanx.explosionoverhaul.Config;
|
||||
import com.vinlanx.explosionoverhaul.ExplosionOverhaul;
|
||||
import com.vinlanx.explosionoverhaul.client.IntroSplashScreen;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.gui.screens.TitleScreen;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.neoforge.event.TickEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
|
||||
@Mod.EventBusSubscriber(modid="explosionoverhaul", bus=Mod.EventBusSubscriber.Bus.FORGE, value={Dist.CLIENT})
|
||||
public class FirstTimeSetupHandler {
|
||||
private static boolean hasChecked = false;
|
||||
private static boolean pendingShowIntro = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onClientTick(TickEvent.ClientTickEvent event) {
|
||||
if (event.phase != TickEvent.Phase.END) {
|
||||
return;
|
||||
}
|
||||
Minecraft mc = Minecraft.m_91087_();
|
||||
if (!hasChecked && mc.f_91080_ instanceof TitleScreen) {
|
||||
hasChecked = true;
|
||||
ExplosionOverhaul.LOGGER.info("Detected TitleScreen on client, hasChecked=true");
|
||||
if (Config.isFirstLaunch()) {
|
||||
pendingShowIntro = true;
|
||||
}
|
||||
}
|
||||
if (!pendingShowIntro) {
|
||||
return;
|
||||
}
|
||||
if (mc.f_91080_ instanceof TitleScreen) {
|
||||
pendingShowIntro = false;
|
||||
ExplosionOverhaul.LOGGER.info("Showing IntroSplashScreen (first launch)");
|
||||
mc.m_91152_((Screen)new IntroSplashScreen());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
ExplosionOverhaul.LOGGER.info("FirstTimeSetupHandler class loaded (waiting for TitleScreen)");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user