Java 类net.minecraftforge.client.event.sound.SoundLoadEvent 实例源码

项目:R0b0ts    文件:SoundHandler.java   
@ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event)
{

    // For each custom sound file we have defined in Sounds
    for (String soundFile : soundFiles)
    {
        // Try to add the custom sound file to the pool of sounds
        try
        {
            event.manager.addSound(soundFile);
        }
        // If we cannot add the custom sound file to the pool, log the exception
        catch (Exception e)
        {
            FMLLog.warning("Failed loading sound file: " + soundFile);
        }
    }
}
项目:Dota2Items    文件:ClientProxy.java   
@ForgeSubscribe
public void onSound(SoundLoadEvent event) {
       try {
        for (Sound sound : Sound.values()) {
            if (!sound.isRandom()) {
                event.manager.soundPoolSounds.addSound(sound.getName()+".ogg");
            } else {
                for (int i = 1; i <= sound.randomVariants; i++) {
                    event.manager.soundPoolSounds.addSound(sound.getName()+i+".ogg");
                }
            }
        }
       }
       catch (Exception e) {
        Dota2Items.logger.warning("Failed to register one or more sounds.");
       }
   }
项目:EnergyFromMatter    文件:SoundHandler.java   
@ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event)
{
    // For each custom sound file we have defined in Sounds
    for (String soundFile : Sounds.soundFiles)
    {
        // Try to add the custom sound file to the pool of sounds
        try
        {
            event.manager.addSound(Resources.MOD_ID + ":" + soundFile);
        }
        // If we cannot add the custom sound file to the pool, log the
        // exception
        catch (Exception e)
        {
            LogHelper.warning("Failed loading sound file: " + soundFile);
        }
    }
}
项目:MidgarCrusade    文件:SoundHandler.java   
@SubscribeEvent
    public void onSoundLoad(SoundLoadEvent event) 
    {
//            event.manager.addSound("yourmod:YourSound.ogg");//refers to: yourmod/sound/YourSound.ogg
//            event.manager.addSound("yourmod:optionalFile/YourSound.ogg");
//            event.manager.addSound("yourmod:optionalFile/optionalFile2/YourSound.ogg");
    }
