Results 1 to 3 of 3
Thread: Help in sleeping method
- 09-18-2012, 11:06 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 1
- Rep Power
- 0
Help in sleeping method
I want something similar to Thread.sleep, but not stop all activity. im doing this for modding minecraft. When an item is right clicked, a sound plays. the problem is that the sound is a second or 2 long, but the player can right click more than once a second.
ex.
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
Minecraft mc = ModLoader.getMinecraftInstance();
mc.sndManager.playSoundFX("zFiendfan1Mod.bark", 1.0F, 1.0F);
System.stopAllowingSoundToPlayFor(1000); //psuedocode
return par1ItemStack;
}
- 09-19-2012, 02:48 AM #2
Re: Help in sleeping method
Why don't you call one of the Minecraft methods and tell it to stop making the sound?
If you don't understand my response, don't ignore it, ask a question.
- 09-19-2012, 04:57 AM #3
Re: Help in sleeping method
Why do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Creating recursion method to use Newton's method for square roots
By bdl1127 in forum New To JavaReplies: 2Last Post: 03-23-2012, 04:53 AM -
Problem 'sleeping' Threads
By Sebasnr in forum New To JavaReplies: 6Last Post: 12-31-2011, 05:48 PM -
Problem 'sleeping' Threads
By Sebasnr in forum New To JavaReplies: 1Last Post: 12-31-2011, 03:15 AM -
interrupt sleeping thread by mouse action
By BigBear in forum AWT / SwingReplies: 5Last Post: 08-12-2010, 10:10 PM -
How to stop thread when it is sleeping
By luoluo in forum Threads and SynchronizationReplies: 2Last Post: 04-24-2010, 03:09 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks