Jump to content

terorie

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by terorie

  1. 4 minutes ago, Choonster said:

    There's nothing limiting SPacketSoundEffect to vanilla SoundEvents, it will work with any SoundEvent.

     

    Forge's documentation explains the various methods that play sound here.

    How embarrassing, I read that documentation at least ten times.:/

     

    4 minutes ago, Choonster said:

    If you create a SoundType and set it as the Block's SoundType with Block#setSoundType, the SoundEvents will be automatically played at the appropriate times (including when the Block is broken).

     

    You can also override Block#addDestroyEffects to add any custom effects (and optionally disable the vanilla particles) when the Block is destroyed.

    Forge / Minecraft continues to amaze me!

     

    Thank you, I got it to work `.`

     

    – Have a nice Sunday, terorie

  2. I am porting a mod from 1.7.10 to 1.10.2. (Parts of Witchery)

    In a BlockXY.dropBlockAsItemWithChance (Server-side as far as I understand?), the dropped block sends a particle event and a SoundEvent to nearby players through SimpleNetworkWrapper.

    The author does this with a custom IMessage that instantly plays a sound in onMessage (Must be executed on client side, right?).

     

    I was breaking my head over how to implement this in 1.10.2 the last 30 minutes.

     

    Now I had three ideas how to do this in 1.10.2:

     

    1. Couldn't you just let the nearby clients figure our theirselves that "dropBlockAsItemWithChance" is about to be called? Then every client would play that sound locally without receiving packets that tell them specifically to play packets. Or did I get the client/server concept of Minecraft completely wrong there?
    2. If you want do it exactly like how I described it at the beginning, you would find that SoundEvents don't have a corresponding numeric ID, only resource Strings. Do I need to create an enum that maps sound Resource Strings to numeric values?
    3. {Why not} / {how to} use SPacketSoundEffect? Does it work for vanilla sounds only? Can you send the SPacketSoundEffect through the SimpleNetworkWrapper?

     

    Sorry for the nooby post, the last thing I wanted to do is annoy people in a forum.

     

    But I'm desperate, I would really appreciate some help! :)

     

     — terorie

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.