-
[1.9] How to create & register a sound using the new registry system? [Solved]
Your sounds.json and registering code looks correct as they are here. My experience is that when you try to play a sound using the SoundEvent object returned from the registering method, it just doesn't work. I had to retrieve the SoundEvent directly from the registry using something like this (adapted for your mod): playSound(entityName, entityName.getPosition(), SoundEvent.soundEventRegistry.getObject(new ResourceLocation(ModReference.modid, "entity.terrakon.bark")), SoundCategory.NEUTRAL, 1.0F, 1.0F); Edit: Well nevermind then, I'm glad you got it working. I unfortunately have no clue how to implement sound subtitles as of yet.
-
[1.9] How to create & register a sound using the new registry system? [Solved]
Yes! Thank you, crackedEgg. I must have completely overlooked that part of Choonster's sounds.json . Adding the "name" tag does indeed make my sound play correctly in-game.
-
[1.9] How to create & register a sound using the new registry system? [Solved]
Well I had to look up what breakpoints were because I had never heard of them before, as I haven't ever the need for such advanced debugging. As far as I can tell my modular text editor, Atom, does not have an integrated graphical debugger, and I could not find any packages available for it that add that functionality. I suppose I could use "jdb", the JDK command line debugger, but I have no idea how to run Minecraft from within it. As for my log4j configuration; if you could tell me where my log4j config is, and what to edit in it to allow SoundManager debug messages through I would appreciate it. Be aware that I am new to java and forge in general and am not educated completely in their intricacies, although I am willing to learn.
-
[1.9] How to create & register a sound using the new registry system? [Solved]
No, sorry, I forgot to include main in that directory path. I've edited the post now to reflect the true sound file location. fml-client-latest.log : latest.log : I loaded into a singleplayer world and played the sound a few times with the "/playsound" command. Personally, I didn't spot anything relevant in the log but maybe you will.
-
[1.9] How to create & register a sound using the new registry system? [Solved]
Okay, I'm stumped. I'm almost certain that I've modified my code to reflect your example, but the sound still does not play when I attempt to play it using the "/playsound" command in-game. It's finding something because it doesn't error when I issue the command. The exact command: "/playsound something:noise_maker_noise master Player" Command Console Output: [21:08:39] [server thread/INFO]: [Player639: Played sound 'something:noise_maker_noise' to Player639] [21:08:39] [Client thread/INFO]: [CHAT] Played sound 'something:noise_maker_noise' to Player639 Updated sounds.json : { "noise_maker_noise": { "category": "master", "sounds": [ { "something:noiseMakerNoise", "stream": false } ] } } Updated Registering Code: public static SoundEvent noiseMakerNoise; public static void preInitCommon() // runs at common proxy preinit { final ResourceLocation testLocation = new ResourceLocation(Something.MODID, "noise_maker_noise"); noiseMakerNoise = GameRegistry.register(new SoundEvent(testLocation).setRegistryName(testLocation)); } Sound File Location: /src/main/resources/assets/something/sounds/noiseMakerSound.ogg
-
[1.9] How to create & register a sound using the new registry system? [Solved]
I have, to some degree, registered a sound. It tab autocompletes and does not error when I play the sound using "/playsound" in-game, but it does not actually play the sound. I think I'm pointing the SoundEvent at the wrong thing. sounds.json : { "noiseMakerNoise": {"category": "master", "sounds": [{"noiseMakerNoise", "stream": false}]}, } Registering Code: public static SoundEvent noiseMakerNoise; public static void preInitCommon() // this is run at common proxy preinit { noiseMakerNoise = new SoundEvent(new ResourceLocation("noiseMakerNoise")); GameRegistry.register(noiseMakerNoise, new ResourceLocation(Something.MODID + ":" + "noise_maker_noise")); } The sound file is located at: /src/main/resources/assets/something/sounds/noiseMakerSound.ogg
-
[1.9] Where can I find the vanilla Minecraft methods, if possible? [Solved]
Well coolAlias's reply inspired me to go back and re-run "gradle setupDecompWorkspace" again but this time with "-d" debug flag and that showed it outputting forgeSrc into my Gradle cache exactly where your later reply Choonster said it would be. It's a shame I found it before I refreshed to see your reply, Choonster. At least it's location has been layed out elegantly for anybody else who has the same confusion I had. Thank you Choonster and coolAlias both very much for your help.
-
[1.9] Where can I find the vanilla Minecraft methods, if possible? [Solved]
Okay, that makes a lot more sense, thank you. However I cannot locate a forgeSrc folder/library anywhere inside my mod directory. Can you please tell me where or how to either locate or acquire this? Note: I'm am not using Eclipse or IntelliJ.
-
[1.9] Where can I find the vanilla Minecraft methods, if possible? [Solved]
After running "gradle setupDecompWorkspace" I extracted the jar located at "/build/tmp/decompileMc/forge-1.9-12.16.0.1854-1.9-srgBin.jar" to a directory of the same name at the same location. I then opened the file located at "/build/tmp/decompileMc/forge-1.9-12.16.0.1854-1.9-srgBin/net/minecraft/world/World.java" with my IDE. Here is a snippet of the contents demonstrating the arbitrary method/parameter names: public boolean func_175691_a(BlockPos p_175691_1_, Block p_175691_2_) { return false; } public boolean func_175678_i(BlockPos p_175678_1_) { return this.func_175726_f(p_175678_1_).func_177444_d(p_175678_1_); } public boolean func_175710_j(BlockPos p_175710_1_) { if(p_175710_1_.func_177956_o() >= this.func_181545_F()) { return this.func_175678_i(p_175710_1_); } else { BlockPos blockpos = new BlockPos(p_175710_1_.func_177958_n(), this.func_181545_F(), p_175710_1_.func_177952_p()); if(!this.func_175678_i(blockpos)) { return false; } else { for(blockpos = blockpos.func_177977_b(); blockpos.func_177956_o() > p_175710_1_.func_177956_o(); blockpos = blockpos.func_177977_b()) { IBlockState iblockstate = this.func_180495_p(blockpos); if(iblockstate.func_185891_c() > 0 && !iblockstate.func_185904_a().func_76224_d()) { return false; } } return true; } } } These method names are nothing like the ones I see people using from these classes when importing these classes into their mods. This is where my confusion lies.
-
[1.9] Where can I find the vanilla Minecraft methods, if possible? [Solved]
If I knew where to look to see all of Minecraft's methods I feel I could better understand what it is I'm doing. I've looked inside the so called "deobfuscated" uncompiled Minecraft code that you get when you run "gradle setupDecompWorkspace", but all I find are arbitrary method names such as "func_123456_a" and so on. I have a specific instance where I would like to know the method to a play a sound within a world. So I went to "net/minecraft/world/World.java" but all the methods names are obfuscated. Where would I look to find the true method names within this file?
IPS spam blocked by CleanTalk.