Java 类net.minecraft.creativetab.CreativeTabs 实例源码

项目:Backmemed    文件:BlockPumpkin.java   
protected BlockPumpkin()
{
    super(Material.GOURD, MapColor.ADOBE);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
    this.setTickRandomly(true);
    this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}
项目:DecompiledMinecraft    文件:BlockStoneSlab.java   
public BlockStoneSlab()
{
    super(Material.rock);
    IBlockState iblockstate = this.blockState.getBaseState();

    if (this.isDouble())
    {
        iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf(false));
    }
    else
    {
        iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM);
    }

    this.setDefaultState(iblockstate.withProperty(VARIANT, BlockStoneSlab.EnumType.STONE));
    this.setCreativeTab(CreativeTabs.tabBlock);
}
项目:Adventurers-Toolbox    文件:ItemATHandpick.java   
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> subItems) {
    if(!Config.DISABLED_TOOLS.contains("handpick")) {
        ItemStack stack1 = new ItemStack(this);
        NBTTagCompound tag = new NBTTagCompound();
        tag.setString(HEAD_TAG, Materials.randomHead().getName());
        tag.setString(HAFT_TAG, Materials.randomHaft().getName());
        tag.setString(HANDLE_TAG, Materials.randomHandle().getName());
        tag.setString(ADORNMENT_TAG, Materials.randomAdornment().getName());
        stack1.setTagCompound(tag);
        if (isInCreativeTab(tab)) {
            subItems.add(stack1);
        }
    }
}
项目:connor41-etfuturum2    文件:EtFuturum.java   
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
    Items.blaze_rod.setFull3D();
    Blocks.trapped_chest.setCreativeTab(CreativeTabs.tabRedstone);

    if (enableUpdatedFoodValues) {
        setFinalField(ItemFood.class, Items.carrot, 3, "healAmount", "field_77853_b");
        setFinalField(ItemFood.class, Items.baked_potato, 5, "healAmount", "field_77853_b");
    }

    if (enableUpdatedHarvestLevels) {
        Blocks.packed_ice.setHarvestLevel("pickaxe", 0);
        Blocks.ladder.setHarvestLevel("axe", 0);
        Blocks.melon_block.setHarvestLevel("axe", 0);
    }
}
项目:BaseClient    文件:GuiContainerCreative.java   
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    if (this.mc.playerController.isInCreativeMode())
    {
        super.initGui();
        this.buttonList.clear();
        Keyboard.enableRepeatEvents(true);
        this.searchField = new GuiTextField(0, this.fontRendererObj, this.guiLeft + 82, this.guiTop + 6, 89, this.fontRendererObj.FONT_HEIGHT);
        this.searchField.setMaxStringLength(15);
        this.searchField.setEnableBackgroundDrawing(false);
        this.searchField.setVisible(false);
        this.searchField.setTextColor(16777215);
        int i = selectedTabIndex;
        selectedTabIndex = -1;
        this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]);
        this.field_147059_E = new CreativeCrafting(this.mc);
        this.mc.thePlayer.inventoryContainer.onCraftGuiOpened(this.field_147059_E);
    }
    else
    {
        this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer));
    }
}
项目:CustomWorldGen    文件:BlockStoneSlab.java   
public BlockStoneSlab()
{
    super(Material.ROCK);
    IBlockState iblockstate = this.blockState.getBaseState();

    if (this.isDouble())
    {
        iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf(false));
    }
    else
    {
        iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM);
    }

    this.setDefaultState(iblockstate.withProperty(VARIANT, BlockStoneSlab.EnumType.STONE));
    this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}