项目:WeirdScience    文件:EventSounds.java   
public void onSound(SoundLoadEvent event) {
    try {
        for(String sound : sounds) {
            //event.manager.playSound(sound);
        }
    } catch (Exception e) {
        System.err.println("Failed to register one or more sounds.");
        System.err.println(e);
    }
}
项目:MC-MineAPI.Java    文件:SoundLoader.java   
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event) // NO_UCD (unused code)
{
    // Load sounds as required by event.
    this.loadItemSounds( event );
    this.loadTileEntitySounds( event );
}
项目:MC-MineAPI.Java    文件:SoundLoader.java   
private void loadTileEntitySounds(SoundLoadEvent event)
{
    // -----------
    // TILE ENTITY
    // -----------
    Iterable<TileEntityFactoryProduct> registeredMachines = TileEntityFactory.instance().getMachineInfoList();
    for (Iterator iterator = registeredMachines.iterator(); iterator.hasNext(); )
    {
        TileEntityFactoryProduct registeredMachine = (TileEntityFactoryProduct) iterator.next();
        if (registeredMachine != null)
        {
            // Grab processed list of filenames of sounds that need to be registered with Forge/MC.
            String[] unregisteredSounds = registeredMachine.loadSoundArchive();
            if (unregisteredSounds == null)
            {
                continue;
            }

            // Loop through the filenames and register them.
            for (String unregisteredSound : unregisteredSounds)
            {
                event.manager.addSound( unregisteredSound );
                //MadScience.logger.info("[" + registeredMachine.getMachineName() + "]Registering Sound:" + unregisteredSound);
            }
        }
    }
}
项目:MC-MineAPI.Java    文件:SoundLoader.java   
private void loadItemSounds(SoundLoadEvent event)
{
    // -----
    // ITEMS
    // -----
    Iterable<ItemFactoryProduct> registeredItems = ItemFactory.instance().getItemInfoList();
    for (Iterator iterator = registeredItems.iterator(); iterator.hasNext(); )
    {
        ItemFactoryProduct registeredItem = (ItemFactoryProduct) iterator.next();
        if (registeredItem != null)
        {
            List<String> unregisteredSounds = new ArrayList<String>();

            // Loop through all sub-items.
            for (SubItemsArchive subItem : registeredItem.getSubItems())
            {
                // Skip items that have no sounds associated with them.
                String[] itemSounds = subItem.loadSoundArchive();
                if (itemSounds == null)
                {
                    continue;
                }

                // Load sound archive for each sub-item.
                for (String unloadedSound : itemSounds)
                {
                    unregisteredSounds.add( unloadedSound );
                }
            }

            // Loop through the filenames and register them.
            for (String unregisteredSound : unregisteredSounds)
            {
                event.manager.addSound( unregisteredSound );
                //MadScience.logger.info("[" + registeredMachine.getMachineName() + "]Registering Sound:" + unregisteredSound);
            }
        }
    }
}
项目:Nuclear-Control    文件:ClientTickHandler.java   
@SubscribeEvent
public void importSound(SoundLoadEvent event) {
    IC2NuclearControl ncInstance = IC2NuclearControl.instance;
    ncInstance.availableAlarms = new ArrayList<String>();

    try {
        List list = Minecraft
                .getMinecraft()
                .getResourceManager()
                .getAllResources(
                        new ResourceLocation("nuclearcontrol",
                                "sounds.json"));

        for (int i = list.size() - 1; i >= 0; --i) {
            IResource iresource = (IResource) list.get(i);

            try {
                Map map = (Map) gson.fromJson(new InputStreamReader(
                        iresource.getInputStream()), type);
                Iterator iterator1 = map.entrySet().iterator();

                while (iterator1.hasNext()) {
                    Entry entry = (Entry) iterator1.next();
                    ncInstance.availableAlarms
                            .add(((String) entry.getKey()).replace(
                                    "alarm-", ""));
                }
            } catch (RuntimeException runtimeexception) {
                ;
            }
        }
    } catch (IOException ioexception) {
        ;
    }

    ncInstance.serverAllowedAlarms = new ArrayList<String>();
}
项目:ZeroQuest    文件:SoundManagerZQuest.java   
@ForgeSubscribe
   public void onSoundLoad(SoundLoadEvent event) {
       // For each custom sound file we have defined in Sounds
       for (String soundFile : soundFiles) {
           // Try to add the custom sound file to the pool of sounds
           try {
            event.manager.addSound(soundFile);
           }
           // If we cannot add the custom sound file to the pool, log the exception
           catch (Exception e) {
               FMLCommonHandler.instance().getFMLLogger().log(Level.WARNING, "Zero Quest failed loading sound file: " + soundFile);
           }
       }
}
项目:Chisel    文件:Sounds.java   
@SubscribeEvent
   public void onSound(SoundLoadEvent evt){
    event=evt;

    try {
        addSounds();
    } catch (Exception e) {
        System.err.println("Failed to register one or more sounds: "+e);
    }
}
项目:FysiksFun    文件:FFSounds.java   
@ForgeSubscribe
public void onSound(SoundLoadEvent event) {
  for(int i=1;i<26;i++)
    event.manager.soundPoolSounds.addSound("fysiksfun:rubble"+i+".ogg");
  event.manager.soundPoolSounds.addSound("fysiksfun:earthquake.ogg");
  for(int i=1;i<=7;i++)
    event.manager.soundPoolSounds.addSound("fysiksfun:woodCrack"+i+".ogg");
  for(int i=1;i<=2;i++)
    event.manager.soundPoolSounds.addSound("fysiksfun:timber"+i+".ogg");
}
项目:SkullForge    文件:SoundManager.java   
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void onSoundsLoaded(SoundLoadEvent event)
{

    //Sounds
    event.manager.addSound("skullforge:paint.ogg");
    event.manager.addSound("skullforge:remove.ogg");

    //Print Load Message to Console.
    System.out.println("[SkullForge] Loading Sound Manager...");
}
项目:Decaying-World    文件:EventHandlerClient.java   
@ForgeSubscribe
 public void onSoundLoad(SoundLoadEvent event)
 {
    FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[Decay] Loading sounds...");
    try {
    event.manager.addSound("decayingworld:rock1.ogg");
    event.manager.addSound("decayingworld:rock2.ogg");
    }
    catch (Exception e) {
FMLCommonHandler.instance().getFMLLogger().log(Level.WARNING, "[Decay] Failed adding sound file.");
FMLCommonHandler.instance().getFMLLogger().log(Level.WARNING, "[Decay] " + e.getMessage());
e.printStackTrace();
    }
 }
