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

The following are Jave code examples for showing how to use lava_bucket() 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: 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 2
Project: DecompiledMinecraft   File: TileEntityFurnace.java   View Source Code Vote up 5 votes
/**
 * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
 * fuel
 */
public static int getItemBurnTime(ItemStack p_145952_0_)
{
    if (p_145952_0_ == null)
    {
        return 0;
    }
    else
    {
        Item item = p_145952_0_.getItem();

        if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air)
        {
            Block block = Block.getBlockFromItem(item);

            if (block == Blocks.wooden_slab)
            {
                return 150;
            }

            if (block.getMaterial() == Material.wood)
            {
                return 300;
            }

            if (block == Blocks.coal_block)
            {
                return 16000;
            }
        }

        return item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe)item).getMaterialName().equals("WOOD") ? 200 : (item == Items.stick ? 100 : (item == Items.coal ? 1600 : (item == Items.lava_bucket ? 20000 : (item == Item.getItemFromBlock(Blocks.sapling) ? 100 : (item == Items.blaze_rod ? 2400 : 0)))))));
    }
}
 
Example 3
Project: DecompiledMinecraft   File: TileEntityFurnace.java   View Source Code Vote up 5 votes
/**
 * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
 * fuel
 */
public static int getItemBurnTime(ItemStack p_145952_0_)
{
    if (p_145952_0_ == null)
    {
        return 0;
    }
    else
    {
        Item item = p_145952_0_.getItem();

        if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air)
        {
            Block block = Block.getBlockFromItem(item);

            if (block == Blocks.wooden_slab)
            {
                return 150;
            }

            if (block.getMaterial() == Material.wood)
            {
                return 300;
            }

            if (block == Blocks.coal_block)
            {
                return 16000;
            }
        }

        return item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe)item).getMaterialName().equals("WOOD") ? 200 : (item == Items.stick ? 100 : (item == Items.coal ? 1600 : (item == Items.lava_bucket ? 20000 : (item == Item.getItemFromBlock(Blocks.sapling) ? 100 : (item == Items.blaze_rod ? 2400 : 0)))))));
    }
}
 
Example 4
Project: BaseClient   File: TileEntityFurnace.java   View Source Code Vote up 5 votes
/**
 * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
 * fuel
 */
public static int getItemBurnTime(ItemStack p_145952_0_)
{
    if (p_145952_0_ == null)
    {
        return 0;
    }
    else
    {
        Item item = p_145952_0_.getItem();

        if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air)
        {
            Block block = Block.getBlockFromItem(item);

            if (block == Blocks.wooden_slab)
            {
                return 150;
            }

            if (block.getMaterial() == Material.wood)
            {
                return 300;
            }

            if (block == Blocks.coal_block)
            {
                return 16000;
            }
        }

        return item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe)item).getMaterialName().equals("WOOD") ? 200 : (item == Items.stick ? 100 : (item == Items.coal ? 1600 : (item == Items.lava_bucket ? 20000 : (item == Item.getItemFromBlock(Blocks.sapling) ? 100 : (item == Items.blaze_rod ? 2400 : 0)))))));
    }
}
 
Example 5
Project: BaseClient   File: TileEntityFurnace.java   View Source Code Vote up 5 votes
/**
 * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
 * fuel
 */
public static int getItemBurnTime(ItemStack p_145952_0_)
{
    if (p_145952_0_ == null)
    {
        return 0;
    }
    else
    {
        Item item = p_145952_0_.getItem();

        if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air)
        {
            Block block = Block.getBlockFromItem(item);

            if (block == Blocks.wooden_slab)
            {
                return 150;
            }

            if (block.getMaterial() == Material.wood)
            {
                return 300;
            }

            if (block == Blocks.coal_block)
            {
                return 16000;
            }
        }

        return item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe)item).getMaterialName().equals("WOOD") ? 200 : (item == Items.stick ? 100 : (item == Items.coal ? 1600 : (item == Items.lava_bucket ? 20000 : (item == Item.getItemFromBlock(Blocks.sapling) ? 100 : (item == Items.blaze_rod ? 2400 : 0)))))));
    }
}
 
