diff options
author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
---|---|---|
committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
commit | 85c804fa112fd1f19c91e45d150a787cfbf0f7a8 (patch) | |
tree | cb302d8e0f46e06be0b1d391317578b165aec245 /src/main/java/gregtech/api/threads/GT_Runnable_Sound.java | |
parent | ce25063b910bb3bdd2b0c234b185fc4077caebdb (diff) | |
download | GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.gz GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.bz2 GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.zip |
Move source directory
Diffstat (limited to 'src/main/java/gregtech/api/threads/GT_Runnable_Sound.java')
-rw-r--r-- | src/main/java/gregtech/api/threads/GT_Runnable_Sound.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java b/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java new file mode 100644 index 0000000000..aaa8b84028 --- /dev/null +++ b/src/main/java/gregtech/api/threads/GT_Runnable_Sound.java @@ -0,0 +1,26 @@ +package gregtech.api.threads; + +import gregtech.api.util.GT_PlayedSound; +import gregtech.api.util.GT_Utility; +import net.minecraft.world.World; + +public class GT_Runnable_Sound implements Runnable { + private final int mX, mY, mZ, mTimeUntilNextSound; + private final World mWorld; + private final String mSoundName; + private final float mSoundStrength, mSoundModulation; + + public GT_Runnable_Sound(World aWorld, int aX, int aY, int aZ, int aTimeUntilNextSound, String aSoundName, float aSoundStrength, float aSoundModulation) { + mWorld = aWorld; mX = aX; mY = aY; mZ = aZ; mTimeUntilNextSound = aTimeUntilNextSound; mSoundName = aSoundName; mSoundStrength = aSoundStrength; mSoundModulation = aSoundModulation; + } + + @Override + public void run() { + try { + GT_PlayedSound tSound; + if (GT_Utility.sPlayedSoundMap.keySet().contains(tSound = new GT_PlayedSound(mSoundName, mX, mY, mZ))) return; + mWorld.playSound(mX, mY, mZ, mSoundName, mSoundStrength, mSoundModulation, false); + GT_Utility.sPlayedSoundMap.put(tSound, mTimeUntilNextSound); + } catch(Throwable e) {/**/} + } +}
\ No newline at end of file |