项目:DecompiledMinecraft    文件:GuiContainerCreative.java   
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    if (this.mc.playerController.isInCreativeMode())
    {
        super.initGui();
        this.buttonList.clear();
        Keyboard.enableRepeatEvents(true);
        this.searchField = new GuiTextField(0, this.fontRendererObj, this.guiLeft + 82, this.guiTop + 6, 89, this.fontRendererObj.FONT_HEIGHT);
        this.searchField.setMaxStringLength(15);
        this.searchField.setEnableBackgroundDrawing(false);
        this.searchField.setVisible(false);
        this.searchField.setTextColor(16777215);
        int i = selectedTabIndex;
        selectedTabIndex = -1;
        this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]);
        this.field_147059_E = new CreativeCrafting(this.mc);
        this.mc.thePlayer.inventoryContainer.onCraftGuiOpened(this.field_147059_E);
    }
    else
    {
        this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer));
    }
}
项目:Backmemed    文件:GuiContainerCreative.java   
/**
 * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
 */
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
{
    if (mouseButton == 0)
    {
        int i = mouseX - this.guiLeft;
        int j = mouseY - this.guiTop;

        for (CreativeTabs creativetabs : CreativeTabs.CREATIVE_TAB_ARRAY)
        {
            if (this.isMouseOverTab(creativetabs, i, j))
            {
                return;
            }
        }
    }

    super.mouseClicked(mouseX, mouseY, mouseButton);
}
项目:customstuff4    文件:ItemHelperTests.java   
@Test
public void test_createSubItems_sameTabs()
{
    HashMap<Integer, String> map = Maps.newHashMap();
    map.put(0, "tools");
    map.put(1, "tools");

    Attribute<String> tabLabels = Attribute.map(map);
    int[] subtypes = new int[] {0, 1};

    Item item = new Item();
    item.setHasSubtypes(true);

    NonNullList<ItemStack> subItems = ItemHelper.createSubItems(item, CreativeTabs.TOOLS, tabLabels, subtypes);

    assertSame(2, subItems.size());
    assertSame(0, subItems.get(0).getItemDamage());
    assertSame(1, subItems.get(1).getItemDamage());
}
项目:CustomWorldGen    文件:GuiContainerCreative.java   
private void updateCreativeSearch()
{
    GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots;
    guicontainercreative$containercreative.itemList.clear();

    CreativeTabs tab = CreativeTabs.CREATIVE_TAB_ARRAY[selectedTabIndex];
    if (tab.hasSearchBar() && tab != CreativeTabs.SEARCH)
    {
        tab.displayAllRelevantItems(guicontainercreative$containercreative.itemList);
        updateFilteredItems(guicontainercreative$containercreative);
        return;
    }

    for (Item item : Item.REGISTRY)
    {
        if (item != null && item.getCreativeTab() != null)
        {
            item.getSubItems(item, (CreativeTabs)null, guicontainercreative$containercreative.itemList);
        }
    }
    updateFilteredItems(guicontainercreative$containercreative);
}
项目:BaseClient    文件:ItemSword.java   
public ItemSword(Item.ToolMaterial material)
{
    this.material = material;
    this.maxStackSize = 1;
    this.setMaxDamage(material.getMaxUses());
    this.setCreativeTab(CreativeTabs.tabCombat);
    this.attackDamage = 4.0F + material.getDamageVsEntity();
}
项目:Backmemed    文件:BlockGrass.java   
protected BlockGrass()
{
    super(Material.GRASS);
    this.setDefaultState(this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)));
    this.setTickRandomly(true);
    this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}
