Inside ItemBlocks
private static Map<Block, ItemBlock> itemBlocks = new HashMap<Block, ItemBlock>();
public static ItemBlock add(Block block)
{
ItemBlock ib;
itemBlocks.putIfAbsent(block, ib = new ItemBlock(block));
return ib;
}
public static ItemBlock get(Block block)
{
return itemBlocks.get(block);
}
Call to "add"
public static final Block test = new Block(Material.CACTUS, MapColor.EMERALD)
.setCreativeTab(CreativeTabs.DECORATIONS);
public static void registerAllBlocks()
{
register(test, "test");
}
private static Block register(Block newBlock, String name)
{
newBlock.setRegistryName(CameraCore.MODID, name);
newBlock.setUnlocalizedName(name);
GameRegistry.register(newBlock);
ItemBlock ib = ItemBlocks.add(newBlock);
ib.setRegistryName(name);
GameRegistry.register(ib);
return newBlock;
}
And, registerAllBlocks is called in the common proxy preInit, and is guaranteed to be before the renderer is registered.
EDIT: Ok, well this shows that too.