本文整理匯總了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);
}