项目:Kingdom-Keys    文件:SoundManager.java   
@ForgeSubscribe
   public void onSoundsLoaded(SoundLoadEvent event){
    for (Sounds sound : Sounds.values()) {
        addSound(event, sound);
    }
    event.manager.soundPoolStreaming.addSound(Reference.MOD_ID + ":" + Strings.Disc1 + ".ogg");
       event.manager.soundPoolStreaming.addSound(Reference.MOD_ID + ":" + Strings.Disc2 + ".ogg");
       event.manager.soundPoolStreaming.addSound(Reference.MOD_ID + ":" + Strings.Disc3 + ".ogg");
       event.manager.soundPoolStreaming.addSound(Reference.MOD_ID + ":" + Strings.Disc4 + ".ogg");
       event.manager.soundPoolStreaming.addSound(Reference.MOD_ID + ":" + Strings.Disc5 + ".ogg");
       event.manager.soundPoolStreaming.addSound(Reference.MOD_ID + ":" + Strings.Disc6 + ".ogg");
       event.manager.soundPoolStreaming.addSound(Reference.MOD_ID + ":" + Strings.Disc7 + ".ogg");
       event.manager.soundPoolStreaming.addSound(Reference.MOD_ID + ":" + Strings.Disc8 + ".ogg");
       event.manager.soundPoolStreaming.addSound(Reference.MOD_ID + ":" + Strings.Disc9 + ".ogg");
}
项目:SpatialRunes    文件:SoundHandler.java   
@ForgeSubscribe
@SideOnly(Side.CLIENT)
public void onSoundLoad(SoundLoadEvent event) {
    try {
        event.manager.soundPoolSounds.addSound("runes_success.ogg");
        event.manager.soundPoolSounds.addSound("runes_failure.ogg");
        System.out.println("[Spatial Runes] Loaded sounds!");
    } catch(Exception e) {
        System.out.println("[Spatial Runes] Failed to load sounds!");
    }
}
项目:spellbound    文件:EventHandler.java   
@ForgeSubscribe
public void onSound(SoundLoadEvent event)
{
    event.manager.soundPoolSounds.addSound("spellbound:banshee.ogg");
    event.manager.soundPoolSounds.addSound("spellbound:spellcharge1second.ogg");
    event.manager.soundPoolSounds.addSound("spellbound:spellcharge2seconds.ogg");
    event.manager.soundPoolSounds.addSound("spellbound:spellcharge3seconds.ogg");
    event.manager.soundPoolSounds.addSound("spellbound:spellcharge4seconds.ogg");
    event.manager.soundPoolSounds.addSound("spellbound:spellcharge5seconds.ogg");
    event.manager.soundPoolSounds.addSound("spellbound:shield.ogg");
    event.manager.soundPoolSounds.addSound("spellbound:surge.ogg");
    event.manager.soundPoolSounds.addSound("spellbound:meteor.ogg");
}
项目:CodeLyokoMod    文件:SoundHandler.java   
/**
 * When Minecraft loads sounds, load our sounds too.
 *
 * @param event
 */
@SubscribeEvent
public void onSoundLoad(SoundLoadEvent event)
{
    this.loadSound(event.manager, "scannerClose.ogg");
    this.loadSound(event.manager, "scannerOpen.ogg");
}
项目:The-Betweenlands-Reboot    文件:BetweenlandsSoundEvent.java   
@ForgeSubscribe
public void loadSoundEvents(SoundLoadEvent event)
{
    for (int i = 0; i < SOUND_FILES.length; i++)
    {
        event.manager.soundPoolSounds.addSound("thebl" + ":" + SOUND_FILES[i]);
        //event.manager.soundPoolSounds.("thebl" + ":" + SOUND_FILES[i]);
        //event.manager.soundPoolSounds.addSound("thebl" + ":" + "thergsugoartaertae/raertaeyay/atwtawe.ogg");
        }


    }
