Files
Explosion-Overhaul/src/main/java/com/vinlanx/explosionoverhaul/client/FirstTimeSetupHandler.java
MrSphay 062d69fcd5
All checks were successful
Build / build (push) Successful in 10m52s
Restore setup screen and force visible explosion behavior
2026-05-07 23:08:09 +02:00

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)");
}
}