@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); } } }
@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."); } }
@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); } } }
@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"); }
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); } }
@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 ); }
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); } } } }
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); } } } }
@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>(); }
@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); } } }
@SubscribeEvent public void onSound(SoundLoadEvent evt){ event=evt; try { addSounds(); } catch (Exception e) { System.err.println("Failed to register one or more sounds: "+e); } }
@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"); }
@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..."); }
@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(); } }
@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"); }
@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!"); } }
@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"); }
/** * 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"); }
@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"); } }
@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); } } }
@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"); }
@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); } } }
@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"); }
@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"); }
@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."); } }
@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); } } }
private void addSound(SoundLoadEvent event, String string) { event.manager.soundPoolSounds.addSound(data_minefantasy.sound(string)); }
@SubscribeEvent public void onSound(SoundLoadEvent event) { // event.manager.addSound("subaraki:petWhistle.ogg"); }
public void addSound(SoundLoadEvent event, Sounds sound){ event.manager.soundPoolSounds.addSound(Sounds.SOUND_LOCATION + ":" + sound.getName() + ".ogg"); }
@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); } } }
@ForgeSubscribe public void onSoundLoad(SoundLoadEvent event) { }
@SubscribeEvent public void onSound(SoundLoadEvent event) { }