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,51 @@
/*
* Decompiled with CFR 0.152.
*/
package com.vinlanx.explosionoverhaul.client;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
public final class SoundEngineAudioQueue {
private static final Queue<Runnable> QUEUE = new ConcurrentLinkedQueue<Runnable>();
private SoundEngineAudioQueue() {
}
public static void enqueueAudio(Runnable task) {
if (task == null) {
return;
}
if (SoundEngineAudioQueue.isSoundThread()) {
try {
task.run();
}
catch (Throwable t) {
t.printStackTrace();
}
SoundEngineAudioQueue.drainNow();
} else {
QUEUE.offer(task);
}
}
public static void drainNow() {
Runnable next;
if (!SoundEngineAudioQueue.isSoundThread()) {
return;
}
while ((next = QUEUE.poll()) != null) {
try {
next.run();
}
catch (Throwable t) {
t.printStackTrace();
}
}
}
private static boolean isSoundThread() {
return "Sound engine".equals(Thread.currentThread().getName());
}
}