當前位置: 首頁>>代碼示例>>Java>>正文


Java Material.ANVIL屬性代碼示例

本文整理匯總了Java中net.minecraft.block.material.Material.ANVIL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.ANVIL屬性的具體用法?Java Material.ANVIL怎麽用?Java Material.ANVIL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在net.minecraft.block.material.Material的用法示例。


在下文中一共展示了Material.ANVIL屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getStrVsBlock

@Override
public float getStrVsBlock(ItemStack stack, IBlockState state) {
	//Certain materials are just effective with a pickaxe, and by extension, hammers.
       Material material = state.getMaterial();
       if (material == Material.IRON || material == Material.ANVIL || material == Material.ROCK) return this.efficiencyOnProperMaterial;
       
       if (WHITELIST.contains(state.getBlock())) return this.efficiencyOnProperMaterial;
       else return super.getStrVsBlock(stack, state);
   }
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:9,代碼來源:ItemHammer.java

示例2: BlockAnvil

protected BlockAnvil()
{
    super(Material.ANVIL);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(DAMAGE, Integer.valueOf(0)));
    this.setLightOpacity(0);
    this.setCreativeTab(CreativeTabs.DECORATIONS);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:7,代碼來源:BlockAnvil.java

示例3: BlockTesla

public BlockTesla() {
    super(Material.ANVIL);
    setCreativeTab(EonContent.TAB);
    setUnlocalizedName("tesla");
    setLightOpacity(0);
}
 
開發者ID:Guichaguri,項目名稱:ProjectEon,代碼行數:6,代碼來源:BlockTesla.java

示例4: TestBlock

TestBlock()
{
    super(Material.ANVIL);
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:4,代碼來源:BitStateMetaMapperTests.java

示例5: canHarvestBlock

public boolean canHarvestBlock(IBlockState blockIn)
{
    Block block = blockIn.getBlock();

    if (block == Blocks.OBSIDIAN)
    {
        return this.toolMaterial.getHarvestLevel() == 3;
    }
    else if (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE)
    {
        if (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK)
        {
            if (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE)
            {
                if (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE)
                {
                    if (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE)
                    {
                        if (block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE)
                        {
                            Material material = blockIn.getMaterial();
                            return material == Material.ROCK ? true : (material == Material.IRON ? true : material == Material.ANVIL);
                        }
                        else
                        {
                            return this.toolMaterial.getHarvestLevel() >= 2;
                        }
                    }
                    else
                    {
                        return this.toolMaterial.getHarvestLevel() >= 1;
                    }
                }
                else
                {
                    return this.toolMaterial.getHarvestLevel() >= 1;
                }
            }
            else
            {
                return this.toolMaterial.getHarvestLevel() >= 2;
            }
        }
        else
        {
            return this.toolMaterial.getHarvestLevel() >= 2;
        }
    }
    else
    {
        return this.toolMaterial.getHarvestLevel() >= 2;
    }
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:53,代碼來源:ItemPrecisionPick.java

示例6: getStrVsBlock

public float getStrVsBlock(ItemStack stack, IBlockState state)
{
    Material material = state.getMaterial();
    return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:5,代碼來源:ItemPrecisionPick.java

示例7: canHarvestBlock

/**
 * Check whether this Item can harvest the given Block
 */
public boolean canHarvestBlock(IBlockState blockIn)
{
    Block block = blockIn.getBlock();

    if (block == Blocks.OBSIDIAN)
    {
        return this.toolMaterial.getHarvestLevel() == 3;
    }
    else if (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE)
    {
        if (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK)
        {
            if (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE)
            {
                if (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE)
                {
                    if (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE)
                    {
                        if (block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE)
                        {
                            Material material = blockIn.getMaterial();
                            return material == Material.ROCK ? true : (material == Material.IRON ? true : material == Material.ANVIL);
                        }
                        else
                        {
                            return this.toolMaterial.getHarvestLevel() >= 2;
                        }
                    }
                    else
                    {
                        return this.toolMaterial.getHarvestLevel() >= 1;
                    }
                }
                else
                {
                    return this.toolMaterial.getHarvestLevel() >= 1;
                }
            }
            else
            {
                return this.toolMaterial.getHarvestLevel() >= 2;
            }
        }
        else
        {
            return this.toolMaterial.getHarvestLevel() >= 2;
        }
    }
    else
    {
        return this.toolMaterial.getHarvestLevel() >= 2;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:56,代碼來源:ItemPickaxe.java

示例8: canHarvestBlock

@Override
public boolean canHarvestBlock(IBlockState blockIn)
   {
	return blockIn.getMaterial() == Material.ROCK || ((blockIn.getMaterial() == Material.IRON || blockIn.getMaterial() == Material.ANVIL) || super.canHarvestBlock(blockIn));
   }
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:5,代碼來源:ItemPickaxe.java

示例9: getStrVsBlock

@Override
public float getStrVsBlock(ItemStack stack, IBlockState state)
   {
       Material material = state.getMaterial();
       return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.getStats(stack).getEfficiency();
   }
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:6,代碼來源:ItemPickaxe.java


注:本文中的net.minecraft.block.material.Material.ANVIL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。