本文整理汇总了Java中net.minecraft.item.Item.getItemStackDisplayName方法的典型用法代码示例。如果您正苦于以下问题:Java Item.getItemStackDisplayName方法的具体用法?Java Item.getItemStackDisplayName怎么用?Java Item.getItemStackDisplayName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.item.Item
的用法示例。
在下文中一共展示了Item.getItemStackDisplayName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawSlot
import net.minecraft.item.Item; //导入方法依赖的package包/类
protected void drawSlot(int entryID, int insideLeft, int yPos, int insideSlotHeight, int mouseXIn, int mouseYIn)
{
FlatLayerInfo flatlayerinfo = (FlatLayerInfo)GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().get(GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - entryID - 1);
IBlockState iblockstate = flatlayerinfo.getLayerMaterial();
Block block = iblockstate.getBlock();
Item item = Item.getItemFromBlock(block);
if (item == Items.field_190931_a)
{
if (block != Blocks.WATER && block != Blocks.FLOWING_WATER)
{
if (block == Blocks.LAVA || block == Blocks.FLOWING_LAVA)
{
item = Items.LAVA_BUCKET;
}
}
else
{
item = Items.WATER_BUCKET;
}
}
ItemStack itemstack = new ItemStack(item, 1, item.getHasSubtypes() ? block.getMetaFromState(iblockstate) : 0);
String s = item.getItemStackDisplayName(itemstack);
this.drawItem(insideLeft, yPos, itemstack);
GuiCreateFlatWorld.this.fontRendererObj.drawString(s, insideLeft + 18 + 5, yPos + 3, 16777215);
String s1;
if (entryID == 0)
{
s1 = I18n.format("createWorld.customize.flat.layer.top", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())});
}
else if (entryID == GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - 1)
{
s1 = I18n.format("createWorld.customize.flat.layer.bottom", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())});
}
else
{
s1 = I18n.format("createWorld.customize.flat.layer", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())});
}
GuiCreateFlatWorld.this.fontRendererObj.drawString(s1, insideLeft + 2 + 213 - GuiCreateFlatWorld.this.fontRendererObj.getStringWidth(s1), yPos + 3, 16777215);
}