diff --git a/src/minecraft/assets/minecraft/records/bopdisc.ogg b/src/minecraft/assets/biomesoplenty/records/bopdisc.ogg similarity index 100% rename from src/minecraft/assets/minecraft/records/bopdisc.ogg rename to src/minecraft/assets/biomesoplenty/records/bopdisc.ogg diff --git a/src/minecraft/assets/minecraft/records/bopdiscmud.ogg b/src/minecraft/assets/biomesoplenty/records/bopdiscmud.ogg similarity index 100% rename from src/minecraft/assets/minecraft/records/bopdiscmud.ogg rename to src/minecraft/assets/biomesoplenty/records/bopdiscmud.ogg diff --git a/src/minecraft/biomesoplenty/handlers/SoundHandler.java b/src/minecraft/biomesoplenty/handlers/SoundHandler.java index 804c9a417..407990aab 100644 --- a/src/minecraft/biomesoplenty/handlers/SoundHandler.java +++ b/src/minecraft/biomesoplenty/handlers/SoundHandler.java @@ -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); + } + } }