当前位置: 首页>>代码示例>>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;未经允许,请勿转载。