项目:CustomWorldGen    文件:BlockCrops.java   
protected BlockCrops()
{
    this.setDefaultState(this.blockState.getBaseState().withProperty(this.getAgeProperty(), Integer.valueOf(0)));
    this.setTickRandomly(true);
    this.setCreativeTab((CreativeTabs)null);
    this.setHardness(0.0F);
    this.setSoundType(SoundType.PLANT);
    this.disableStats();
}
项目:DankNull    文件:ItemDankNull.java   
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems) {
    for (int i = 0; i < 6; i++) {
        subItems.add(new ItemStack(itemIn, 1, i));
    }
}
项目:Backmemed    文件:BlockTripWireHook.java   
public BlockTripWireHook()
{
    super(Material.CIRCUITS);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(POWERED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)));
    this.setCreativeTab(CreativeTabs.REDSTONE);
    this.setTickRandomly(true);
}
项目:DecompiledMinecraft    文件:BlockCarpet.java   
protected BlockCarpet()
{
    super(Material.carpet);
    this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE));
    this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
    this.setTickRandomly(true);
    this.setCreativeTab(CreativeTabs.tabDecorations);
    this.setBlockBoundsFromMeta(0);
}
项目:BaseClient    文件:BlockPrismarine.java   
/**
 * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
 */
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
{
    list.add(new ItemStack(itemIn, 1, ROUGH_META));
    list.add(new ItemStack(itemIn, 1, BRICKS_META));
    list.add(new ItemStack(itemIn, 1, DARK_META));
}
项目:minecraft-territorialdealings    文件:FactionLedger.java   
public FactionLedger()
{
    this.setMaxStackSize(1);    // Can hold a big stack of these
    this.setFull3D();
    this.setCreativeTab(CreativeTabs.TOOLS);

    this.setRegistryName("factionledger");
    this.setUnlocalizedName("territorychevsky_factionledger");
}
项目:BaseClient    文件:BlockTripWireHook.java   
public BlockTripWireHook()
{
    super(Material.circuits);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(POWERED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)).withProperty(SUSPENDED, Boolean.valueOf(false)));
    this.setCreativeTab(CreativeTabs.tabRedstone);
    this.setTickRandomly(true);
}
项目:BaseClient    文件:ItemRecord.java   
protected ItemRecord(String name)
{
    this.recordName = name;
    this.maxStackSize = 1;
    this.setCreativeTab(CreativeTabs.tabMisc);
    RECORDS.put("records." + name, this);
}
项目:BaseClient    文件:BlockTrapDoor.java   
protected BlockTrapDoor(Material materialIn)
{
    super(materialIn);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(OPEN, Boolean.valueOf(false)).withProperty(HALF, BlockTrapDoor.DoorHalf.BOTTOM));
    float f = 0.5F;
    float f1 = 1.0F;
    this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    this.setCreativeTab(CreativeTabs.tabRedstone);
}
项目:Backmemed    文件:BlockSnow.java   
protected BlockSnow()
{
    super(Material.SNOW);
    this.setDefaultState(this.blockState.getBaseState().withProperty(LAYERS, Integer.valueOf(1)));
    this.setTickRandomly(true);
    this.setCreativeTab(CreativeTabs.DECORATIONS);
}
项目:Infernum    文件:ItemSpellPage.java   
@SideOnly(Side.CLIENT)
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems) {
    for (Spell spell : Infernum.SPELL_REGISTRY.getValues()) {
        if (!spell.equals(Spell.EMPTY_SPELL)) {
            ItemStack stack = new ItemStack(this);
            setSpell(stack, spell);
            subItems.add(stack);
        }
    }
}
项目:Backmemed    文件:GuiContainerCreative.java   
/**
 * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
 * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
 */
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
    if (selectedTabIndex != CreativeTabs.SEARCH.getTabIndex())
    {
        if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat))
        {
            this.setCurrentCreativeTab(CreativeTabs.SEARCH);
        }
        else
        {
            super.keyTyped(typedChar, keyCode);
        }
    }
    else
    {
        if (this.clearSearch)
        {
            this.clearSearch = false;
            this.searchField.setText("");
        }

        if (!this.checkHotbarKeys(keyCode))
        {
            if (this.searchField.textboxKeyTyped(typedChar, keyCode))
            {
                this.updateCreativeSearch();
            }
            else
            {
                super.keyTyped(typedChar, keyCode);
            }
        }
    }
}
项目:CustomWorldGen    文件:BlockSilverfish.java   
public BlockSilverfish()
{
    super(Material.CLAY);
    this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockSilverfish.EnumType.STONE));
    this.setHardness(0.0F);
    this.setCreativeTab(CreativeTabs.DECORATIONS);
}
项目:CustomWorldGen    文件:BlockLog.java   
public BlockLog()
{
    super(Material.WOOD);
    this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
    this.setHardness(2.0F);
    this.setSoundType(SoundType.WOOD);
}
项目:Mods    文件:ItemTF2.java   
@Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> par3List) {
    // System.out.println(this.getCreativeTab());
    if(!this.isInCreativeTab(par2CreativeTabs))
        return;
    for (int i = 0; i < 8; i++)
        par3List.add(new ItemStack(this, 1, i));
}
项目:DecompiledMinecraft    文件:BlockSapling.java   
protected BlockSapling()
{
    this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, BlockPlanks.EnumType.OAK).withProperty(STAGE, Integer.valueOf(0)));
    float f = 0.4F;
    this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
    this.setCreativeTab(CreativeTabs.tabDecorations);
}
项目:uniquecrops    文件:ItemPrecisionAxe.java   
@Override
  @SideOnly(Side.CLIENT)
  public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {

ItemStack precision = new ItemStack(item);
precision.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
list.add(precision);
  }
