And fixed the record path thanks to Lex, turns out i'm a fucking retard

This commit is contained in:
Adubbz 2013-07-06 15:18:35 +10:00
parent 2d7ade1ad3
commit fe39bd0189
3 changed files with 19 additions and 4 deletions

View File

@ -2,16 +2,17 @@ package biomesoplenty.handlers;
import java.util.logging.Level;
import net.minecraft.client.resources.ResourceLocation;
import net.minecraftforge.client.event.sound.PlayStreamingEvent;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class SoundHandler
{
static ResourceLocation[] recordSoundFiles = { new ResourceLocation("bopdisc.ogg"), new ResourceLocation("bopdiscmud.ogg") };
static String[] recordSoundFiles = { "biomesoplenty:bopdisc.ogg", "biomesoplenty:bopdiscmud.ogg" };
static String[] soundFiles = { };
@SideOnly(Side.CLIENT)
@ -31,11 +32,11 @@ public class SoundHandler
}
}
for (ResourceLocation recordSoundFile : recordSoundFiles)
for (String recordSoundFile : recordSoundFiles)
{
try
{
event.manager.soundPoolStreaming.addSound(recordSoundFile.func_110623_a());
event.manager.soundPoolStreaming.addSound(recordSoundFile);
}
catch (Exception e)
@ -44,4 +45,18 @@ public class SoundHandler
}
}
}
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void onPlayStreaming(PlayStreamingEvent event)
{
if (event.name == "bopdisc")
{
FMLClientHandler.instance().getClient().sndManager.playStreaming("biomesoplenty:bopdisc", (float) event.x + 0.5F, (float) event.y + 0.5F, (float) event.z + 0.5F);
}
else if (event.name == "bopdiscmud")
{
FMLClientHandler.instance().getClient().sndManager.playStreaming("biomesoplenty:bopdiscmud", (float) event.x + 0.5F, (float) event.y + 0.5F, (float) event.z + 0.5F);
}
}
}