本文整理汇总了Java中net.minecraft.block.Block.setUnlocalizedName方法的典型用法代码示例。如果您正苦于以下问题:Java Block.setUnlocalizedName方法的具体用法?Java Block.setUnlocalizedName怎么用?Java Block.setUnlocalizedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.block.Block
的用法示例。
在下文中一共展示了Block.setUnlocalizedName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
}
示例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);
}
示例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());
}
示例4: register
import net.minecraft.block.Block; //导入方法依赖的package包/类
public static void register(FMLPreInitializationEvent e, List<?> list) {
Iterator<?> iterator = list.iterator();
while (iterator.hasNext()) {
Object k = iterator.next();
if (k instanceof Block) {
Block block = (Block) k;
ForgeRegistries.BLOCKS.register(block);
BlockRegistry.registry.put(block.getRegistryName().getResourcePath(), block);
if (!(k instanceof BlockSpecialFire) && !(k instanceof BlockWoodDoor)) {
((Block) k).setCreativeTab(GotWood.TREE_TAB);
}
block.setUnlocalizedName(GotWood.ID + "." + block.getRegistryName().getResourcePath());
if (!(k instanceof BlockDoubleSlab) && !ForgeRegistries.ITEMS.containsKey(block.getRegistryName())) {
ForgeRegistries.ITEMS.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
}
} else if (k instanceof Item) {
Item item = (Item) k;
ForgeRegistries.ITEMS.register((Item) k);
ItemRegistry.registry.put(item.getRegistryName().getResourcePath(), item);
((Item) k).setCreativeTab(GotWood.TREE_TAB);
((Item) k).setUnlocalizedName(GotWood.ID + "." + ((Item) k).getRegistryName().getResourcePath());
}
}
if (e.getSide() == Side.CLIENT) {
registerModels(list);
}
}
示例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);
}
示例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);
}
示例7: 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);
}
示例8: registerBlock
import net.minecraft.block.Block; //导入方法依赖的package包/类
public void registerBlock(Block block) {
block.setUnlocalizedName(block.getRegistryName().getResourcePath());
GameRegistry.register(block);
GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
}
示例9: 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);
}