2026-05-04 12:09:37 +02:00
|
|
|
/*
|
|
|
|
|
* Decompiled with CFR 0.152.
|
|
|
|
|
*/
|
|
|
|
|
package com.vinlanx.explosionoverhaul.client;
|
|
|
|
|
|
|
|
|
|
import com.vinlanx.explosionoverhaul.client.IntroMusicManager;
|
|
|
|
|
import net.neoforged.api.distmarker.Dist;
|
|
|
|
|
import net.neoforged.neoforge.event.TickEvent;
|
|
|
|
|
import net.neoforged.bus.api.SubscribeEvent;
|
|
|
|
|
import net.neoforged.fml.common.Mod;
|
2026-05-04 13:06:40 +02:00
|
|
|
import net.neoforged.fml.common.EventBusSubscriber;
|
2026-05-04 12:09:37 +02:00
|
|
|
|
2026-05-04 13:06:40 +02:00
|
|
|
@EventBusSubscriber(modid="explosionoverhaul", bus=EventBusSubscriber.Bus.GAME, value={Dist.CLIENT})
|
2026-05-04 12:09:37 +02:00
|
|
|
public class IntroMusicTickHandler {
|
|
|
|
|
private static long lastTickTime = System.currentTimeMillis();
|
|
|
|
|
|
|
|
|
|
@SubscribeEvent
|
|
|
|
|
public static void onClientTick(TickEvent.ClientTickEvent event) {
|
|
|
|
|
if (event.phase != TickEvent.Phase.END) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
IntroMusicManager musicManager = IntroMusicManager.getInstance();
|
|
|
|
|
if (musicManager.isPlaying() || musicManager.isFadingOut()) {
|
|
|
|
|
long currentTime = System.currentTimeMillis();
|
|
|
|
|
float deltaTime = (float)(currentTime - lastTickTime) / 1000.0f;
|
|
|
|
|
lastTickTime = currentTime;
|
|
|
|
|
musicManager.tick(deltaTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|