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

The following are Jave code examples for showing how to use fire() 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.
Example 1
Project: DecompiledMinecraft   File: CommandSpreadPlayers.java   Source Code and License Vote up 6 votes
public boolean func_111098_b(World worldIn)
{
    BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b);

    while (blockpos.getY() > 0)
    {
        blockpos = blockpos.down();
        Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial();

        if (material != Material.air)
        {
            return !material.isLiquid() && material != Material.fire;
        }
    }

    return false;
}
 
Example 2
Project: DecompiledMinecraft   File: CommandSpreadPlayers.java   Source Code and License Vote up 6 votes
public boolean func_111098_b(World worldIn)
{
    BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b);

    while (blockpos.getY() > 0)
    {
        blockpos = blockpos.down();
        Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial();

        if (material != Material.air)
        {
            return !material.isLiquid() && material != Material.fire;
        }
    }

    return false;
}
 
Example 3
Project: BaseClient   File: CommandSpreadPlayers.java   Source Code and License Vote up 6 votes
public boolean func_111098_b(World worldIn)
{
    BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b);

    while (blockpos.getY() > 0)
    {
        blockpos = blockpos.down();
        Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial();

        if (material != Material.air)
        {
            return !material.isLiquid() && material != Material.fire;
        }
    }

    return false;
}
 
Example 4
Project: BaseClient   File: CommandSpreadPlayers.java   Source Code and License Vote up 6 votes
public boolean func_111098_b(World worldIn)
{
    BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b);

    while (blockpos.getY() > 0)
    {
        blockpos = blockpos.down();
        Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial();

        if (material != Material.air)
        {
            return !material.isLiquid() && material != Material.fire;
        }
    }

    return false;
}
 
Example 5
Project: DecompiledMinecraft   File: BlockFire.java   Source Code and License Vote up 4 votes
protected BlockFire()
{
    super(Material.fire);
    this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FLIP, Boolean.valueOf(false)).withProperty(ALT, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)).withProperty(UPPER, Integer.valueOf(0)));
    this.setTickRandomly(true);
}
 
Example 6
Project: DecompiledMinecraft   File: BlockFire.java   Source Code and License Vote up 4 votes
protected BlockFire()
{
    super(Material.fire);
    this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FLIP, Boolean.valueOf(false)).withProperty(ALT, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)).withProperty(UPPER, Integer.valueOf(0)));
    this.setTickRandomly(true);
}
 
Example 7
Project: BaseClient   File: BlockFire.java   Source Code and License Vote up 4 votes
protected BlockFire()
{
    super(Material.fire);
    this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FLIP, Boolean.valueOf(false)).withProperty(ALT, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)).withProperty(UPPER, Integer.valueOf(0)));
    this.setTickRandomly(true);
}
 
Example 8
Project: BaseClient   File: BlockFire.java   Source Code and License Vote up 4 votes
protected BlockFire()
{
    super(Material.fire);
    this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FLIP, Boolean.valueOf(false)).withProperty(ALT, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)).withProperty(UPPER, Integer.valueOf(0)));
    this.setTickRandomly(true);
}
 
Example 9
Project: minecraft-quiverbow   File: FenGoop.java   Source Code and License Vote up 4 votes
@Override
public void onImpact(MovingObjectPosition target)
{
	if (target.entityHit != null) // hit a entity
   	{
   		target.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), (float) 0);	// No dmg, but knockback
           target.entityHit.hurtResistantTime = 0;
           target.entityHit.setFire(fireDuration); 	// Some minor fire, for flavor
   	}
   	else // hit the terrain
       {        	
       	int plusX = 0;
   		int plusY = 0;
   		int plusZ = 0;
   		
   		int posiX = target.blockX;
   		int posiY = target.blockY;
   		int posiZ = target.blockZ;

   		//Block targetBlock = this.worldObj.getBlock(posiX, posiY, posiZ);
   		
   		// Is the attached block a valid material?
   		boolean canPlace = false;
   		if ( Helper.hasValidMaterial(this.worldObj, posiX, posiY, posiZ) ) { canPlace = true; }
   		
       	// Glass breaking
           if ( Helper.tryBlockBreak(this.worldObj, this, target, 0)) { canPlace = false; }
   		
   		if (target.sideHit == 0) { plusY = -1; } 		// Bottom		
   		else if (target.sideHit == 1) { plusY = 1; } 	// Top
   		else if (target.sideHit == 2) { plusZ = -1; } 	// East
   		else if (target.sideHit == 3){ plusZ = 1; } 	// West
   		else if (target.sideHit == 4){ plusX = -1; } 	// North
   		else if (target.sideHit == 5) { plusX = 1; } 	// South
   		
   		// Is the space free?
   		if (this.worldObj.getBlock( (int)posiX + plusX, (int)posiY + plusY, (int)posiZ + plusZ).getMaterial() == Material.air ||
   				this.worldObj.getBlock( (int)posiX + plusX, (int)posiY + plusY, (int)posiZ + plusZ).getMaterial() == Material.fire ||
   				this.worldObj.getBlock( (int)posiX + plusX, (int)posiY + plusY, (int)posiZ + plusZ).getMaterial() == Material.grass ||
   				this.worldObj.getBlock( (int)posiX + plusX, (int)posiY + plusY, (int)posiZ + plusZ).getMaterial() == Material.snow ||
   				this.worldObj.getBlock( (int)posiX + plusX, (int)posiY + plusY, (int)posiZ + plusZ).getMaterial() == Material.water)
       	{
   			// Putting light there (if we can)
   			if (canPlace)
   			{
    			this.worldObj.setBlock(posiX + plusX, posiY + plusY, posiZ + plusZ, Main.fenLight, 0, 3);
    			this.worldObj.setBlockMetadataWithNotify(posiX + plusX, posiY + plusY, posiZ + plusZ, target.sideHit, 3);
    			
    			if (this.lightTick != 0) 
    			{ 
    				this.worldObj.scheduleBlockUpdate(posiX + plusX, posiY + plusY, posiZ + plusZ, Main.fenLight, this.lightTick); 
    			}
    			// else, stays on indefinitely
   			}
   			// else, can't place. The block isn't of a valid material
       	}
   		// else, none of the allowed materials
       }
   	
   	// SFX
   	for (int i = 0; i < 8; ++i) { this.worldObj.spawnParticle("slime", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); }
       this.worldObj.playSoundAtEntity(this, Block.soundTypeGlass.getBreakSound(), 1.0F, 1.0F);
       
       this.setDead();		// We've hit something, so begone with the projectile
}