generated from MrSphay/codex-agent-repository-kit
42 lines
1.5 KiB
Java
42 lines
1.5 KiB
Java
/*
|
|
* 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.client.event.ClientTickEvent;
|
|
import net.neoforged.bus.api.SubscribeEvent;
|
|
import net.neoforged.fml.common.Mod;
|
|
import net.neoforged.fml.common.EventBusSubscriber;
|
|
|
|
@EventBusSubscriber(modid="explosionoverhaul", bus=EventBusSubscriber.Bus.GAME, value={Dist.CLIENT})
|
|
public class FirstTimeSetupHandler {
|
|
private static boolean hasChecked = false;
|
|
private static boolean pendingShowIntro = false;
|
|
|
|
@SubscribeEvent
|
|
public static void onClientTick(ClientTickEvent.Post event) {
|
|
Minecraft mc = Minecraft.getInstance();
|
|
if (!hasChecked && mc.screen instanceof TitleScreen) {
|
|
hasChecked = true;
|
|
if (!((Boolean)Config.CLIENT.introSetupComplete.get()).booleanValue()) {
|
|
pendingShowIntro = true;
|
|
}
|
|
}
|
|
if (pendingShowIntro && mc.screen instanceof TitleScreen) {
|
|
pendingShowIntro = false;
|
|
mc.setScreen(new FirstTimeScreen());
|
|
}
|
|
}
|
|
|
|
static {
|
|
ExplosionOverhaul.LOGGER.info("FirstTimeSetupHandler class loaded (waiting for TitleScreen)");
|
|
}
|
|
}
|