本文整理汇总了Java中net.minecraft.block.material.Material.plants方法的典型用法代码示例。如果您正苦于以下问题:Java Material.plants方法的具体用法?Java Material.plants怎么用?Java Material.plants使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.material.Material
的用法示例。
在下文中一共展示了Material.plants方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BlockReed
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
protected BlockReed()
{
super(Material.plants);
this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)));
float f = 0.375F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f);
this.setTickRandomly(true);
}
示例2: BlockNetherWart
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
protected BlockNetherWart()
{
super(Material.plants, MapColor.redColor);
this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)));
this.setTickRandomly(true);
float f = 0.5F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
this.setCreativeTab((CreativeTabs)null);
}
示例3: 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;
}
}
示例4: getStrVsBlock
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
public float getStrVsBlock(ItemStack stack, Block block)
{
return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial;
}
示例5: onImpact
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
@Override
public void onImpact(MovingObjectPosition target)
{
if (target.entityHit != null) // We hit a living thing!
{
// Damage
target.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), (float) this.damage);
target.entityHit.hurtResistantTime = 0;
// Effect
target.entityHit.setFire(this.fireDuration);
}
else
{
Block block = this.worldObj.getBlock(target.blockX, target.blockY, target.blockZ);
// Glass breaking
Helper.tryBlockBreak(this.worldObj, this, target, 1); // Medium
// Let's create fire here (if we're allowed to)
if (this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") && block != Blocks.fire)
{
if (this.worldObj.getBlock(target.blockX, target.blockY + 1, target.blockZ).isAir(this.worldObj, target.blockX, target.blockY + 1, target.blockZ))
{
// the block above the block we hit is air, so let's set it on fire!
this.worldObj.setBlock(target.blockX, target.blockY + 1, target.blockZ, Blocks.fire, 0, 3);
}
// else, not a airblock above this
}
// Have we hit snow? Turning that into snow layer
if (block == Blocks.snow)
{
this.worldObj.setBlock(target.blockX, target.blockY, target.blockZ, Blocks.snow_layer, 7, 3);
}
// Have we hit snow layer? Melting that down into nothing
else if (block == Blocks.snow_layer)
{
int currentMeta = this.worldObj.getBlockMetadata(target.blockX, target.blockY, target.blockZ);
// Is this taller than 0? Melting it down then
if (currentMeta > 0) { this.worldObj.setBlock(target.blockX, target.blockY, target.blockZ, Blocks.snow_layer, currentMeta - 1, 3); }
// Is this 0 already? Turning it into air
else { this.worldObj.setBlockToAir(target.blockX, target.blockY, target.blockZ); }
}
// Have we hit ice? Turning that into water
else if (block == Blocks.ice)
{
this.worldObj.setBlock(target.blockX, target.blockY, target.blockZ, Blocks.water, 0, 3);
}
Block topBlock = this.worldObj.getBlock(target.blockX, target.blockY + 1, target.blockZ);
// Did we hit grass? Burning it
if (topBlock.getMaterial() == Material.plants)
{
this.worldObj.setBlock(target.blockX, target.blockY + 1, target.blockZ, Blocks.fire, 0, 3);
}
if (block.getMaterial() == Material.plants)
{
this.worldObj.setBlock(target.blockX, target.blockY, target.blockZ, Blocks.fire, 0, 3);
}
}
// SFX
this.worldObj.playSoundAtEntity(this, "random.fizz", 0.7F, 1.5F);
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
this.setDead(); // We've hit something, so begone with the projectile. hitting glass only once
}
示例6: BlockIndicatorFlowerDouble
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
public BlockIndicatorFlowerDouble() {
super(Material.plants);
this.setStepSound(soundTypeGrass);
}
示例7: BlockCocoa
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
public BlockCocoa()
{
super(Material.plants);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(AGE, Integer.valueOf(0)));
this.setTickRandomly(true);
}
示例8: BlockBush
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
protected BlockBush()
{
this(Material.plants);
}
示例9: BlockIndicatorFlower
import net.minecraft.block.material.Material; //导入方法依赖的package包/类
public BlockIndicatorFlower() {
super(Material.plants);
// this.setBlockName("Test Flower");
// this.setBlockTextureName(Prospecting.MODID + ":test_flower");
this.setStepSound(soundTypeGrass);
}