Migrate client tick subscribers
All checks were successful
Build / build (push) Successful in 11m0s

This commit is contained in:
2026-05-07 15:15:33 +02:00
parent a4274380cb
commit aeef00f24d
4 changed files with 13 additions and 15 deletions

View File

@@ -4,7 +4,7 @@
package com.vinlanx.explosionoverhaul;
import net.neoforged.neoforge.client.event.sound.PlaySoundEvent;
import com.vinlanx.explosionoverhaul.compat.TickEvent;
import net.neoforged.neoforge.client.event.ClientTickEvent;
import net.neoforged.bus.api.EventPriority;
import net.neoforged.bus.api.SubscribeEvent;
@@ -18,13 +18,11 @@ public class ClientSoundHandler {
}
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
if (event.phase == TickEvent.Phase.END) {
if (suppressionTicksRemaining > 0) {
--suppressionTicksRemaining;
} else if (suppressionTicksRemaining == 0 && suppressVanillaExplosionSound) {
suppressVanillaExplosionSound = false;
}
public void onClientTick(ClientTickEvent.Post event) {
if (suppressionTicksRemaining > 0) {
--suppressionTicksRemaining;
} else if (suppressionTicksRemaining == 0 && suppressVanillaExplosionSound) {
suppressVanillaExplosionSound = false;
}
}

View File

@@ -10,7 +10,7 @@ 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 com.vinlanx.explosionoverhaul.compat.TickEvent;
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;
@@ -21,7 +21,7 @@ public class FirstTimeSetupHandler {
private static boolean pendingShowIntro = false;
@SubscribeEvent
public static void onClientTick(TickEvent.ClientTickEvent event) {
public static void onClientTick(ClientTickEvent.Post event) {
}
static {

View File

@@ -5,7 +5,7 @@ package com.vinlanx.explosionoverhaul.client;
import com.vinlanx.explosionoverhaul.client.IntroMusicManager;
import net.neoforged.api.distmarker.Dist;
import com.vinlanx.explosionoverhaul.compat.TickEvent;
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;
@@ -15,10 +15,7 @@ public class IntroMusicTickHandler {
private static long lastTickTime = System.currentTimeMillis();
@SubscribeEvent
public static void onClientTick(TickEvent.ClientTickEvent event) {
if (event.phase != TickEvent.Phase.END) {
return;
}
public static void onClientTick(ClientTickEvent.Post event) {
IntroMusicManager musicManager = IntroMusicManager.getInstance();
if (musicManager.isPlaying() || musicManager.isFadingOut()) {
long currentTime = System.currentTimeMillis();