Files
Explosion-Overhaul/src/main/java/com/vinlanx/explosionoverhaul/client/IntroMusicTickHandler.java
MrSphay ee922ac831
Some checks failed
Build / build (push) Failing after 6m57s
Port first NeoForge API surface
2026-05-04 13:06:40 +02:00

31 lines
1.1 KiB
Java

/*
* 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;
import net.neoforged.fml.common.EventBusSubscriber;
@EventBusSubscriber(modid="explosionoverhaul", bus=EventBusSubscriber.Bus.GAME, value={Dist.CLIENT})
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);
}
}
}