Jump to content

[solved]Music discs with 1.6.2


burnner

Recommended Posts

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.

 

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

  • 3 weeks later...

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.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

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