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

    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.

    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;
    }

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,267
    Rep Power
    25

    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 Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Help in sleeping method

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

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
  •