mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +00:00
Started work on flamethrower sounds, also increased efficiency of SoundHandler (now loops over sounds only once instead of twice)
This commit is contained in:
1 parent
f9fdb56e24
commit
cdeb25803c
5 files changed
+102
-20
No files matched your search
@@ -181,29 +181,26 @@ public class SoundHandler
|
||||
{
|
||||
ArrayList<Sound> soundsToRemove = new ArrayList<Sound>();
|
||||
World world = FMLClientHandler.instance().getClient().theWorld;
|
||||
|
||||
for(Sound sound : sounds.values())
|
||||
|
||||
if(FMLClientHandler.instance().getClient().thePlayer != null && world != null)
|
||||
{
|
||||
if(FMLClientHandler.instance().getClient().thePlayer != null && world != null)
|
||||
for(Sound sound : sounds.values())
|
||||
{
|
||||
if(!sound.update(world))
|
||||
{
|
||||
soundsToRemove.add(sound);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(sound.isPlaying)
|
||||
{
|
||||
sound.updateVolume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(Sound sound : soundsToRemove)
|
||||
{
|
||||
sound.remove();
|
||||
}
|
||||
|
||||
for(Sound sound : sounds.values())
|
||||
{
|
||||
if(sound.isPlaying)
|
||||
|
||||
for(Sound sound : soundsToRemove)
|
||||
{
|
||||
sound.updateVolume();
|
||||
sound.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user