本文整理汇总了Java中net.minecraft.client.audio.MusicTicker类的典型用法代码示例。如果您正苦于以下问题:Java MusicTicker类的具体用法?Java MusicTicker怎么用?Java MusicTicker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MusicTicker类属于net.minecraft.client.audio包,在下文中一共展示了MusicTicker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例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();
}
}
示例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();
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
示例10: func_181535_r
import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
public MusicTicker func_181535_r()
{
return this.mcMusicTicker;
}
示例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;
}
示例12: func_181535_r
import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
public MusicTicker func_181535_r() {
return this.mcMusicTicker;
}
示例13: getMusicTicker
import net.minecraft.client.audio.MusicTicker; //导入依赖的package包/类
/**
* Return the musicTicker's instance
*/
public MusicTicker getMusicTicker()
{
return this.mcMusicTicker;
}
示例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;
}
示例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;
}