Java Code Examples for net.minecraft.item.Item.getCreativeTabs()

The following are Jave code examples for showing how to use getCreativeTabs() of the net.minecraft.item.Item 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: CustomWorldGen   File: CreativeTabs.java   Source Code and License Vote up 6 votes
/**
 * only shows items which have tabToDisplayOn == this
 */
@SideOnly(Side.CLIENT)
public void displayAllRelevantItems(List<ItemStack> p_78018_1_)
{
    for (Item item : Item.REGISTRY)
    {
        if (item == null)
        {
            continue;
        }
        for (CreativeTabs tab : item.getCreativeTabs())
        {
            if (tab == this)
            {
                item.getSubItems(item, this, p_78018_1_);
            }
        }
    }

    if (this.getRelevantEnchantmentTypes() != null)
    {
        this.addEnchantmentBooksToList(p_78018_1_, this.getRelevantEnchantmentTypes());
    }
}