Stub blur and blacklist client screens
Some checks failed
Build / build (push) Failing after 6m31s

This commit is contained in:
MrSphay
2026-05-07 00:34:56 +02:00
parent 5819bb2520
commit 75482c4e51
3 changed files with 25 additions and 771 deletions

View File

@@ -1,66 +1,12 @@
/*
* Decompiled with CFR 0.152.
*/
package com.vinlanx.explosionoverhaul.client;
import com.vinlanx.explosionoverhaul.ModSounds;
import com.vinlanx.explosionoverhaul.client.Blur;
import com.vinlanx.explosionoverhaul.client.DeafnessConcussionEffect;
import com.vinlanx.explosionoverhaul.client.FadingMusicInstance;
import com.vinlanx.explosionoverhaul.client.LowPassConcussionEffect;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.sounds.SoundInstance;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundSource;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import net.neoforged.neoforge.event.TickEvent;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.common.EventBusSubscriber;
@OnlyIn(value=Dist.CLIENT)
@EventBusSubscriber(modid="explosionoverhaul", value={Dist.CLIENT})
public class ConcussionSoundManager {
private static FadingMusicInstance currentLowSound = null;
public static void startLowSound(float volume) {
}
@SubscribeEvent
public static void onClientTick(TickEvent.ClientTickEvent event) {
if (event.phase != TickEvent.Phase.END) {
return;
}
Minecraft mc = Minecraft.getInstance();
if (mc.f_91073_ == null || mc.player == null) {
if (currentLowSound != null) {
mc.m_91106_().m_120399_((SoundInstance)currentLowSound);
currentLowSound = null;
}
return;
}
if (mc.m_91104_()) {
return;
}
boolean deafness = DeafnessConcussionEffect.isActive();
boolean lowpass = LowPassConcussionEffect.isActive();
boolean blur = Blur.isActive();
float targetVolume = 0.0f;
if (blur) {
if (deafness) {
targetVolume = 1.0f;
} else if (lowpass) {
targetVolume = 0.4f;
}
}
if (targetVolume > 0.0f) {
if (currentLowSound == null || !mc.m_91106_().m_120403_((SoundInstance)currentLowSound)) {
currentLowSound = new FadingMusicInstance((SoundEvent)ModSounds.LOW_SOUND.get(), 0.01f, SoundSource.MASTER);
currentLowSound.fadeTo(targetVolume, 1.0f);
mc.m_91106_().m_120367_((SoundInstance)currentLowSound);
} else if (Math.abs(currentLowSound.getCurrentVolume() - targetVolume) > 0.01f && !currentLowSound.hasFinishedFading()) {
currentLowSound.fadeTo(targetVolume, 0.5f);
}
} else if (currentLowSound != null && mc.m_91106_().m_120403_((SoundInstance)currentLowSound) && !currentLowSound.hasFinishedFading()) {
currentLowSound.fadeOutAndStop(1.0f);
}
public static void stopLowSound() {
}
public static void tick() {
}
}