From 5cc9086f8087523cc9d9ed401b99dc5a671fbadc Mon Sep 17 00:00:00 2001 From: Haven Date: Sat, 26 Jun 2021 12:47:48 -0700 Subject: [PATCH] Execute `SoundManager#play` on the main client thread. Should fix #19. --- gradle.properties | 2 +- .../atmosfera/client/sound/util/AtmosphericSoundHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 6c083e3..cab92cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ yarn_mappings = 1.16.5+build.9 loader_version = 0.11.3 # Mod Properties -mod_version = 1.4.2+mc1.16.5 +mod_version = 1.4.3+mc1.16.5 maven_group = dev.hephaestus archives_base_name = atmosfera diff --git a/src/main/java/dev/hephaestus/atmosfera/client/sound/util/AtmosphericSoundHandler.java b/src/main/java/dev/hephaestus/atmosfera/client/sound/util/AtmosphericSoundHandler.java index b475032..5c8335e 100644 --- a/src/main/java/dev/hephaestus/atmosfera/client/sound/util/AtmosphericSoundHandler.java +++ b/src/main/java/dev/hephaestus/atmosfera/client/sound/util/AtmosphericSoundHandler.java @@ -87,7 +87,7 @@ public static void endTick() { Atmosfera.debug("[Atmosfera] isDone: " + entry.getValue().getId()); } else if (!soundManager.isPlaying(entry.getValue())) { - soundManager.play(entry.getValue()); + MinecraftClient.getInstance().submit(() -> soundManager.play(entry.getValue())); Atmosfera.debug("[Atmosfera] play: " + entry.getValue().getId()); }