Results 1 to 3 of 3
  1. #1
    asdfasdf is offline Member
    Join Date
    Sep 2012
    Rep Power

    Default 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.


    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;

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default 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.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

Similar Threads

  1. Replies: 2
    Last Post: 03-23-2012, 04:53 AM
  2. Problem 'sleeping' Threads
    By Sebasnr in forum New To Java
    Replies: 6
    Last Post: 12-31-2011, 05:48 PM
  3. Problem 'sleeping' Threads
    By Sebasnr in forum New To Java
    Replies: 1
    Last Post: 12-31-2011, 03:15 AM
  4. interrupt sleeping thread by mouse action
    By BigBear in forum AWT / Swing
    Replies: 5
    Last Post: 08-12-2010, 10:10 PM
  5. How to stop thread when it is sleeping
    By luoluo in forum Threads and Synchronization
    Replies: 2
    Last Post: 04-24-2010, 03:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts