当前位置: 首页>>代码示例>>Java>>正文


Java Block.setRegistryName方法代码示例

本文整理汇总了Java中net.minecraft.block.Block.setRegistryName方法的典型用法代码示例。如果您正苦于以下问题:Java Block.setRegistryName方法的具体用法?Java Block.setRegistryName怎么用?Java Block.setRegistryName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.Block的用法示例。


在下文中一共展示了Block.setRegistryName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: registerBlock

import net.minecraft.block.Block; //导入方法依赖的package包/类
public static void registerBlock(String id,Block block, ItemBlock itemBlock)
{
    block.setRegistryName(Soot.MODID,id);
    block.setUnlocalizedName(id);
    registerBlock(block,true);
    registerItem(id,itemBlock);
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:8,代码来源:Registry.java

示例3: preInit

import net.minecraft.block.Block; //导入方法依赖的package包/类
public static void preInit()
{
	for(Block fluidBlock : BLOCK_MAP.keySet())
	{
		fluidBlock.setRegistryName(new ResourceLocation(HarshenCastle.MODID, BLOCK_MAP.get(fluidBlock)));
        ForgeRegistries.BLOCKS.register(fluidBlock);
	}
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:9,代码来源:HarshenFluids.java

示例4: 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

示例5: 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

示例6: registerBlock

import net.minecraft.block.Block; //导入方法依赖的package包/类
public static void registerBlock(IForgeRegistry<Block> blockRegistry, Block block, String name)
{
    if (!name.toLowerCase().equals(name))
    {
        throw new IllegalArgumentException(name + " contains non-lowercase characters. Registry names should be lowercase in preparation for 1.11");
    }
    
    block.setRegistryName(name);
    block.setUnlocalizedName(ModMain.MODID + "." + name);
    blockRegistry.register(block);
    RegisterBlocks.allBlocks.add(block);
}
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:13,代码来源:RegisterHelper.java

示例7: init

import net.minecraft.block.Block; //导入方法依赖的package包/类
public static void init() {
    blocks = new ArrayList<>();

    blockItems = new ArrayList<>();
    RandoresTab oreTab = null;
    for(OreType oreType : Randores.getDefaultOres()) {
        for(MaterialType materialType : Randores.getDefaultMaterials()) {
            RandoresOre ore = new RandoresOre(Material.ROCK, oreType, materialType);

            RandoresItemBlock oreItem = new RandoresItemBlock(ore);
            oreItem.setUnlocalizedName(RandoresKeys.ORE + "_" + materialType.getOreName() + "_" + oreType.getName());
            blockItems.add(oreItem);

            ore.setUnlocalizedName(RandoresKeys.ORE + "_" + materialType.getOreName() + "_" + oreType.getName()).setHardness(3.0F).setResistance(5.0F).setCreativeTab(oreTab == null ? (oreTab = new RandoresTab("randores_ores", ore)) : oreTab);
            blocks.add(ore);
            RandoresItemRegistry.instance().register(ore);
        }
    }

    brick = new RandoresBlock(Material.ROCK, ComponentType.craftable(CraftableTypeRegistry.instance().get(RandoresKeys.BRICKS)), SoundType.STONE);
    brick.setHarvestLevel("pickaxe", 1);

    brickItem = new RandoresItemBlock(brick);
    brickItem.setUnlocalizedName(RandoresKeys.BRICKS);
    blockItems.add(brickItem);

    brick.setUnlocalizedName(RandoresKeys.BRICKS).setHardness(2f).setResistance(10f).setCreativeTab(new RandoresTab("randores_bricks", brick));
    blocks.add(brick);


    torch = new RandoresTorch();

    torchItem = new RandoresItemBlock(torch);
    torchItem.setUnlocalizedName(RandoresKeys.TORCH);
    blockItems.add(torchItem);

    torch.setUnlocalizedName(RandoresKeys.TORCH).setHardness(0.0F).setLightLevel(0.9375F).setCreativeTab(new RandoresTab("randores_torches", torch));
    blocks.add(torch);

    for(Item item : blockItems) {
        item.setRegistryName(item.getUnlocalizedName().substring(5));
    }

    for(Block block : blocks) {
        block.setRegistryName(block.getUnlocalizedName().substring(5));
    }
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:48,代码来源:RandoresBlocks.java

示例8: init

import net.minecraft.block.Block; //导入方法依赖的package包/类
public static void init() {
    blocks = new ArrayList<>();

    craftiniumTable = new CraftiniumTable();
    craftiniumTable.setCreativeTab(Randores.TAB_CRAFTING);
    blocks.add(craftiniumTable);

    craftiniumForge = new CraftiniumForge(false);
    craftiniumForge.setCreativeTab(Randores.TAB_CRAFTING);
    blocks.add(craftiniumForge);

    craftiniumOre = new CraftiniumOre();
    craftiniumOre.setCreativeTab(Randores.TAB_CRAFTING);
    blocks.add(craftiniumOre);

    craftiniumConverter = new CraftiniumConverter();
    craftiniumConverter.setCreativeTab(Randores.TAB_CRAFTING);
    blocks.add(craftiniumConverter);

    craftiniumForgeLit = new CraftiniumForge(true);
    blocks.add(craftiniumForgeLit);


    blockItems = new ArrayList<>();

    tableItem = new ItemBlock(craftiniumTable);
    tableItem.setUnlocalizedName("craftinium_table");
    blockItems.add(tableItem);

    forgeItem = new ItemBlock(craftiniumForge);
    forgeItem.setUnlocalizedName("craftinium_forge");
    blockItems.add(forgeItem);

    forgeLitItem = new ItemBlock(craftiniumForgeLit);
    forgeLitItem.setUnlocalizedName("craftinium_forge_lit");
    blockItems.add(forgeLitItem);

    converterItem = new ItemBlock(craftiniumConverter);
    converterItem.setUnlocalizedName("craftinium_converter");
    blockItems.add(converterItem);

    oreItem = new ItemBlock(craftiniumOre);
    oreItem.setUnlocalizedName("craftinium_ore");
    blockItems.add(oreItem);

    for(Item item : blockItems) {
        item.setRegistryName(item.getUnlocalizedName().substring(5));
    }

    for(Block block : blocks) {
        block.setRegistryName(block.getUnlocalizedName().substring(5));
    }
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:54,代码来源:CraftingBlocks.java

示例9: registerBlock

import net.minecraft.block.Block; //导入方法依赖的package包/类
private static void registerBlock(final IForgeRegistry<Block> registry, final Block block, final String name) {
    block.setRegistryName(GenesisMod.MOD_ID, name);
    block.setUnlocalizedName(GenesisMod.MOD_ID + "." + name);
    registry.register(block);
    BLOCKS.add(block);
}
 
开发者ID:Boethie,项目名称:Genesis,代码行数:7,代码来源:GenesisBlocks.java

示例10: registerBlocks

import net.minecraft.block.Block; //导入方法依赖的package包/类
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {

    Block steelWoolBlock = new Block(Material.SPONGE);

    steelWoolBlock.setRegistryName("steelwoolblock");
    steelWoolBlock.setUnlocalizedName("steelwoolblock");
    steelWoolBlock.setLightLevel(1f);

    GameRegistry.register(steelWoolBlock);

}
 
开发者ID:biospace-labs,项目名称:ShoopCraft,代码行数:13,代码来源:BlockRegisterer.java


注:本文中的net.minecraft.block.Block.setRegistryName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。