Decompile upstream Explosion Overhaul 0.2.3.0

This commit is contained in:
Gitea Runner
2026-05-04 10:03:58 +00:00
commit a8b3d372d7
212 changed files with 31516 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
/*
* Decompiled with CFR 0.152.
*/
package com.vinlanx.explosionoverhaul;
import net.minecraftforge.client.event.sound.PlaySoundEvent;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
public class ClientSoundHandler {
private static boolean suppressVanillaExplosionSound = false;
private static int suppressionTicksRemaining = 0;
public static void setSuppressVanillaExplosionSound(boolean suppress, int durationTicks) {
suppressVanillaExplosionSound = suppress;
suppressionTicksRemaining = durationTicks;
}
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
if (event.phase == TickEvent.Phase.END) {
if (suppressionTicksRemaining > 0) {
--suppressionTicksRemaining;
} else if (suppressionTicksRemaining == 0 && suppressVanillaExplosionSound) {
suppressVanillaExplosionSound = false;
}
}
}
@SubscribeEvent(priority=EventPriority.HIGH)
public void onExplosionSound(PlaySoundEvent event) {
if (event.getSound() != null && event.getSound().m_7904_().m_135815_().equals("entity.generic.explode") && suppressVanillaExplosionSound) {
event.setSound(null);
}
}
}