Java Code Examples for net.minecraft.block.material.Material.plants()

The following are Jave code examples for showing how to use plants() of the net.minecraft.block.material.Material class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: BlockReed.java   View Source Code Vote up 5 votes
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);
}
 
Example 2
Project: DecompiledMinecraft   File: BlockNetherWart.java   View Source Code Vote up 5 votes
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);
}
 
Example 3
Project: BaseClient   File: BlockNetherWart.java   View Source Code Vote up 5 votes
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);
}
 
Example 4
Project: DecompiledMinecraft   File: BlockReed.java   View Source Code Vote up 5 votes
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);
}
 
Example 5
Project: DecompiledMinecraft   File: BlockNetherWart.java   View Source Code Vote up 5 votes
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);
}
 
Example 6
Project: BaseClient   File: ItemSword.java   View Source Code Vote up 5 votes
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;
    }
}
 
Example 7
Project: BaseClient   File: BlockReed.java   View Source Code Vote up 5 votes
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);
}
 
Example 8
Project: BaseClient   File: BlockNetherWart.java   View Source Code Vote up 5 votes
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);
}
 
Example 9
Project: BaseClient   File: ItemSword.java   View Source Code Vote up 5 votes
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;
    }
}
 
Example 10
Project: DecompiledMinecraft   File: ItemAxe.java   View Source Code Vote up 4 votes
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;
}
 
Example 11
Project: minecraft-quiverbow   File: NetherFire.java   View Source Code Vote up 4 votes
@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
}
 
Example 12
Project: Prospecting   File: BlockIndicatorFlowerDouble.java   View Source Code Vote up 4 votes
public BlockIndicatorFlowerDouble() {
	super(Material.plants);
	this.setStepSound(soundTypeGrass);
}
 
Example 13
Project: DecompiledMinecraft   File: BlockCocoa.java   View Source Code Vote up 4 votes
public BlockCocoa()
{
    super(Material.plants);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(AGE, Integer.valueOf(0)));
    this.setTickRandomly(true);
}
 
Example 14
Project: BaseClient   File: BlockBush.java   View Source Code Vote up 4 votes
protected BlockBush()
{
    this(Material.plants);
}
 
Example 15
Project: DecompiledMinecraft   File: BlockBush.java   View Source Code Vote up 4 votes
protected BlockBush()
{
    this(Material.plants);
}
 
Example 16
Project: DecompiledMinecraft   File: BlockCocoa.java   View Source Code Vote up 4 votes
public BlockCocoa()
{
    super(Material.plants);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(AGE, Integer.valueOf(0)));
    this.setTickRandomly(true);
}
 
Example 17
Project: BaseClient   File: ItemAxe.java   View Source Code Vote up 4 votes
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;
}
 
Example 18
Project: Prospecting   File: BlockIndicatorFlower.java   View Source Code Vote up 4 votes
public BlockIndicatorFlower() {
	super(Material.plants);
	// this.setBlockName("Test Flower");
	// this.setBlockTextureName(Prospecting.MODID + ":test_flower");
	this.setStepSound(soundTypeGrass);
}
 
Example 19
Project: BaseClient   File: BlockCocoa.java   View Source Code Vote up 4 votes
public BlockCocoa()
{
    super(Material.plants);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(AGE, Integer.valueOf(0)));
    this.setTickRandomly(true);
}
 
Example 20
Project: BaseClient   File: ItemAxe.java   View Source Code Vote up 4 votes
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;
}