本文整理汇总了Java中net.minecraft.block.material.Material.leaves方法的典型用法代码示例。如果您正苦于以下问题:Java Material.leaves方法的具体用法?Java Material.leaves怎么用?Java Material.leaves使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.material.Material
的用法示例。
在下文中一共展示了Material.leaves方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_175925_a
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
protected void func_175925_a(World worldIn, BlockPos p_175925_2_, int p_175925_3_)
{
int i = p_175925_3_ * p_175925_3_;
for (int j = -p_175925_3_; j <= p_175925_3_ + 1; ++j)
{
for (int k = -p_175925_3_; k <= p_175925_3_ + 1; ++k)
{
int l = j - 1;
int i1 = k - 1;
if (j * j + k * k <= i || l * l + i1 * i1 <= i || j * j + i1 * i1 <= i || l * l + k * k <= i)
{
BlockPos blockpos = p_175925_2_.add(j, 0, k);
Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial();
if (material == Material.air || material == Material.leaves)
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata);
}
}
}
}
}
示例2: breakBlock
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
int i = 4;
int j = i + 1;
if (worldIn.isAreaLoaded(pos.add(-j, -j, -j), pos.add(j, j, j)))
{
for (BlockPos blockpos : BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i)))
{
IBlockState iblockstate = worldIn.getBlockState(blockpos);
if (iblockstate.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate.getValue(BlockLeaves.CHECK_DECAY)).booleanValue())
{
worldIn.setBlockState(blockpos, iblockstate.withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(true)), 4);
}
}
}
}
示例3: func_175928_b
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
protected void func_175928_b(World worldIn, BlockPos p_175928_2_, int p_175928_3_)
{
int i = p_175928_3_ * p_175928_3_;
for (int j = -p_175928_3_; j <= p_175928_3_; ++j)
{
for (int k = -p_175928_3_; k <= p_175928_3_; ++k)
{
if (j * j + k * k <= i)
{
BlockPos blockpos = p_175928_2_.add(j, 0, k);
Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial();
if (material == Material.air || material == Material.leaves)
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata);
}
}
}
}
}
示例4: isNotColliding
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
/**
* Checks that the entity is not colliding with any blocks / liquids
*/
public boolean isNotColliding()
{
if (this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()))
{
BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
if (blockpos.getY() < this.worldObj.func_181545_F())
{
return false;
}
Block block = this.worldObj.getBlockState(blockpos.down()).getBlock();
if (block == Blocks.grass || block.getMaterial() == Material.leaves)
{
return true;
}
}
return false;
}
示例5: getTopSolidOrLiquidBlock
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
/**
* Finds the highest block on the x and z coordinate that is solid or liquid, and returns its y coord.
*/
public BlockPos getTopSolidOrLiquidBlock(BlockPos pos)
{
Chunk chunk = this.getChunkFromBlockCoords(pos);
BlockPos blockpos;
BlockPos blockpos1;
for (blockpos = new BlockPos(pos.getX(), chunk.getTopFilledSegment() + 16, pos.getZ()); blockpos.getY() >= 0; blockpos = blockpos1)
{
blockpos1 = blockpos.down();
Material material = chunk.getBlock(blockpos1).getMaterial();
if (material.blocksMovement() && material != Material.leaves)
{
break;
}
}
return blockpos;
}
示例6: func_181631_a
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
void func_181631_a(BlockPos p_181631_1_, float p_181631_2_, IBlockState p_181631_3_)
{
int i = (int)((double)p_181631_2_ + 0.618D);
for (int j = -i; j <= i; ++j)
{
for (int k = -i; k <= i; ++k)
{
if (Math.pow((double)Math.abs(j) + 0.5D, 2.0D) + Math.pow((double)Math.abs(k) + 0.5D, 2.0D) <= (double)(p_181631_2_ * p_181631_2_))
{
BlockPos blockpos = p_181631_1_.add(j, 0, k);
Material material = this.world.getBlockState(blockpos).getBlock().getMaterial();
if (material == Material.air || material == Material.leaves)
{
this.setBlockAndNotifyAdequately(this.world, blockpos, p_181631_3_);
}
}
}
}
}
示例7: func_175924_b
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
private void func_175924_b(World worldIn, BlockPos p_175924_2_)
{
Material material = worldIn.getBlockState(p_175924_2_).getBlock().getMaterial();
if (material == Material.air || material == Material.leaves)
{
this.setBlockAndNotifyAdequately(worldIn, p_175924_2_, field_181644_b);
}
}
示例8: onBlockDestroyed
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
/**
* Called when a Block is destroyed using this Item. Return true to trigger the "Use Item" statistic.
*/
public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn)
{
if (blockIn.getMaterial() != Material.leaves && blockIn != Blocks.web && blockIn != Blocks.tallgrass && blockIn != Blocks.vine && blockIn != Blocks.tripwire && blockIn != Blocks.wool)
{
return super.onBlockDestroyed(stack, worldIn, blockIn, pos, playerIn);
}
else
{
stack.damageItem(1, playerIn);
return true;
}
}
示例9: getStrVsBlock
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
public float getStrVsBlock(ItemStack stack, Block block)
{
if (block == Blocks.web)
{
return 15.0F;
}
else
{
Material material = block.getMaterial();
return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.gourd ? 1.0F : 1.5F;
}
}
示例10: generate
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
public boolean generate(World worldIn, Random rand, BlockPos position)
{
int i = this.func_150533_a(rand);
if (!this.func_175929_a(worldIn, rand, position, i))
{
return false;
}
else
{
this.func_150541_c(worldIn, position.getX(), position.getZ(), position.getY() + i, 0, rand);
for (int j = 0; j < i; ++j)
{
Block block = worldIn.getBlockState(position.up(j)).getBlock();
if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
{
this.setBlockAndNotifyAdequately(worldIn, position.up(j), this.woodMetadata);
}
if (j < i - 1)
{
block = worldIn.getBlockState(position.add(1, j, 0)).getBlock();
if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
{
this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 0), this.woodMetadata);
}
block = worldIn.getBlockState(position.add(1, j, 1)).getBlock();
if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
{
this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 1), this.woodMetadata);
}
block = worldIn.getBlockState(position.add(0, j, 1)).getBlock();
if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves)
{
this.setBlockAndNotifyAdequately(worldIn, position.add(0, j, 1), this.woodMetadata);
}
}
}
return true;
}
}
示例11: func_150523_a
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
protected boolean func_150523_a(Block p_150523_1_)
{
Material material = p_150523_1_.getMaterial();
return material == Material.air || material == Material.leaves || p_150523_1_ == Blocks.grass || p_150523_1_ == Blocks.dirt || p_150523_1_ == Blocks.log || p_150523_1_ == Blocks.log2 || p_150523_1_ == Blocks.sapling || p_150523_1_ == Blocks.vine;
}
示例12: generate
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
public boolean generate(World worldIn, Random rand, BlockPos position)
{
Block block;
while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0)
{
position = position.down();
}
Block block1 = worldIn.getBlockState(position).getBlock();
if (block1 == Blocks.dirt || block1 == Blocks.grass)
{
position = position.up();
this.setBlockAndNotifyAdequately(worldIn, position, this.woodMetadata);
for (int i = position.getY(); i <= position.getY() + 2; ++i)
{
int j = i - position.getY();
int k = 2 - j;
for (int l = position.getX() - k; l <= position.getX() + k; ++l)
{
int i1 = l - position.getX();
for (int j1 = position.getZ() - k; j1 <= position.getZ() + k; ++j1)
{
int k1 = j1 - position.getZ();
if (Math.abs(i1) != k || Math.abs(k1) != k || rand.nextInt(2) != 0)
{
BlockPos blockpos = new BlockPos(l, i, j1);
if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock())
{
this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata);
}
}
}
}
}
}
return true;
}
示例13: getStrVsBlock
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
public float getStrVsBlock(ItemStack stack, Block block)
{
return block != Blocks.web && block.getMaterial() != Material.leaves ? (block == Blocks.wool ? 5.0F : super.getStrVsBlock(stack, block)) : 15.0F;
}
示例14: canPlaceBlockAt
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
IBlockState iblockstate = worldIn.getBlockState(pos.down());
Block block = iblockstate.getBlock();
return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false;
}