当前位置: 首页>>代码示例>>Java>>正文


Java ItemRecord.getRecord方法代码示例

本文整理汇总了Java中net.minecraft.item.ItemRecord.getRecord方法的典型用法代码示例。如果您正苦于以下问题:Java ItemRecord.getRecord方法的具体用法?Java ItemRecord.getRecord怎么用?Java ItemRecord.getRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.item.ItemRecord的用法示例。


在下文中一共展示了ItemRecord.getRecord方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: playRecord

import net.minecraft.item.ItemRecord; //导入方法依赖的package包/类
public void playRecord(String recordName, BlockPos blockPosIn)
{
    ISound isound = (ISound)this.mapSoundPositions.get(blockPosIn);

    if (isound != null)
    {
        this.mc.getSoundHandler().stopSound(isound);
        this.mapSoundPositions.remove(blockPosIn);
    }

    if (recordName != null)
    {
        ItemRecord itemrecord = ItemRecord.getRecord(recordName);

        if (itemrecord != null)
        {
            this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordNameLocal());
        }

        PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.create(new ResourceLocation(recordName), (float)blockPosIn.getX(), (float)blockPosIn.getY(), (float)blockPosIn.getZ());
        this.mapSoundPositions.put(blockPosIn, positionedsoundrecord);
        this.mc.getSoundHandler().playSound(positionedsoundrecord);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:RenderGlobal.java

示例2: playRecord

import net.minecraft.item.ItemRecord; //导入方法依赖的package包/类
public void playRecord(String p_72702_1_, int p_72702_2_, int p_72702_3_, int p_72702_4_)
{
    ChunkCoordinates chunkcoordinates = new ChunkCoordinates(p_72702_2_, p_72702_3_, p_72702_4_);
    ISound isound = (ISound)this.mapSoundPositions.get(chunkcoordinates);

    if (isound != null)
    {
        this.mc.getSoundHandler().stopSound(isound);
        this.mapSoundPositions.remove(chunkcoordinates);
    }

    if (p_72702_1_ != null)
    {
        ItemRecord itemrecord = ItemRecord.getRecord(p_72702_1_);

        ResourceLocation resource = null;
        if (itemrecord != null)
        {
            this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordNameLocal());
            resource = itemrecord.getRecordResource(p_72702_1_);
        }

        if (resource == null) resource = new ResourceLocation(p_72702_1_);
        PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_);
        this.mapSoundPositions.put(chunkcoordinates, positionedsoundrecord);
        this.mc.getSoundHandler().playSound(positionedsoundrecord);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:29,代码来源:RenderGlobal.java

示例3: playRecord

import net.minecraft.item.ItemRecord; //导入方法依赖的package包/类
/**
 * Plays the specified record. Arg: recordName, x, y, z
 */
public void playRecord(String par1Str, int par2, int par3, int par4)
{
    ItemRecord itemrecord = ItemRecord.getRecord(par1Str);

    if (par1Str != null && itemrecord != null)
    {
        this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordTitle());
    }

    this.mc.sndManager.playStreaming(par1Str, (float)par2, (float)par3, (float)par4);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:RenderGlobal.java

示例4: addInformation

import net.minecraft.item.ItemRecord; //导入方法依赖的package包/类
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, String trigger, boolean advTooltip) {
	String play = StatCollector.translateToLocal("effect.Play");
	if(play.equals("{Play}"))
		play = "" + EnumChatFormatting.GREEN + ((char) 0x266A) + EnumChatFormatting.LIGHT_PURPLE + ((char) 0x266B) + EnumChatFormatting.GOLD + ((char) 0x266A);
	
	//Get the localized record description
	String recordDescription = "Unknown";
	ItemRecord record = ItemRecord.getRecord("records."+itemStack.getTagCompound().getString("record"));
	if(record != null) { //If the record was from a mod that is no longer loaded, the description will stay "Unknown"
		recordDescription = record.getRecordNameLocal();
	}
	
	list.add(StatCollector.translateToLocal("effect.Plays the record") + " " + recordDescription + " " + StatCollector.translateToLocal("tool." + trigger) + " " + (itemStack.getTagCompound().getBoolean("playing") ? play : ""));
}
 
开发者ID:Draco18s,项目名称:Artifacts,代码行数:16,代码来源:ComponentMusicPlayer.java


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