本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例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 : ""));
}