本文整理匯總了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);
}