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


Java Items.cake方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:68,代码来源:SlotCrafting.java

示例2: getItem

import net.minecraft.init.Items; //导入方法依赖的package包/类
public Item getItem(World worldIn, BlockPos pos)
{
    return Items.cake;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:BlockCake.java


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