Java 类net.minecraft.client.audio.MusicTicker 实例源码

项目:DecompiledMinecraft    文件:GuiWinGame.java   
/**
 * 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();
    }
}
项目:BaseClient    文件:GuiWinGame.java   
/**
 * 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();
    }
}
项目:BaseClient    文件:GuiWinGame.java   
/**
 * 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();
    }
}
项目:Backmemed    文件:GuiWinGame.java   
/**
 * 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();
    }
}
项目:CustomWorldGen    文件:GuiWinGame.java   
/**
 * 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();
    }
}
项目:4Space-1.7    文件:SpaceMusicTicker.java   
@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;
    }
}
项目:ExpandedRailsMod    文件:GuiWinGame.java   
/**
 * 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();
    }
}
项目:BaseClient    文件:Minecraft.java   
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;
}
项目:4Space-5    文件:ClientProxyCore.java   
@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();
}
项目:4Space-5    文件:MusicTickerGC.java   
@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;
    }
}
项目:4Space-5    文件:MusicHandlerClient.java   
@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;
    }
}
项目:DynamicSurroundings    文件:PlaySoundButton.java   
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);
    }
}
项目:4Space-1.7    文件:ClientProxy.java   
@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);
}
项目:DecompiledMinecraft    文件:Minecraft.java   
public MusicTicker func_181535_r()
{
    return this.mcMusicTicker;
}
项目:DecompiledMinecraft    文件:Minecraft.java   
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;
}
项目:BaseClient    文件:Minecraft.java   
public MusicTicker func_181535_r()
{
    return this.mcMusicTicker;
}
项目:BaseClient    文件:Minecraft.java   
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;
}
项目:BaseClient    文件:Minecraft.java   
public MusicTicker func_181535_r() {
    return this.mcMusicTicker;
}
项目:Zombe-Modpack    文件:Minecraft.java   
/**
 * Return the musicTicker's instance
 */
public MusicTicker getMusicTicker()
{
    return this.mcMusicTicker;
}
项目:Zombe-Modpack    文件:Minecraft.java   
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;
}
项目:Backmemed    文件:Minecraft.java   
/**
 * Return the musicTicker's instance
 */
public MusicTicker getMusicTicker()
{
    return this.mcMusicTicker;
}
项目:Backmemed    文件:Minecraft.java   
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;
}
项目:CustomWorldGen    文件:Minecraft.java   
/**
 * Return the musicTicker's instance
 */
public MusicTicker getMusicTicker()
{
    return this.mcMusicTicker;
}
项目:CustomWorldGen    文件:Minecraft.java   
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;
}
项目:4Space-5    文件:MusicHandlerClient.java   
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)));
}
项目:DynamicSurroundings    文件:MusicTickerReplacement.java   
@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;
}
项目:morecommands    文件:CommandMusic.java   
@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;
}
项目:Resilience-Client-Source    文件:Minecraft.java   
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);
}
项目:ExpandedRailsMod    文件:Minecraft.java   
/**
 * Return the musicTicker's instance
 */
public MusicTicker getMusicTicker()
{
    return this.mcMusicTicker;
}
项目:ExpandedRailsMod    文件:Minecraft.java   
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;
}
项目:Cauldron    文件:Minecraft.java   
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);
}
项目:Cauldron    文件:Minecraft.java   
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);
}