cpw.mods.fml.common.registry
Class GameRegistry

java.lang.Object
  extended by cpw.mods.fml.common.registry.GameRegistry

public class GameRegistry
extends Object


Constructor Summary
GameRegistry()
           
 
Method Summary
static void addBiome(BiomeGenBase biome)
           
static void addRecipe(IRecipe recipe)
           
static void addRecipe(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 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 registerDispenserHandler(IDispenseHandler handler)
          Deprecated. 
static void registerDispenserHandler(IDispenserHandler handler)
          Deprecated. 
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 registerWorldGenerator(IWorldGenerator generator)
          Register a world generator - something that inserts new block types into the world
static void removeBiome(BiomeGenBase biome)
           
static int tryDispense(World world, int x, int y, int z, int xVelocity, int zVelocity, ItemStack item, Random random, double entX, double entY, double entZ)
          Deprecated. 
 
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 -

registerDispenserHandler

@Deprecated
public static void registerDispenserHandler(IDispenserHandler handler)
Deprecated. 

Deprecated without replacement. Use vanilla DispenserRegistry code

Parameters:
handler -

registerDispenserHandler

@Deprecated
public static void registerDispenserHandler(IDispenseHandler handler)
Deprecated. 

Deprecated without replacement. Use vanilla DispenserRegistry code

Parameters:
handler -

tryDispense

@Deprecated
public static int tryDispense(World world,
                                         int x,
                                         int y,
                                         int z,
                                         int xVelocity,
                                         int zVelocity,
                                         ItemStack item,
                                         Random random,
                                         double entX,
                                         double entY,
                                         double entZ)
Deprecated. 

Deprecated without replacement, use vanilla DispenserRegistry code

Parameters:
world -
x -
y -
z -
xVelocity -
zVelocity -
item -

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)

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)

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)