Example 6
Project: DecompiledMinecraft   File: CreativeTabs.java   View Source Code Vote up 4 votes
public Item getTabIconItem()
{
    return Items.lava_bucket;
}
 
Example 7
Project: BaseClient   File: CreativeTabs.java   View Source Code Vote up 4 votes
public Item getTabIconItem()
{
    return Items.lava_bucket;
}
 
Example 8
Project: BaseClient   File: CreativeTabs.java   View Source Code Vote up 4 votes
public Item getTabIconItem()
{
    return Items.lava_bucket;
}
 
Example 9
Project: Proyecto-DASI   File: CraftingHelper.java   View Source Code Vote up 4 votes
/** Consume fuel from the player's inventory.<br>
 * Take it first from their cache, if present, and then from their inventory, starting
 * at the first slot and working upwards.
 * @param player
 * @param burnAmount amount of fuel to burn, in ticks.
 */
public static void burnInventory(EntityPlayerMP player, int burnAmount, ItemStack input)
{
    if (!fuelCaches.containsKey(player))
        fuelCaches.put(player, -burnAmount);
    else
        fuelCaches.put(player, fuelCaches.get(player) - burnAmount);
    int index = 0;
    while (fuelCaches.get(player) < 0 && index < player.inventory.mainInventory.length)
    {
        ItemStack is = player.inventory.mainInventory[index];
        if (is != null)
        {
            int burnTime = TileEntityFurnace.getItemBurnTime(is);
            if (burnTime != 0)
            {
                // Consume item:
                if (is.stackSize > 1)
                    is.stackSize--;
                else
                {
                    // If this is a bucket of lava, we need to consume the lava but leave the bucket.
                    if (is.getItem() == Items.lava_bucket)
                    {
                        // And if we're cooking wet sponge, we need to leave the bucket filled with water.
                        if (input.getItem() == Item.getItemFromBlock(Blocks.sponge) && input.getMetadata() == 1)
                            player.inventory.mainInventory[index] = new ItemStack(Items.water_bucket);
                        else
                            player.inventory.mainInventory[index] = new ItemStack(Items.bucket);
                    }
                    else
                        player.inventory.mainInventory[index] = null;
                    index++;
                }
                fuelCaches.put(player, fuelCaches.get(player) + burnTime);
            }
            else
                index++;
        }
        else
            index++;
    }
}
 
Example 10
Project: Proyecto-DASI   File: CraftingHelper.java   View Source Code Vote up 4 votes
/** Consume fuel from the player's inventory.<br>
 * Take it first from their cache, if present, and then from their inventory, starting
 * at the first slot and working upwards.
 * @param player
 * @param burnAmount amount of fuel to burn, in ticks.
 */
public static void burnInventory(EntityPlayerMP player, int burnAmount, ItemStack input)
{
    if (!fuelCaches.containsKey(player))
        fuelCaches.put(player, -burnAmount);
    else
        fuelCaches.put(player, fuelCaches.get(player) - burnAmount);
    int index = 0;
    while (fuelCaches.get(player) < 0 && index < player.inventory.mainInventory.length)
    {
        ItemStack is = player.inventory.mainInventory[index];
        if (is != null)
        {
            int burnTime = TileEntityFurnace.getItemBurnTime(is);
            if (burnTime != 0)
            {
                // Consume item:
                if (is.stackSize > 1)
                    is.stackSize--;
                else
                {
                    // If this is a bucket of lava, we need to consume the lava but leave the bucket.
                    if (is.getItem() == Items.lava_bucket)
                    {
                        // And if we're cooking wet sponge, we need to leave the bucket filled with water.
                        if (input.getItem() == Item.getItemFromBlock(Blocks.sponge) && input.getMetadata() == 1)
                            player.inventory.mainInventory[index] = new ItemStack(Items.water_bucket);
                        else
                            player.inventory.mainInventory[index] = new ItemStack(Items.bucket);
                    }
                    else
                        player.inventory.mainInventory[index] = null;
                    index++;
                }
                fuelCaches.put(player, fuelCaches.get(player) + burnTime);
            }
            else
                index++;
        }
        else
            index++;
    }
}