private static SoundEvent sound(String name) { ResourceLocation location = Util.getResource(name); SoundEvent event = new SoundEvent(location); event.setRegistryName(location); sounds.add(event); return event; }
private static SoundEvent makeSoundEvent(String name) { ResourceLocation loc = new ResourceLocation(LibMisc.MOD_ID, name); return new SoundEvent(loc).setRegistryName(loc); }
private static SoundEvent create(String soundNameIn) { ResourceLocation resourcelocation = new ResourceLocation(REFERENCE.MODID, soundNameIn); SoundEvent event = new SoundEvent(resourcelocation); event.setRegistryName(REFERENCE.MODID, soundNameIn.replaceAll("\\.", "_")); return event; } }
private static SoundEvent registerSound(String name) { //thanks for the help: https://github.com/Choonster/TestMod3/tree/162914a163c7fcb6bdd992917fcbc699584e40de/src/main/java/com/choonster/testmod3 // and http://www.minecraftforge.net/forum/index.php?topic=38076.0 final ResourceLocation res = new ResourceLocation(Const.MODID, name); SoundEvent sound = new SoundEvent(res); sound.setRegistryName(res); sounds.add(sound); return sound; }
private static SoundEvent createSoundEvent(final String soundName) { final ResourceLocation soundID = new ResourceLocation(MODID, soundName); return new SoundEvent(soundID).setRegistryName(soundID); } }
private static SoundEvent createSoundEvent(final String soundName) { ResourceLocation soundID = new ResourceLocation(GaiaReference.MOD_ID, soundName); return new SoundEvent(soundID).setRegistryName(soundID); } }
private static SoundEvent createSoundEvent(String soundName) { ResourceLocation registryName = new ResourceLocation(AncientWarfareNPC.MOD_ID, soundName); return new SoundEvent(registryName).setRegistryName(registryName); } }
private static SoundEvent registerSound(String soundNameIn) { ResourceLocation resource = new ResourceLocation(soundNameIn); SoundEvent sound = new SoundEvent(resource).setRegistryName(soundNameIn); return sound; }
public static void registerSounds(String... sounds) { for (String sound : sounds) { ResourceLocation resource = new ResourceLocation(MODID, sound); GameRegistry.register(new SoundEvent(resource), resource); } }
private static SoundEvent registerSound(String soundNameIn) { ResourceLocation resource = new ResourceLocation(soundNameIn); SoundEvent sound = new SoundEvent(resource).setRegistryName(soundNameIn); RegistrationHandler.Sounds.add(sound); return sound; }
/** * Register a {@link SoundEvent}. * * @param soundName The SoundEvent's name without the minecolonies prefix * @return The SoundEvent */ public static SoundEvent getSoundID(final String soundName) { return new SoundEvent(new ResourceLocation(Constants.MOD_ID, soundName)).setRegistryName(soundName); } }
public static SoundEvent[] createArray(String... soundNames) { SoundEvent[] sounds = new SoundEvent[soundNames.length]; for(int i = 0; i < soundNames.length; i++) { SoundEvent sound = new SoundEvent(new ResourceLocation(JurassiCraft.MODID, soundNames[i])); RegistryHandler.registerSound(sound, soundNames[i]); sounds[i] = sound; } return sounds; }
private static SoundEvent registerSound(String soundName) { ResourceLocation location = new ResourceLocation(FamiliarFauna.MOD_ID, soundName); SoundEvent event = new SoundEvent(location); event.setRegistryName(location); ForgeRegistries.SOUND_EVENTS.register(event); return event; } }
/** * Registers a new sound with the game. The sound must also exist in the sounds.json file. * * @param name The name of the sound file. No upper case chars! * @return The sound event that was registered. */ public SoundEvent registerSound (String name) { final ResourceLocation id = new ResourceLocation(this.modid, name); final SoundEvent sound = new SoundEvent(id).setRegistryName(id); this.sounds.add(sound); return sound; }
private static SoundEvent registerSoundEvent(String id) { SoundEvent sound = new SoundEvent(new ResourceLocation(ThermalDynamics.MOD_ID + ":" + id)); sound.setRegistryName(id); ForgeRegistries.SOUND_EVENTS.register(sound); return sound; }
private static SoundEvent registerSoundEvent(String id) { SoundEvent sound = new SoundEvent(new ResourceLocation(ThermalFoundation.MOD_ID + ":" + id)); sound.setRegistryName(id); ForgeRegistries.SOUND_EVENTS.register(sound); return sound; }
private static SoundEvent registerSoundEvent(String id) { SoundEvent sound = new SoundEvent(new ResourceLocation(ThermalExpansion.MOD_ID + ":" + id)); sound.setRegistryName(id); ForgeRegistries.SOUND_EVENTS.register(sound); return sound; }
@SubscribeEvent public static void registerSounds(@Nonnull ModSoundRegisterEvent event) { for (SoundRegistry soundRegistry : values()) { if (SoundEvent.REGISTRY.containsKey(soundRegistry.resourceLocation)) { soundRegistry.soundEvent = event.getRegistry().getValue(soundRegistry.resourceLocation); } else { SoundEvent soundEvent_nullchecked = soundRegistry.soundEvent = new SoundEvent(soundRegistry.resourceLocation); event.getRegistry().register(soundEvent_nullchecked.setRegistryName(soundRegistry.resourceLocation)); } } }
@SubscribeEvent public static void registerSounds(@Nonnull ModSoundRegisterEvent event) { for (SoundRegistry soundRegistry : values()) { if (SoundEvent.REGISTRY.containsKey(soundRegistry.resourceLocation)) { soundRegistry.soundEvent = event.getRegistry().getValue(soundRegistry.resourceLocation); } else { SoundEvent soundEvent_nullchecked = soundRegistry.soundEvent = new SoundEvent(soundRegistry.resourceLocation); event.getRegistry().register(soundEvent_nullchecked.setRegistryName(soundRegistry.resourceLocation)); } } }
@SubscribeEvent public static void registerSounds(RegistryEvent.Register<SoundEvent> event) { event.getRegistry().register(new SoundEvent(new ResourceLocation(IronBackpacks.MODID, "open_backpack")).setRegistryName("open_backpack")); event.getRegistry().register(new SoundEvent(new ResourceLocation(IronBackpacks.MODID, "close_backpack")).setRegistryName("close_backpack")); }