當前位置: 首頁>>代碼示例>>Java>>正文


Java CreativeTabs類代碼示例

本文整理匯總了Java中net.minecraft.creativetab.CreativeTabs的典型用法代碼示例。如果您正苦於以下問題:Java CreativeTabs類的具體用法?Java CreativeTabs怎麽用?Java CreativeTabs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CreativeTabs類屬於net.minecraft.creativetab包,在下文中一共展示了CreativeTabs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: BlockPumpkin

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
protected BlockPumpkin()
{
    super(Material.GOURD, MapColor.ADOBE);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
    this.setTickRandomly(true);
    this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:BlockPumpkin.java

示例2: BlockStoneSlab

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
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);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:18,代碼來源:BlockStoneSlab.java

示例3: getSubItems

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
@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);
		}
	}
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:17,代碼來源:ItemATHandpick.java

示例4: postInit

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
@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);
	}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:17,代碼來源:EtFuturum.java

示例5: initGui

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
/**
 * 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));
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:28,代碼來源:GuiContainerCreative.java

示例6: BlockStoneSlab

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
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);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:18,代碼來源:BlockStoneSlab.java

示例7: mouseClicked

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:22,代碼來源:GuiContainerCreative.java

示例8: test_createSubItems_sameTabs

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
@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());
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:20,代碼來源:ItemHelperTests.java

示例9: updateCreativeSearch

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
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);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:23,代碼來源:GuiContainerCreative.java

示例10: ItemSword

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
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();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:9,代碼來源:ItemSword.java

示例11: BlockGrass

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
protected BlockGrass()
{
    super(Material.GRASS);
    this.setDefaultState(this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)));
    this.setTickRandomly(true);
    this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:BlockGrass.java

示例12: BlockCrops

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
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();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:10,代碼來源:BlockCrops.java

示例13: getSubItems

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
@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));
	}
}
 
開發者ID:p455w0rd,項目名稱:DankNull,代碼行數:8,代碼來源:ItemDankNull.java

示例14: BlockTripWireHook

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
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);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:BlockTripWireHook.java

示例15: BlockCarpet

import net.minecraft.creativetab.CreativeTabs; //導入依賴的package包/類
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);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:10,代碼來源:BlockCarpet.java


注:本文中的net.minecraft.creativetab.CreativeTabs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。