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


Java Block.setCreativeTab方法代碼示例

本文整理匯總了Java中net.minecraft.block.Block.setCreativeTab方法的典型用法代碼示例。如果您正苦於以下問題:Java Block.setCreativeTab方法的具體用法?Java Block.setCreativeTab怎麽用?Java Block.setCreativeTab使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.block.Block的用法示例。


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

示例1: registerBlocks

import net.minecraft.block.Block; //導入方法依賴的package包/類
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
    final IForgeRegistry<Block> registry = event.getRegistry();

    for (final IFluidBlock fluidBlock : MOD_FLUID_BLOCKS) {
        final Block block = (Block) fluidBlock;
        block.setRegistryName(RL("fluid." + fluidBlock.getFluid().getName()));
        block.setUnlocalizedName(fluidBlock.getFluid().getName());
        block.setCreativeTab(PneumaticCraftRepressurized.tabPneumaticCraft);
        registry.register(block);
        fluidToBlockMap.put(fluidBlock.getFluid().getName(), block);
        Log.info("registered block for fluid: " + fluidBlock.getFluid().getName());
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:15,代碼來源:Fluids.java

示例2: regRender

import net.minecraft.block.Block; //導入方法依賴的package包/類
public static void regRender(Block block) {
	block.setCreativeTab(HarshenCastle.harshenTab);
	int timesToLoad = 1;
	boolean flag = blockDataMap.keySet().contains(block);
	if(flag)
		timesToLoad = blockDataMap.get(block);
	for(int i = 0; i < timesToLoad; i++)
		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), i, new ModelResourceLocation(block.getRegistryName() + 
				(flag ? "." + ((IMetaItemBlock)block).getNames()[i]: ""), "inventory"));
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:11,代碼來源:HarshenBlocks.java

示例3: registerBlock

import net.minecraft.block.Block; //導入方法依賴的package包/類
private static void registerBlock(Block block, String registryName, ItemBlock itemBlock, boolean inCreativeTab) {
    // Set the registry name.
    block.setRegistryName(Reference.MOD_ID, registryName);
    block.setUnlocalizedName(Reference.MOD_ID + "." + registryName);
    // Add to the game registry.
    GameRegistry.register(block);
    GameRegistry.register(itemBlock, block.getRegistryName());

    if (inCreativeTab)
        block.setCreativeTab(ChatBomb.creativeTab);

    System.out.println("Registered block ~ "+block.getRegistryName());

}
 
開發者ID:MasterEric,項目名稱:ChatBomb,代碼行數:15,代碼來源:ModBlocks.java

示例4: generalRegisterBlock

import net.minecraft.block.Block; //導入方法依賴的package包/類
public static void generalRegisterBlock(String name, Block block)
{
	block.setUnlocalizedName(ModConstants.MODID + ":" + name);
	block.setRegistryName(name);
	block.setCreativeTab(AnimaTab.Tab);
	blocks.add(block);
}
 
開發者ID:Lemonszz,項目名稱:Anima-Mundi,代碼行數:8,代碼來源:AnimaBlocks.java


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