Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Request] Minor change to onPlaySound hook in ISoundHandler


Azanor
 Share

Recommended Posts

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

47MdL.png

Link to comment
Share on other sites

Not to be a fanboy or anything, but... I love your mod. CreeperFace.png

Sorry for the lack of useful input. I just wanted to let you know. :D

 

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]

 

 

47MdL.png

 

Check out my

Texture Packs Thread here on the Forge Forum. :)

Currently in the process of adding some mod support for JohnSmith Texture Pack.

width=105 height=12https://www.sugarsync.com/piv/D8135159_67366891_21351[/img]

 

width=209 height=19https://www.sugarsync.com/piv/D8135159_67366891_772852[/img]

Link to comment
Share on other sites

not against it personally, but in order for this to work, would they not have to re-write half the vanilla sound handling code? :S

(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!

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

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.

47MdL.png

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. :P

Check out my

Texture Packs Thread here on the Forge Forum. :)

Currently in the process of adding some mod support for JohnSmith Texture Pack.

width=105 height=12https://www.sugarsync.com/piv/D8135159_67366891_21351[/img]

 

width=209 height=19https://www.sugarsync.com/piv/D8135159_67366891_772852[/img]

Link to comment
Share on other sites

and we can show our creativity in this game, just look after the enterprise in youtube :D 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 :D

Minecraft.net Username: Sailren

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I've used forge before, but I can't get it to work with 1.18+   Launcher code: [0116/225441.672:INFO:main_context.cpp(136)] CEF initialized successfully. [0116/225441.673:INFO:main_context.cpp(138)] CEF version: 85.3.13+gcd6cbe0+chromium-85.0.4183.121 [0116/225502.918:WARNING:angle_platform_impl.cc(48)] compileToBinary(257):  C:\fakepath(107,1-13): warning X3557: loop only executes for 1 iteration(s), forcing loop to unroll C:\fakepath(102,1-13): warning X3557: loop only executes for 1 iteration(s), forcing loop to unroll [0116/225508.369:INFO:LauncherAppRenderer.cpp(518)] OnContextReleased: no frame (unknown context), browser id=2 [0116/225515.224:INFO:LauncherAppRenderer.cpp(518)] OnContextReleased: no frame (unknown context), browser id=2 [0116/225515.353:INFO:LauncherAppRenderer.cpp(518)] OnContextReleased: no frame (unknown context), browser id=2 [0116/225525.860:INFO:LauncherAppRenderer.cpp(51)] [Info: 2022-01-16 21:55:17.9581899: LauncherMain.cpp(104)] Initiated models [0116/225525.861:INFO:LauncherAppRenderer.cpp(51)] [Info: 2022-01-16 21:55:17.9592226: LauncherController.cpp(435)] Constructing launcher controller with workDir: C:\...\.minecraft, isActive: 0 [0116/225525.861:INFO:LauncherAppRenderer.cpp(51)] [Info: 2022-01-16 21:55:17.9819604: LauncherAppRenderer.cpp(172)] Javascript bridge extended in OnWebKitInitialized. [0116/225526.215:INFO:LauncherAppRenderer.cpp(518)] OnContextReleased: no frame (unknown context), browser id=3 [0116/225526.238:INFO:LauncherAppRenderer.cpp(69)] OnBrowserDestroyed: id=3 [0116/225526.387:INFO:LauncherAppRenderer.cpp(518)] OnContextReleased: no frame (unknown context), browser id=3 [0116/225538.615:INFO:LauncherAppRenderer.cpp(518)] OnContextReleased: no frame (unknown context), browser id=1 [0116/225825.050:INFO:LauncherAppRenderer.cpp(518)] OnContextReleased: no frame (unknown context), browser id=5 [0116/230007.904:INFO:LauncherAppRenderer.cpp(518)] OnContextReleased: no frame (unknown context), browser id=6     "Latest" code [16jan.2022 23:00:09.457] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, Elverea, --version, 1.18.1-forge-39.0.36, --gameDir, C:\Users\Norge\AppData\Roaming\.minecraft, --assetsDir, C:\Users\Norge\AppData\Roaming\.minecraft\assets, --assetIndex, 1.18, --uuid, 31cc9858833c43488f09a460a739f964, --accessToken, ????????, --clientId, NzcyMWNmNWYtZGZhNS00YmY1LWFkMTgtMTljYjVhNzZhODM5, --xuid, 2535453675472907, --userType, msa, --versionType, release, --launchTarget, forgeclient, --fml.forgeVersion, 39.0.36, --fml.mcVersion, 1.18.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20211210.034407] [16jan.2022 23:00:09.462] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 9.0.7+91+master.8569cdf starting: java version 17.0.1 by Microsoft
    • Hello I'm running minecraft server 1.18.1 with forge 39.0.36 in ubuntu and tried to remove a mod, even thou the server starts it throws a bunch of  "Found a missing id from the world", I did the -Dfml.queryResult=confirm but it shows also tried to run the command directly like fml confirm and it throws ¿Which is the correct solution to get rid of all the "Found a missing id from the world" in 39.0.36?
    • Game crashes as soon as i load a chunk with my MineColonies City. https://pastebin.com/VNKgTV4T With forge-39.0.7 works well. Tested on 39.0.20 with the same behaviour (crash).
    • also there is a program called bearded octo nemesis that deobfuscate any .class files(is made for minecraft) but it doesnt work
    • I was intending to port it to 1.16.5 anyways, so yes. I am just porting my base to 1.16.5. All i am here for is to collect a few approaches on how you could achieve this.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.