本文整理匯總了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);
}
示例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);
}
示例3: BlockTesla
public BlockTesla() {
super(Material.ANVIL);
setCreativeTab(EonContent.TAB);
setUnlocalizedName("tesla");
setLightOpacity(0);
}
示例4: TestBlock
TestBlock()
{
super(Material.ANVIL);
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例8: canHarvestBlock
@Override
public boolean canHarvestBlock(IBlockState blockIn)
{
return blockIn.getMaterial() == Material.ROCK || ((blockIn.getMaterial() == Material.IRON || blockIn.getMaterial() == Material.ANVIL) || super.canHarvestBlock(blockIn));
}
示例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();
}