/** * Called from the main game loop to update the screen. */ public void updateScreen() { MusicTicker musicticker = this.mc.func_181535_r(); SoundHandler soundhandler = this.mc.getSoundHandler(); if (this.field_146581_h == 0) { musicticker.func_181557_a(); musicticker.func_181558_a(MusicTicker.MusicType.CREDITS); soundhandler.resumeSounds(); } soundhandler.update(); ++this.field_146581_h; float f = (float)(this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; if ((float)this.field_146581_h > f) { this.sendRespawnPacket(); } }
/** * Called from the main game loop to update the screen. */ public void updateScreen() { MusicTicker musicticker = this.mc.getMusicTicker(); SoundHandler soundhandler = this.mc.getSoundHandler(); if (this.time == 0) { musicticker.stopMusic(); musicticker.playMusic(MusicTicker.MusicType.CREDITS); soundhandler.resumeSounds(); } soundhandler.update(); ++this.time; float f = (float)(this.totalScrollLength + this.height + this.height + 24) / 0.5F; if ((float)this.time > f) { this.sendRespawnPacket(); } }
@Override public void update() { MusicTicker.MusicType musictype = this.field_147677_b.func_147109_W(); if (FMLClientHandler.instance().getWorldClient() != null && FMLClientHandler.instance().getWorldClient().provider instanceof IGalacticraftWorldProvider) { musictype = ClientProxy.MUSIC_TYPE_SPACE; } if (this.field_147678_c != null) { if (!musictype.getMusicTickerLocation().equals(this.field_147678_c.getPositionedSoundLocation())) { this.field_147677_b.getSoundHandler().stopSound(this.field_147678_c); this.field_147676_d = MathHelper.getRandomIntegerInRange(this.field_147679_a, 0, musictype.func_148634_b() / 2); } if (!this.field_147677_b.getSoundHandler().isSoundPlaying(this.field_147678_c)) { this.field_147678_c = null; this.field_147676_d = Math.min(MathHelper.getRandomIntegerInRange(this.field_147679_a, musictype.func_148634_b(), musictype.func_148633_c()), this.field_147676_d); } } if (this.field_147678_c == null && this.field_147676_d-- <= 0) { this.field_147678_c = PositionedSoundRecord.func_147673_a(musictype.getMusicTickerLocation()); this.field_147677_b.getSoundHandler().playSound(this.field_147678_c); this.field_147676_d = Integer.MAX_VALUE; } }
public MusicTicker.MusicType getAmbientMusicType() { return this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU; }
@Override public void init(FMLInitializationEvent event) { Class[][] commonTypes = { { MusicTicker.MusicType.class, ResourceLocation.class, int.class, int.class }, }; MUSIC_TYPE_MARS = EnumHelper.addEnum(commonTypes, MusicTicker.MusicType.class, "MARS_JC", new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "galacticraft.musicSpace"), 12000, 24000); ClientProxyCore.registerHandlers(); ClientProxyCore.registerTileEntityRenderers(); ClientProxyCore.registerBlockHandlers(); ClientProxyCore.setupCapes(); }
@Override public void update() { MusicTicker.MusicType musictype = this.field_147677_b.func_147109_W(); if (FMLClientHandler.instance().getWorldClient() != null && FMLClientHandler.instance().getWorldClient().provider instanceof IGalacticraftWorldProvider) { musictype = ClientProxyCore.MUSIC_TYPE_MARS; } if (this.field_147678_c != null) { if (!musictype.getMusicTickerLocation().equals(this.field_147678_c.getPositionedSoundLocation())) { this.field_147677_b.getSoundHandler().stopSound(this.field_147678_c); this.field_147676_d = MathHelper.getRandomIntegerInRange(this.field_147679_a, 0, musictype.func_148634_b() / 2); } if (!this.field_147677_b.getSoundHandler().isSoundPlaying(this.field_147678_c)) { this.field_147678_c = null; this.field_147676_d = Math.min(MathHelper.getRandomIntegerInRange(this.field_147679_a, musictype.func_148634_b(), musictype.func_148633_c()), this.field_147676_d); } } if (this.field_147678_c == null && this.field_147676_d-- <= 0) { this.field_147678_c = PositionedSoundRecord.func_147673_a(musictype.getMusicTickerLocation()); this.field_147677_b.getSoundHandler().playSound(this.field_147678_c); this.field_147676_d = Integer.MAX_VALUE; } }
@Override public void update() { MusicTicker.MusicType musictype = this.field_147677_b.func_147109_W(); WorldClient world = FMLClientHandler.instance().getWorldClient(); for (SpacePair<ICoreCelestial, MusicTicker.MusicType> pair : musicTypes) { if (world != null && pair.getFirst().instanceOfProvider(world.provider)) { musictype = pair.getSecond(); break; } } if (this.field_147678_c != null) { if (!musictype.getMusicTickerLocation().equals(this.field_147678_c.getPositionedSoundLocation())) { this.field_147677_b.getSoundHandler().stopSound(this.field_147678_c); this.field_147676_d = MathHelper.getRandomIntegerInRange(this.field_147679_a, 0, musictype.func_148634_b() / 2); } if (!this.field_147677_b.getSoundHandler().isSoundPlaying(this.field_147678_c)) { this.field_147678_c = null; this.field_147676_d = Math.min(MathHelper.getRandomIntegerInRange(this.field_147679_a, musictype.func_148634_b(), musictype.func_148633_c()), this.field_147676_d); } } if (this.field_147678_c == null && this.field_147676_d-- <= 0) { this.field_147678_c = PositionedSoundRecord.func_147673_a(musictype.getMusicTickerLocation()); this.field_147677_b.getSoundHandler().playSound(this.field_147678_c); this.field_147676_d = Integer.MAX_VALUE; } }
private void doPlay(@Nonnull final ConfigSound sound) { final MusicTicker ticker = Minecraft.getMinecraft().getMusicTicker(); this.playingSound = sound; if(ticker instanceof MusicTickerReplacement) { final MusicTickerReplacement mtr = (MusicTickerReplacement)ticker; mtr.setPlaying(sound); } else { this.soundEngine.playSound(sound); } }
@Override public void init(FMLInitializationEvent event) { Class[][] commonTypes = { { MusicTicker.MusicType.class, ResourceLocation.class, int.class, int.class }, }; MUSIC_TYPE_SPACE = EnumHelper.addEnum(commonTypes, MusicTicker.MusicType.class, "SNOWSTORM", new ResourceLocation(MercuryCore.ASSET_PREFIX, "4space.musicSpace"), 12000, 24000); ClientProxyCore.setupCapes(); super.init(event); }
public MusicTicker func_181535_r() { return this.mcMusicTicker; }
/** * Return the musicTicker's instance */ public MusicTicker getMusicTicker() { return this.mcMusicTicker; }
public MusicTicker.MusicType getAmbientMusicType() { return this.player != null ? (this.player.world.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.player.world.provider instanceof WorldProviderEnd ? (this.ingameGUI.getBossOverlay().shouldPlayEndBossMusic() ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.player.capabilities.isCreativeMode && this.player.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU; }
public MusicTicker.MusicType getAmbientMusicType() { return this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (this.ingameGUI.getBossOverlay().shouldPlayEndBossMusic() ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU; }
public void loadMusicType(ICoreCelestial celestialBody, String musicJson) { musicTypes.add(new SpacePair<ICoreCelestial, MusicTicker.MusicType>(celestialBody, EnumHelper.addEnum(COMMON_TYPES, MusicTicker.MusicType.class, celestialBody.prefixAsset.toUpperCase() + "MUSIC", new ResourceLocation(celestialBody.prefixAsset, musicJson), 12000, 24000))); }
@Override public void playMusic(@Nonnull final MusicTicker.MusicType requestedMusicType) { this.currentMusic = new MusicSound(requestedMusicType.getMusicLocation()).setVolumeScale(this.MUSIC_SCALER); SoundEngine.instance().playSound((BasicSound<?>) this.currentMusic); this.timeUntilNextMusic = Integer.MAX_VALUE; }
@Override public String execute(CommandSender sender, String[] params) throws CommandException { if (params.length > 0) { if (params[0].equalsIgnoreCase("play")) { if (!this.stopSound) throw new CommandException("command.music.isplaying", sender); this.stopSound = false; Minecraft.getMinecraft().getMusicTicker().playMusic(Minecraft.getMinecraft().getAmbientMusicType()); sender.sendLangfileMessage("command.music.played"); } else if (params[0].equalsIgnoreCase("next") || params[0].equalsIgnoreCase("skip")) { MusicTicker musicTicker = Minecraft.getMinecraft().getMusicTicker(); stopMusic(); musicTicker.playMusic(Minecraft.getMinecraft().getAmbientMusicType()); this.stopSound = false; sender.sendLangfileMessage("command.music.skipped"); } else if (params[0].equalsIgnoreCase("stop")) { stopMusic(); this.stopSound = true; sender.sendLangfileMessage("command.music.stopped"); } else if (params[0].equalsIgnoreCase("volume") && params.length > 1) { try { int volume = Integer.parseInt(params[1]); if (volume < 0) volume = 0; if (volume > 100) volume = 100; Minecraft.getMinecraft().gameSettings.setSoundLevel(SoundCategory.MUSIC, volume / 100.0F); Minecraft.getMinecraft().getSoundHandler().setSoundLevel(SoundCategory.MUSIC, volume / 100.0F); sender.sendLangfileMessage("command.music.volumeset"); } catch (NumberFormatException nfe) {throw new CommandException("command.music.invalidArg", sender);} } else throw new CommandException("command.music.invalidUsage", sender); } return null; }
public MusicTicker.MusicType func_147109_W() { return this.currentScreen instanceof GuiWinGame ? MusicTicker.MusicType.CREDITS : (this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU); }