项目:BaseClient    文件:ItemFishFood.java   
/**
 * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
 */
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
{
    for (ItemFishFood.FishType itemfishfood$fishtype : ItemFishFood.FishType.values())
    {
        if (!this.cooked || itemfishfood$fishtype.canCook())
        {
            subItems.add(new ItemStack(this, 1, itemfishfood$fishtype.getMetadata()));
        }
    }
}
项目:DecompiledMinecraft    文件:ItemDye.java   
/**
 * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
 */
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
{
    for (int i = 0; i < 16; ++i)
    {
        subItems.add(new ItemStack(itemIn, 1, i));
    }
}
项目:PrimalChests    文件:BlockPrimalChest.java   
public BlockPrimalChest() {
    super(Material.WOOD);
    setUnlocalizedName("primal_chest");
    setCreativeTab(CreativeTabs.DECORATIONS);
    setHardness(2.5F);
    setSoundType(SoundType.WOOD);
}
项目:minecraft-territorialdealings    文件:TerritoryMap.java   
public TerritoryMap()
{
    this.setMaxStackSize(1);    // Can hold a big stack of these
    this.setCreativeTab(CreativeTabs.TOOLS);
    this.setHasSubtypes(true);

    this.setRegistryName("territorymap");
    this.setUnlocalizedName("territorychevsky_territorymap");
}
项目:DecompiledMinecraft    文件:BlockStairs.java   
protected BlockStairs(IBlockState modelState)
{
    super(modelState.getBlock().blockMaterial);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(HALF, BlockStairs.EnumHalf.BOTTOM).withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT));
    this.modelBlock = modelState.getBlock();
    this.modelState = modelState;
    this.setHardness(this.modelBlock.blockHardness);
    this.setResistance(this.modelBlock.blockResistance / 3.0F);
    this.setStepSound(this.modelBlock.stepSound);
    this.setLightOpacity(255);
    this.setCreativeTab(CreativeTabs.tabBlock);
}
项目:PurificatiMagicae    文件:BlockCrystalSmall.java   
@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list)
{
    for (Type t : Type.values())
    {
        list.add(new ItemStack(this, 1, t.ordinal()));
    }
}
项目:CustomWorldGen    文件:BlockDaylightDetector.java   
/**
 * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
 */
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
{
    if (!this.inverted)
    {
        super.getSubBlocks(itemIn, tab, list);
    }
}
项目:Machines-and-Stuff    文件:MBlocks.java   
private static void registerBlock(Block block, String key, String texture, Class tile, CreativeTabs tab) {
    block.setUnlocalizedName(key).setCreativeTab(TAB);
    if(DEVENV && FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
        writeFile(key, texture);
    renderMap.put(texture, block);
    GameRegistry.register(block, new ResourceLocation(Reference.MODID + ":" + key));
    GameRegistry.register(new ItemBlock(block), new ResourceLocation(Reference.MODID + ":" + key));
    if(tile != null) {
        GameRegistry.registerTileEntity(tile, key);
    }
}
项目:Backmemed    文件:BlockStem.java   
protected BlockStem(Block crop)
{
    this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FACING, EnumFacing.UP));
    this.crop = crop;
    this.setTickRandomly(true);
    this.setCreativeTab((CreativeTabs)null);
}
项目:WirelessCharger    文件:CreativeTabCustom.java   
public static void registerTab(){

        customTab = new CreativeTabs("creativetab") {
            @Override
            @SideOnly(Side.CLIENT)
            public ItemStack getTabIconItem() {
                return new ItemStack(ItemRegistry.itemUpgradeRange);
            }
        };
    }
项目:DecompiledMinecraft    文件:BlockStem.java   
protected BlockStem(Block crop)
{
    this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FACING, EnumFacing.UP));
    this.crop = crop;
    this.setTickRandomly(true);
    float f = 0.125F;
    this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
    this.setCreativeTab((CreativeTabs)null);
}