本文整理汇总了Java中net.minecraft.init.Items.cake方法的典型用法代码示例。如果您正苦于以下问题:Java Items.cake方法的具体用法?Java Items.cake怎么用?Java Items.cake使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.init.Items
的用法示例。
在下文中一共展示了Items.cake方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCrafting
import net.minecraft.init.Items; //导入方法依赖的package包/类
/**
* the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood.
*/
protected void onCrafting(ItemStack stack)
{
if (this.amountCrafted > 0)
{
stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
}
this.amountCrafted = 0;
if (stack.getItem() == Item.getItemFromBlock(Blocks.crafting_table))
{
this.thePlayer.triggerAchievement(AchievementList.buildWorkBench);
}
if (stack.getItem() instanceof ItemPickaxe)
{
this.thePlayer.triggerAchievement(AchievementList.buildPickaxe);
}
if (stack.getItem() == Item.getItemFromBlock(Blocks.furnace))
{
this.thePlayer.triggerAchievement(AchievementList.buildFurnace);
}
if (stack.getItem() instanceof ItemHoe)
{
this.thePlayer.triggerAchievement(AchievementList.buildHoe);
}
if (stack.getItem() == Items.bread)
{
this.thePlayer.triggerAchievement(AchievementList.makeBread);
}
if (stack.getItem() == Items.cake)
{
this.thePlayer.triggerAchievement(AchievementList.bakeCake);
}
if (stack.getItem() instanceof ItemPickaxe && ((ItemPickaxe)stack.getItem()).getToolMaterial() != Item.ToolMaterial.WOOD)
{
this.thePlayer.triggerAchievement(AchievementList.buildBetterPickaxe);
}
if (stack.getItem() instanceof ItemSword)
{
this.thePlayer.triggerAchievement(AchievementList.buildSword);
}
if (stack.getItem() == Item.getItemFromBlock(Blocks.enchanting_table))
{
this.thePlayer.triggerAchievement(AchievementList.enchantments);
}
if (stack.getItem() == Item.getItemFromBlock(Blocks.bookshelf))
{
this.thePlayer.triggerAchievement(AchievementList.bookcase);
}
if (stack.getItem() == Items.golden_apple && stack.getMetadata() == 1)
{
this.thePlayer.triggerAchievement(AchievementList.overpowered);
}
}
示例2: getItem
import net.minecraft.init.Items; //导入方法依赖的package包/类
public Item getItem(World worldIn, BlockPos pos)
{
return Items.cake;
}