• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MusicTicker类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.client.audio.MusicTicker的典型用法代码示例。如果您正苦于以下问题:Java MusicTicker类的具体用法?Java MusicTicker怎么用?Java MusicTicker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MusicTicker类属于net.minecraft.client.audio包,在下文中一共展示了MusicTicker类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateScreen

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:GuiWinGame.java


示例2: updateScreen

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:GuiWinGame.java


示例3: init

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
@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();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:ClientProxyCore.java


示例4: update

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
@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;
	}
}
 
开发者ID:4Space,项目名称:4Space-1.7,代码行数:27,代码来源:SpaceMusicTicker.java


示例5: getAmbientMusicType

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
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;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:Minecraft.java


示例6: update

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
@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;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:33,代码来源:MusicTickerGC.java


示例7: update

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
@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;
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:31,代码来源:MusicHandlerClient.java


示例8: doPlay

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
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);
	}
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:11,代码来源:PlaySoundButton.java


示例9: init

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
@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);
}
 
开发者ID:4Space,项目名称:4Space-1.7,代码行数:9,代码来源:ClientProxy.java


示例10: func_181535_r

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
public MusicTicker func_181535_r()
{
    return this.mcMusicTicker;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:Minecraft.java


示例11: getAmbientMusicType

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
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;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:Minecraft.java


示例12: func_181535_r

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
public MusicTicker func_181535_r() {
	return this.mcMusicTicker;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:4,代码来源:Minecraft.java


示例13: getMusicTicker

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
/**
 * Return the musicTicker's instance
 */
public MusicTicker getMusicTicker()
{
    return this.mcMusicTicker;
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:8,代码来源:Minecraft.java


示例14: getAmbientMusicType

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
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;
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:5,代码来源:Minecraft.java


示例15: getAmbientMusicType

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:Minecraft.java


示例16: loadMusicType

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
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)));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:4,代码来源:MusicHandlerClient.java


示例17: playMusic

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
@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;
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:7,代码来源:MusicTickerReplacement.java


示例18: execute

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
@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;
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:44,代码来源:CommandMusic.java


示例19: func_147109_W

import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
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);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:Minecraft.java



注:本文中的net.minecraft.client.audio.MusicTicker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Constants类代码示例发布时间:2022-05-21
下一篇:
Java RecordFactoryProvider类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap