package net.halbear.aotg.utility;

import net.halbear.aotg.AgeoftheGods;
import net.halbear.aotg.rendering.skybox.DistantSkyObject;
import net.minecraft.client.Minecraft;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.client.event.ClientTickEvent;

@EventBusSubscriber(modid = AgeoftheGods.MODID, value = Dist.CLIENT)
public class ClientEventHandler {

    @SubscribeEvent
    public static void onClientTick(ClientTickEvent.Pre event) {
        Minecraft mc = Minecraft.getInstance();
        if (mc.level != null && mc.player != null) {
            DistantSkyObject.TickUpdate(mc.level.dimension());
        }
    }
}
