mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Fix #72; turns out the sound handling in SP has race conditions
This commit is contained in:
1 parent
0f1f4a4b0a
commit
ccd7ed019a
1 file changed
+6
@@ -80,6 +80,12 @@ public class SoundHandler {
|
||||
}
|
||||
|
||||
public static ISound startTileSound(ResourceLocation soundLoc, float volume, BlockPos pos) {
|
||||
// Check to see if the game has focus; in SP mode sounds aren't paused until AFTER the game menu is displayed,
|
||||
// which means that a sound can slip into queue after user has already paused the game.
|
||||
if (!Minecraft.getMinecraft().inGameHasFocus) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// First, check to see if there's already a sound playing at the desired location
|
||||
ISound s = soundMap.get(pos.toLong());
|
||||
if (s == null || !Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(s)) {
|
||||
|
||||
Reference in new issue
Block a user