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,58 @@
/*
* Decompiled with CFR 0.152.
*/
package com.vinlanx.explosionoverhaul.mixin;
import com.mojang.blaze3d.audio.Channel;
import com.vinlanx.explosionoverhaul.client.LowPassConcussionEffect;
import com.vinlanx.explosionoverhaul.client.SoundEngineAudioQueue;
import com.vinlanx.explosionoverhaul.client.SoundPhysicsCompatibility;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value={Channel.class})
public class ChannelLowpassMixin {
@Shadow
@Final
private int f_83642_;
@Inject(method={"play"}, at={@At(value="HEAD")})
private void onPlay(CallbackInfo ci) {
try {
boolean active = LowPassConcussionEffect.isActive();
if ("Sound engine".equals(Thread.currentThread().getName())) {
SoundEngineAudioQueue.drainNow();
}
if (active) {
SoundEngineAudioQueue.enqueueAudio(() -> LowPassConcussionEffect.attachFilterToSource(this.f_83642_));
if ("Sound engine".equals(Thread.currentThread().getName())) {
SoundEngineAudioQueue.drainNow();
}
}
}
catch (Throwable throwable) {
// empty catch block
}
}
@Inject(method={"stop"}, at={@At(value="HEAD")})
private void onStop(CallbackInfo ci) {
if (SoundPhysicsCompatibility.isCompatibilityEnabled()) {
SoundPhysicsCompatibility.onSourceStop(this.f_83642_);
}
try {
SoundEngineAudioQueue.enqueueAudio(() -> LowPassConcussionEffect.detachFilterFromSource(this.f_83642_));
if ("Sound engine".equals(Thread.currentThread().getName())) {
SoundEngineAudioQueue.drainNow();
}
}
catch (Throwable throwable) {
// empty catch block
}
}
}