Skip to content

Instantly share code, notes, and snippets.

@ZornTaov
Created January 18, 2014 06:35
Show Gist options
  • Save ZornTaov/8487043 to your computer and use it in GitHub Desktop.
Save ZornTaov/8487043 to your computer and use it in GitHub Desktop.
@EventHandler
public void init(FMLPreInitializationEvent event)
{
registerBlock(new BlockExample().func_149663_c("ExampleBlock").func_149647_a(CreativeTabs.tabBlock));
registerItem(new Item().setUnlocalizedName("ExampleItem").setCreativeTab(CreativeTabs.tabMisc));
}
public static void registerItem(Item item)
{
GameRegistry.registerItem(item, item.getUnlocalizedName().replace("item.", ""));
//register name, this apperently does not work 3:
//LanguageRegistry.instance().addStringLocalization(item.getUnlocalizedName() + ".name", "en_US", item.getUnlocalizedName().replace("item.", ""));
}
public static void registerBlock(Block block)
{
//TODO: getUnlocalizedName()
GameRegistry.registerBlock(block, block.func_149739_a().replace("tile.", ""));
//register name, this apperently does not work 3:
//LanguageRegistry.instance().addStringLocalization(block.func_149739_a() + ".name", "en_US", block.func_149739_a().replace("tile.", ""));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment