Java Code Examples for net.minecraft.init.Items.nether_star()

The following are Jave code examples for showing how to use nether_star() of the net.minecraft.init.Items 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: EntityItem.java   View Source Code Vote up 6 votes
/**
 * Called when the entity is attacked.
 */
public boolean attackEntityFrom(DamageSource source, float amount)
{
    if (this.isEntityInvulnerable(source))
    {
        return false;
    }
    else if (this.getEntityItem() != null && this.getEntityItem().getItem() == Items.nether_star && source.isExplosion())
    {
        return false;
    }
    else
    {
        this.setBeenAttacked();
        this.health = (int)((float)this.health - amount);

        if (this.health <= 0)
        {
            this.setDead();
        }

        return false;
    }
}
 
Example 2
Project: DecompiledMinecraft   File: EntityItem.java   View Source Code Vote up 6 votes
/**
 * Called when the entity is attacked.
 */
public boolean attackEntityFrom(DamageSource source, float amount)
{
    if (this.isEntityInvulnerable(source))
    {
        return false;
    }
    else if (this.getEntityItem() != null && this.getEntityItem().getItem() == Items.nether_star && source.isExplosion())
    {
        return false;
    }
    else
    {
        this.setBeenAttacked();
        this.health = (int)((float)this.health - amount);

        if (this.health <= 0)
        {
            this.setDead();
        }

        return false;
    }
}
 
Example 3
Project: BaseClient   File: DynamicLights.java   View Source Code Vote up 6 votes
public static int getLightLevel(ItemStack p_getLightLevel_0_)
{
    if (p_getLightLevel_0_ == null)
    {
        return 0;
    }
    else
    {
        Item item = p_getLightLevel_0_.getItem();

        if (item instanceof ItemBlock)
        {
            ItemBlock itemblock = (ItemBlock)item;
            Block block = itemblock.getBlock();

            if (block != null)
            {
                return block.getLightValue();
            }
        }

        return item == Items.lava_bucket ? Blocks.lava.getLightValue() : (item != Items.blaze_rod && item != Items.blaze_powder ? (item == Items.glowstone_dust ? 8 : (item == Items.prismarine_crystals ? 8 : (item == Items.magma_cream ? 8 : (item == Items.nether_star ? Blocks.beacon.getLightValue() / 2 : 0)))) : 10);
    }
}
 
Example 4
Project: BaseClient   File: EntityItem.java   View Source Code Vote up 6 votes
/**
 * Called when the entity is attacked.
 */
public boolean attackEntityFrom(DamageSource source, float amount)
{
    if (this.isEntityInvulnerable(source))
    {
        return false;
    }
    else if (this.getEntityItem() != null && this.getEntityItem().getItem() == Items.nether_star && source.isExplosion())
    {
        return false;
    }
    else
    {
        this.setBeenAttacked();
        this.health = (int)((float)this.health - amount);

        if (this.health <= 0)
        {
            this.setDead();
        }

        return false;
    }
}
 
Example 5
Project: BaseClient   File: EntityItem.java   View Source Code Vote up 6 votes
/**
 * Called when the entity is attacked.
 */
public boolean attackEntityFrom(DamageSource source, float amount)
{
    if (this.isEntityInvulnerable(source))
    {
        return false;
    }
    else if (this.getEntityItem() != null && this.getEntityItem().getItem() == Items.nether_star && source.isExplosion())
    {
        return false;
    }
    else
    {
        this.setBeenAttacked();
        this.health = (int)((float)this.health - amount);

        if (this.health <= 0)
        {
            this.setDead();
        }

        return false;
    }
}