cpw.mods.fml.common.registry

## Class GameRegistry

- java.lang.Object
- - cpw.mods.fml.common.registry.GameRegistry

-     public class GameRegistry
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GameRegistry()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addBiome(BiomeGenBase biome)`
    `static void` | `addRecipe(IRecipe recipe)`
    `static void` | `addRecipe(ItemStack output, Object... params)`
    `static IRecipe` | `addShapedRecipe(ItemStack output, Object... params)`
    `static void` | `addShapelessRecipe(ItemStack output, Object... params)`
    `static void` | `addSmelting(int input, ItemStack output, float xp)`
    `static Object` | `buildBlock(ModContainer container, Class<?> type, Mod.Block annotation)` Internal method for creating an @Block instance
    `static Block` | `findBlock(String modId, String name)` Look up a mod block in the global "named item list"
    `static Item` | `findItem(String modId, String name)` Look up a mod item in the global "named item list"
    `static void` | `generateWorld(int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)` Callback hook for world gen - if your mod wishes to add extra mod related generation to the world call this
    `static int` | `getFuelValue(ItemStack itemStack)`
    `static void` | `onItemCrafted(EntityPlayer player, ItemStack item, IInventory craftMatrix)`
    `static void` | `onItemSmelted(EntityPlayer player, ItemStack item)`
    `static void` | `onPickupNotification(EntityPlayer player, EntityItem item)`
    `static void` | `onPlayerChangedDimension(EntityPlayer player)`
    `static void` | `onPlayerLogin(EntityPlayer player)`
    `static void` | `onPlayerLogout(EntityPlayer player)`
    `static void` | `onPlayerRespawn(EntityPlayer player)`
    `static void` | `registerBlock(Block block)` Deprecated.
    `static void` | `registerBlock(Block block, Class<? extends ItemBlock> itemclass)` Deprecated.
    `static void` | `registerBlock(Block block, Class<? extends ItemBlock> itemclass, String name)` Register a block with the world, with the specified item class and block name
    `static void` | `registerBlock(Block block, Class<? extends ItemBlock> itemclass, String name, String modId)` Register a block with the world, with the specified item class, block name and owning modId
    `static void` | `registerBlock(Block block, String name)` Register a block with the specified mod specific name : overrides the standard type based name
    `static void` | `registerCraftingHandler(ICraftingHandler handler)`
    `static void` | `registerFuelHandler(IFuelHandler handler)`
    `static void` | `registerItem(Item item, String name)` Register an item with the item registry with a custom name : this allows for easier server->client resolution
    `static void` | `registerItem(Item item, String name, String modId)` Register the specified Item with a mod specific name : overrides the standard type based name
    `static void` | `registerPickupHandler(IPickupNotifier handler)`
    `static void` | `registerPlayerTracker(IPlayerTracker tracker)`
    `static void` | `registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id)`
    `static void` | `registerTileEntityWithAlternatives(Class<? extends TileEntity> tileEntityClass, String id, String... alternatives)` Register a tile entity, with alternative TileEntity identifiers.
    `static void` | `registerWorldGenerator(IWorldGenerator generator)` Register a world generator - something that inserts new block types into the world
    `static void` | `removeBiome(BiomeGenBase biome)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GameRegistry

          public GameRegistry()

  - ### Method Detail

    - #### registerWorldGenerator

          public static void registerWorldGenerator(IWorldGenerator generator)

      Register a world generator - something that inserts new block types into the world
      Parameters:
        `generator` -

    - #### generateWorld

          public static void generateWorld(int chunkX,
                           int chunkZ,
                           World world,
                           IChunkProvider chunkGenerator,
                           IChunkProvider chunkProvider)

      Callback hook for world gen - if your mod wishes to add extra mod related generation to the world call this
      Parameters:
        `chunkX` -
        `chunkZ` -
        `world` -
        `chunkGenerator` -
        `chunkProvider` -

    - #### buildBlock

          public static Object buildBlock(ModContainer container,
                          Class<?> type,
                          Mod.Block annotation)
                                   throws Exception

      Internal method for creating an @Block instance
      Parameters:
        `container` -
        `type` -
        `annotation` -
      Throws:
        `Exception`

    - #### registerItem

          public static void registerItem(Item item,
                          String name)

      Register an item with the item registry with a custom name : this allows for easier server->client resolution
      Parameters:
        `item` - The item to register
        `name` - The mod-unique name of the item

    - #### registerItem

          public static void registerItem(Item item,
                          String name,
                          String modId)

      Register the specified Item with a mod specific name : overrides the standard type based name
      Parameters:
        `item` - The item to register
        `name` - The mod-unique name to register it as - null will remove a custom name
        `modId` - An optional modId that will "own" this block - generally used by multi-mod systems where one mod should "own" all the blocks of all the mods, null defaults to the active mod

    - #### registerBlock

          @Deprecated
          public static void registerBlock(Block block)

      Deprecated.
      Register a block with the world

    - #### registerBlock

          public static void registerBlock(Block block,
                           String name)

      Register a block with the specified mod specific name : overrides the standard type based name
      Parameters:
        `block` - The block to register
        `name` - The mod-unique name to register it as

    - #### registerBlock

          @Deprecated
          public static void registerBlock(Block block,
                                      Class<? extends ItemBlock> itemclass)

      Deprecated.
      Register a block with the world, with the specified item class Deprecated in favour of named versions
      Parameters:
        `block` - The block to register
        `itemclass` - The item type to register with it

    - #### registerBlock

          public static void registerBlock(Block block,
                           Class<? extends ItemBlock> itemclass,
                           String name)

      Register a block with the world, with the specified item class and block name
      Parameters:
        `block` - The block to register
        `itemclass` - The item type to register with it
        `name` - The mod-unique name to register it with

    - #### registerBlock

          public static void registerBlock(Block block,
                           Class<? extends ItemBlock> itemclass,
                           String name,
                           String modId)

      Register a block with the world, with the specified item class, block name and owning modId
      Parameters:
        `block` - The block to register
        `itemclass` - The iterm type to register with it
        `name` - The mod-unique name to register it with
        `modId` - The modId that will own the block name. null defaults to the active modId

    - #### addRecipe

          public static void addRecipe(ItemStack output,
                       Object... params)

    - #### addShapedRecipe

          public static IRecipe addShapedRecipe(ItemStack output,
                                Object... params)

    - #### addShapelessRecipe

          public static void addShapelessRecipe(ItemStack output,
                                Object... params)

    - #### addRecipe

          public static void addRecipe(IRecipe recipe)

    - #### addSmelting

          public static void addSmelting(int input,
                         ItemStack output,
                         float xp)

    - #### registerTileEntity

          public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass,
                                String id)

    - #### registerTileEntityWithAlternatives

          public static void registerTileEntityWithAlternatives(Class<? extends TileEntity> tileEntityClass,
                                                String id,
                                                String... alternatives)

      Register a tile entity, with alternative TileEntity identifiers. Use with caution! This method allows for you to "rename" the 'id' of the tile entity.
      Parameters:
        `tileEntityClass` - The tileEntity class to register
        `id` - The primary ID, this will be the ID that the tileentity saves as
        `alternatives` - A list of alternative IDs that will also map to this class. These will never save, but they will load

    - #### addBiome

          public static void addBiome(BiomeGenBase biome)

    - #### removeBiome

          public static void removeBiome(BiomeGenBase biome)

    - #### registerFuelHandler

          public static void registerFuelHandler(IFuelHandler handler)

    - #### getFuelValue

          public static int getFuelValue(ItemStack itemStack)

    - #### registerCraftingHandler

          public static void registerCraftingHandler(ICraftingHandler handler)

    - #### onItemCrafted

          public static void onItemCrafted(EntityPlayer player,
                           ItemStack item,
                           IInventory craftMatrix)

    - #### onItemSmelted

          public static void onItemSmelted(EntityPlayer player,
                           ItemStack item)

    - #### registerPickupHandler

          public static void registerPickupHandler(IPickupNotifier handler)

    - #### onPickupNotification

          public static void onPickupNotification(EntityPlayer player,
                                  EntityItem item)

    - #### registerPlayerTracker

          public static void registerPlayerTracker(IPlayerTracker tracker)

    - #### onPlayerLogin

          public static void onPlayerLogin(EntityPlayer player)

    - #### onPlayerLogout

          public static void onPlayerLogout(EntityPlayer player)

    - #### onPlayerChangedDimension

          public static void onPlayerChangedDimension(EntityPlayer player)

    - #### onPlayerRespawn

          public static void onPlayerRespawn(EntityPlayer player)

    - #### findBlock

          public static Block findBlock(String modId,
                        String name)

      Look up a mod block in the global "named item list"
      Parameters:
        `modId` - The modid owning the block
        `name` - The name of the block itself
      Returns:
        The block or null if not found

    - #### findItem

          public static Item findItem(String modId,
                      String name)

      Look up a mod item in the global "named item list"
      Parameters:
        `modId` - The modid owning the item
        `name` - The name of the item itself
      Returns:
        The item or null if not found