@CoolAlias:
That is very much possible, at least to load them all into the mod.
Heres part of what I used to load textures dynamicly, it could probably do just as well with sounds.
URL url = PlayMod.class.getResource("/assets/playmod/textures/blocks/");
try {
String[] files = new File(url.toURI()).list();
if (files!= null && files.length > 0)
{
for (int i = 0; i < files.length; i++)
{
// DO STUFF
}
}
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
There we go, that's what I'm talking about! File manipulation has never been my strong suit, even though it's not that hard... Thanks!
Nevermind, I was just having a moment there. Accessing a client-side only field from the server, nothing to do with sounds actually! Derp.
Hey Maz, me again. So I was doing some testing with sounds on a server, and SoundLoadEvent.manager is client side only so you have to register the SoundHandler on the client side only (such as in the ClientProxy). This, however, obviously results in no sounds being registered on the server and then crashing the server when you try to play the sound:
[SEVERE] Encountered an unexpected exception NoSuchFieldError
java.lang.NoSuchFieldError: playMissSound
// resulting from this code:
player.playSound(ModInfo.SOUND_SWORDMISS, (1.0F, 1.0F / (player.worldObj.rand.nextFloat() * 0.4F + 0.5F));
Note that it all works fine when only playing on the client, and in fact using player.playSound seems to be a client only version of playing sounds; using it server side results in no sound being heard, just as using the 'world.playSoundAtEntity' method on the client side results in no sound, but on the server side broadcasts the sound to all players nearby (which is handy).
Has anyone dealt with this before? Or am I just missing something really obvious?
I'm not sure how it is for 1.7 I wouldn't be adding updates on that before the 1.7 systems are done which is still some time away.
Forge is not yet released, build 982 is just an indev build and not a stable one.
I would guess they commented out the fluid system as it caused crashes and will add it back inn once they have fixed and tweaked the other systems which must be done first.
There we go, that's what I'm talking about! File manipulation has never been my strong suit, even though it's not that hard... Thanks!
Hey Maz, me again. So I was doing some testing with sounds on a server, and SoundLoadEvent.manager is client side only so you have to register the SoundHandler on the client side only (such as in the ClientProxy). This, however, obviously results in no sounds being registered on the server and then crashing the server when you try to play the sound:
Note that it all works fine when only playing on the client, and in fact using player.playSound seems to be a client only version of playing sounds; using it server side results in no sound being heard, just as using the 'world.playSoundAtEntity' method on the client side results in no sound, but on the server side broadcasts the sound to all players nearby (which is handy).
Has anyone dealt with this before? Or am I just missing something really obvious?
Forge is not yet released, build 982 is just an indev build and not a stable one.
I would guess they commented out the fluid system as it caused crashes and will add it back inn once they have fixed and tweaked the other systems which must be done first.
Is anyone still active on this post? I was looking for some help on custom sounds in 1.6.4.
You'd be better off asking for help in the Modification Development section of the forums.