vilu Posted August 2, 2013 Posted August 2, 2013 Nope....Nothing is wrong there either... I really don't know what's wrong there because mine is working...check your directory structure one more time because your code should work and try adding debug line to your sound loader to see that your sound files are really loaded. Quote
bl4ckscor3 Posted August 2, 2013 Posted August 2, 2013 The sounds are loaded... I'm going to PM you my source code, maybe something is wrong in the depths of it. Quote http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
burnner Posted August 3, 2013 Author Posted August 3, 2013 GOT IT =D Here's how: Extend ItemRecord like... public class ItemModDisc extends ItemRecord { public ItemModDisc(int id, String recordName) { super(id, recordName); this.setCreativeTab(CreativeTabs.tabMisc); this.maxStackSize = 1; } // Rest of your ItemRecord code... } Then to your main class, add your constructor with one change: modDisc = (new ItemModDisc(modDiscID, "your_modname_lowercased:moddisc")).setUnlocalizedName("moddisc"); Put your ogg to the assets/your_modname_lowercased/records and keep the name same as above (so my custom record is moddisc.ogg and path is then assets/my_mods_name/records/moddisc.ogg And load it the the soundPoolStreaming (in your sound load event handler) for example like this: event.manager.soundPoolStreaming.addSound("your_modname_lowercased:moddisc.ogg"); Note that you don't use folder records in handler because soundPoolStreaming is looking always from /assets/your_modname_lowercased/records like soundPoolSounds is looking from /assets/your_modname_lowercased/sounds And there it is, your custom record which works just fine =) edit: Little clean up for code because I copy pasted it without removing unneeded lines... Hi thank you very much, but could you also post your sound load event handler? Quote
xlash123 Posted August 19, 2013 Posted August 19, 2013 I found out that if you put the .ogg file in the /assets/records/your.ogg outside of your mod files, it works. It would be like putting it in .minecraft/assets/records, when instead you need to get it in Yourmod.zip/assets/records/. I hope this helps. Quote
Recommended Posts
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.