Solved Using packets for lightning to avoid lightning sound

Discussion in 'Plugin Development' started by TheMintyMate, Apr 1, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    TheMintyMate

    Yesterday I uploaded a post concerning sound, and how to stop it. However it became obvious that this wasn't possible. So instead, I received a suggestion on using packets to achieve the effect without sound. So my question is how can I use a packet to produce lightning without any sound?
    Below is a link to the old post:
    http://forums.bukkit.org/threads/sound-manipulation-of-lightning.251081/
     
  2. Offline

    SuperOmegaCow

    TheMintyMate
    Extend EntityLightning and override the h function.
     
    TheMintyMate likes this.
  3. Offline

    TheMintyMate

    SuperOmegaCow
    Please could you explain this more? I haven't, as mentioned, worked with packets before. Below is what I currently use the lightning to do:
    Code:java
    1.  
    2. player.getWorld().strikeLightning(player.getTargetBlock(null, 250).getLocation());
    3.  

    How do I implement a packet for this code, so as to avoid creating a sound when lightning is struck?

    Note: From what I've gathered, packets aren't ideal as they need to be updated, generally speaking, for each version of craftbukkit - this is fine for me.
     
  4. Offline

    SuperOmegaCow

    TheMintyMate
    What I said has nothing to do with packets. Go to the mc-dev repo and take a look at EntityLightning. Simply extend it and override the h function which plays sound.
     
  5. Offline

    TheMintyMate

    SuperOmegaCow
    Ok, ty :)

    SuperOmegaCow
    Right, I have found the mc-dev repo, and I can see the public void h(). How do I go about extending it to remove the sound of lightning for my plugin?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  6. Offline

    Garris0n

  7. Offline

    TheMintyMate

    Ok, thanks :) Il get back to you soon with any updates :)

    garrison
    I took a look at that thread, and started implementing the concept, but some of the code is now outdated :/ (thread made in 2012)

    SuperOmegaCow
    garrison
    Ok, I am now incredibly confused :p I'm not sure whether I need to make a new class....etc. Please could I have a simple code example? Thank-you guys :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  8. Offline

    SuperOmegaCow

    TheMintyMate
    Maybe java is something you should be learning before posting here. I also noticed you posted the exact same thread multiple times.
     
  9. Offline

    TheMintyMate

    SuperOmegaCow
    The other thread (as linked above) refers to a general manipulation of sound, whereas this thread asks for help concerning packets.
    Also I think I know now how to deal with the code, though some actual help would have been more appreciated than a degrading comment from you.
    If you have any other suggestions, they would be appreciated, otherwise, this thread is now closed.
     
Thread Status:
Not open for further replies.

Share This Page