项目:Reliquary    文件:SoundHandler.java   
@ForgeSubscribe
public void onSound(SoundLoadEvent event) {
    for (String soundFile : Reference.soundFiles) {
        try {
            event.manager.soundPoolSounds.addSound(soundFile, this.getClass().getResource("/" + soundFile));
            System.out.println(this.getClass().getResource("/" + soundFile).toString());
        }
        // If we cannot add the custom sound file to the pool, log the
        // exception
        catch (Exception e) {
            LogHelper.log(Level.WARNING, "Failed loading sound file: " + soundFile);
        }
    }
}
项目:Necromancy    文件:EventHandler.java   
@ForgeSubscribe
@SideOnly(Side.CLIENT)
public void onSoundsLoaded(SoundLoadEvent event) {
    SoundManager manager = event.manager;
    manager.soundPoolSounds.addSound("necromancy:sounds/nightcrawler/scream.ogg");
    manager.soundPoolSounds.addSound("necromancy:sounds/nightcrawler/howl.ogg");
}
项目:WeaponsMod    文件:Weapons_Sounds.java   
@ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event) {

    // For each custom sound file we have defined in Sounds
    for (String soundFile : Sounds.soundFiles) {
        // Try to add the custom sound file to the pool of sounds
        try {
            event.manager.soundPoolSounds.addSound(soundFile, this.getClass().getResource("/" + soundFile));
        }
        // If we cannot add the custom sound file to the pool, log the exception
        catch (Exception e) {
            Weapons.log( "Failed loading sound file: " + soundFile);
        }
    }
}
项目:Amitcraft    文件:SoundHandler.java   
@ForgeSubscribe
public void onSoundsLoaded(SoundLoadEvent ev) {
    for (String file : AmitReference.Sounds.soundFiles) {
        try {
            ev.manager.soundPoolSounds.addSound(file, this.getClass().getResource("/" + file));
        } catch (Exception e) {
            AmitLogger.warning(e, "Failed loading sound file:\t%s", file);
        }
    }
    AmitLogger.info("Loaded SoundHandler Successfully");
}
项目:powell.cellarium    文件:RasterlandSoundEventHandler.java   
@ForgeSubscribe
public void onSound(SoundLoadEvent event)
{
    event.manager.addSound("rasterland:discThrow.ogg");
    event.manager.addSound("rasterland:discGlow.ogg");
    event.manager.addSound("rasterland:discThrowShort.ogg");
    event.manager.addSound("rasterland:discGlowShort.ogg");
}
项目:ModHearthstone    文件:HearthstoneSoundHandler.java   
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event) {
    try {
        event.manager.soundPoolSounds.addSound(TELEPORT_FILE, this.getClass().getResource("/" + TELEPORT_FILE));
    } 
    catch (Exception e) {
        System.err.println("Failed to register one or more sounds.");
    }
}
项目:Learning-to-Mod    文件:SoundHandler.java   
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void onSound(SoundLoadEvent event) {
    for(String sound : Sound.files){
        try {
            event.manager.addSound(sound);
        } catch(Exception e) {
            LogHelper.log(Level.WARNING, "Failed loading sound: " + sound);
        }
    }
}
项目:MineFantasy    文件:SoundManagerMF.java   
private void addSound(SoundLoadEvent event, String string) {
    event.manager.soundPoolSounds.addSound(data_minefantasy.sound(string));
}
项目:rpginventory    文件:SoundManager.java   
@SubscribeEvent
public void onSound(SoundLoadEvent event) {
    // event.manager.addSound("subaraki:petWhistle.ogg");
}
项目:Kingdom-Keys    文件:SoundManager.java   
public void addSound(SoundLoadEvent event, Sounds sound){
    event.manager.soundPoolSounds.addSound(Sounds.SOUND_LOCATION + ":" + sound.getName() + ".ogg");
}
项目:Mythical-Gods-Mod    文件:SoundHandler.java   
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event) {


    for(String sound : Sounds.files){

        try {
            event.manager.soundPoolSounds.addSound(sound, this.getClass().getResource("/" + sound));
        } catch(Exception e) {
            LogHelper.log(Level.WARNING, "Failed loading Mythical Gods Mod sound: " + sound);
        }
    }




}
项目:FantasyCraft-Mod    文件:SoundEvent.java   
@ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event) {

}
项目:Blockbender    文件:SoundHandler.java   
@SubscribeEvent
public void onSound(SoundLoadEvent event) {

}