blob: 2eab4e30c39c15b335eb512ce1790f5841a4c3e2 [file] [log] [blame] [raw]
package com.legacy.aether.client;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import com.legacy.aether.client.audio.music.AetherMusicTicker;
import com.legacy.aether.client.gui.AetherLoadingScreen;
import com.legacy.aether.server.AetherConfig;
public class ClientTickHandler
{
private Minecraft mc = Minecraft.getMinecraft();
private AetherMusicTicker musicTicker = new AetherMusicTicker(mc);
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) throws Exception
{
TickEvent.Phase phase = event.phase;
TickEvent.Type type = event.type;
if (phase == TickEvent.Phase.END)
{
if (type.equals(TickEvent.Type.CLIENT))
{
if (!(mc.loadingScreen instanceof AetherLoadingScreen))
{
mc.loadingScreen = new AetherLoadingScreen(mc);
}
if (!mc.isGamePaused() && mc.thePlayer != null && mc.thePlayer.dimension == AetherConfig.getAetherDimensionID())
{
musicTicker.update();
}
}
}
}
}