Posted July 16, 201213 yr Currently the onPlaySound hook from ISoundHandler is triggered from within the playSound method in SoundManager. playSoundEffect in World first calls playSound in RenderGlobal and in that method a distance check is made to the current renderViewEntity before passing it on to SoundManager. This means that the Forge hook is never called if the current render entity is out of a certain range of the block. Would it be possible to move the call to the hook before the range check is done, either within World or within RenderGlobal ? This way you could still check if a sound was supposed to be played even if it is never actually played due to distance considerations, making it possible to create blocks that can "listen" for certain sounds. NOTE: The onPlaySoundAtEntity hook in ISoundHandler works correctly as it is triggered within World
July 16, 201213 yr Not to be a fanboy or anything, but... I love your mod. Sorry for the lack of useful input. I just wanted to let you know. Well, I guess this post won't be completely useless. The link in your signature is broken. Try this instead. [url=http://www.minecraftforum.net/topic/838839-100-thaumcraft/][img=http://i.imgur.com/47MdL.png][/url] Check out my Texture Packs Thread here on the Forge Forum. Currently in the process of adding some mod support for JohnSmith Texture Pack. https://www.sugarsync.com/piv/D8135159_67366891_21351[/img] https://www.sugarsync.com/piv/D8135159_67366891_772852[/img]
July 16, 201213 yr not against it personally, but in order for this to work, would they not have to re-write half the vanilla sound handling code? (i am not a java expert, and honestly have not spend a lot of time looking over the MC base-code) Being noobish since 96, being dumb since birth!
July 27, 201213 yr This is good idea. Maybe another hook without a range check? So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.
July 27, 201213 yr This is good idea. Maybe another hook without a range check? Can't you spawn a sound 'on' a player?
August 7, 201213 yr Author As an example for when I ran into this issue: I created a block that "listens" via the hook for specific notes being played by a vanilla noteblock. Everthing works perfectly as long as the player remains within the view distance of the noteblock. Any further and the sounds doesn't play and the hook is never triggered. However the sound call is still made so in my mind the hook should still trigger, even though the actual sound doesn't play. Anyway, there are a few other issues with this as well, since I suspect this won't work in SMP anyway.
August 8, 201213 yr As an example for when I ran into this issue: I created a block that "listens" via the hook for specific notes being played by a vanilla noteblock. Everthing works perfectly as long as the player remains within the view distance of the noteblock. Any further and the sounds doesn't play and the hook is never triggered. However the sound call is still made so in my mind the hook should still trigger, even though the actual sound doesn't play. Anyway, there are a few other issues with this as well, since I suspect this won't work in SMP anyway. If a tree falls in the wood, and no one is around, does it still make a noise? Instead of hooking to the sound, can you hook to the activation of the noteblock itself, and check to make sure that it is set to the particular 'sound' you are looking for? Perhaps restrict it to check for it being within x block radius, so it would be able to legitimately 'hear' the noise itself. Not very familiar with Java code yet, but in logic statements: If (noteblock triggers) THEN IF (noteblock is within range) THEN IF (Noteblock is set to the particular setting you are looking for) THEN Trigger ENDIF ENDIF ENDIF Just throwing out an idea for you
August 8, 201213 yr Forge for MC 1.3.1 has a new Event system, you will use it to both trigger your custom action as well as to play the sound.
August 9, 201213 yr cant wait for new mods, since i bought the game 2 days ago now i can play mc without being afraid to get problems with mojang or the law :-P oh and servers are not a problem anymore, damn shitty cracked servers lol, just a waste of time Minecraft.net Username: Sailren
August 11, 201213 yr cant wait for new mods, since i bought the game 2 days ago now i can play mc without being afraid to get problems with mojang or the law :-P oh and servers are not a problem anymore, damn shitty cracked servers lol, just a waste of time Yeah. I can honestly say that with what I've gotten out of it, and still get plenty out of, that Minecraft is probably the best $26 or so I ever spent on a videogame. Check out my Texture Packs Thread here on the Forge Forum. Currently in the process of adding some mod support for JohnSmith Texture Pack. https://www.sugarsync.com/piv/D8135159_67366891_21351[/img] https://www.sugarsync.com/piv/D8135159_67366891_772852[/img]
August 11, 201213 yr and we can show our creativity in this game, just look after the enterprise in youtube one of them, others build the red dragon in zelda wind waker at the moment im trying to play direwolfs season 4 lets play on my own, i will update to 1.3.1, when he starts his season 5 and i have finished my season 4 Minecraft.net Username: Sailren
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.