YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
cpw.mods.fml.common.registry.GameRegistry Class Reference

Static Public Member Functions

static void registerWorldGenerator (IWorldGenerator generator)
 
static void generateWorld (int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
 
static Object buildBlock (ModContainer container, Class<?> type, Block annotation) throws Exception
 
static void registerItem (net.minecraft.item.Item item, String name)
 
static void registerItem (net.minecraft.item.Item item, String name, String modId)
 
static void registerBlock (net.minecraft.block.Block block)
 
static void registerBlock (net.minecraft.block.Block block, String name)
 
static void registerBlock (net.minecraft.block.Block block, Class<?extends ItemBlock > itemclass)
 
static void registerBlock (net.minecraft.block.Block block, Class<?extends ItemBlock > itemclass, String name)
 
static void registerBlock (net.minecraft.block.Block block, Class<?extends ItemBlock > itemclass, String name, String modId)
 
static void addRecipe (ItemStack output, Object...params)
 
static IRecipe addShapedRecipe (ItemStack output, Object...params)
 
static void addShapelessRecipe (ItemStack output, Object...params)
 
static void addRecipe (IRecipe recipe)
 
static void addSmelting (int input, ItemStack output, float xp)
 
static void registerTileEntity (Class<?extends TileEntity > tileEntityClass, String id)
 
static void registerTileEntityWithAlternatives (Class<?extends TileEntity > tileEntityClass, String id, String...alternatives)
 
static void addBiome (BiomeGenBase biome)
 
static void removeBiome (BiomeGenBase biome)
 
static void registerFuelHandler (IFuelHandler handler)
 
static int getFuelValue (ItemStack itemStack)
 
static void registerCraftingHandler (ICraftingHandler handler)
 
static void onItemCrafted (EntityPlayer player, ItemStack item, IInventory craftMatrix)
 
static void onItemSmelted (EntityPlayer player, ItemStack item)
 
static void registerPickupHandler (IPickupNotifier handler)
 
static void onPickupNotification (EntityPlayer player, EntityItem item)
 
static void registerPlayerTracker (IPlayerTracker tracker)
 
static void onPlayerLogin (EntityPlayer player)
 
static void onPlayerLogout (EntityPlayer player)
 
static void onPlayerChangedDimension (EntityPlayer player)
 
static void onPlayerRespawn (EntityPlayer player)
 
static net.minecraft.block.Block findBlock (String modId, String name)
 
static net.minecraft.item.Item findItem (String modId, String name)
 
static void registerCustomItemStack (String name, ItemStack itemStack)
 
static ItemStack findItemStack (String modId, String name, int stackSize)
 

Member Function Documentation

static void cpw.mods.fml.common.registry.GameRegistry.addBiome ( BiomeGenBase  biome)
static
static void cpw.mods.fml.common.registry.GameRegistry.addRecipe ( ItemStack  output,
Object...  params 
)
static
static void cpw.mods.fml.common.registry.GameRegistry.addRecipe ( IRecipe  recipe)
static
static IRecipe cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe ( ItemStack  output,
Object...  params 
)
static
static void cpw.mods.fml.common.registry.GameRegistry.addShapelessRecipe ( ItemStack  output,
Object...  params 
)
static
static void cpw.mods.fml.common.registry.GameRegistry.addSmelting ( int  input,
ItemStack  output,
float  xp 
)
static
static Object cpw.mods.fml.common.registry.GameRegistry.buildBlock ( ModContainer  container,
Class<?>  type,
Block  annotation 
) throws Exception
static

Internal method for creating an instance

Parameters
container
type
annotation
Exceptions
Exception
static net.minecraft.block.Block cpw.mods.fml.common.registry.GameRegistry.findBlock ( String  modId,
String  name 
)
static

Look up a mod block in the global "named item list"

Parameters
modIdThe modid owning the block
nameThe name of the block itself
Returns
The block or null if not found
static net.minecraft.item.Item cpw.mods.fml.common.registry.GameRegistry.findItem ( String  modId,
String  name 
)
static

Look up a mod item in the global "named item list"

Parameters
modIdThe modid owning the item
nameThe name of the item itself
Returns
The item or null if not found
static ItemStack cpw.mods.fml.common.registry.GameRegistry.findItemStack ( String  modId,
String  name,
int  stackSize 
)
static

Lookup an itemstack based on mod and name. It will create "default" itemstacks from blocks and items if no explicit itemstack is found.

If it is built from a block, the metadata is by default the "wildcard" value.

Custom itemstacks can be dumped from minecraft by setting the system property fml.dumpRegistry to true (-Dfml.dumpRegistry=true on the command line will work)

Parameters
modIdThe modid of the stack owner
nameThe name of the stack
stackSizeThe size of the stack returned
Returns
The custom itemstack or null if no such itemstack was found
static void cpw.mods.fml.common.registry.GameRegistry.generateWorld ( int  chunkX,
int  chunkZ,
World  world,
IChunkProvider  chunkGenerator,
IChunkProvider  chunkProvider 
)
static

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
static int cpw.mods.fml.common.registry.GameRegistry.getFuelValue ( ItemStack  itemStack)
static
static void cpw.mods.fml.common.registry.GameRegistry.onItemCrafted ( EntityPlayer  player,
ItemStack  item,
IInventory  craftMatrix 
)
static
static void cpw.mods.fml.common.registry.GameRegistry.onItemSmelted ( EntityPlayer  player,
ItemStack  item 
)
static
static void cpw.mods.fml.common.registry.GameRegistry.onPickupNotification ( EntityPlayer  player,
EntityItem  item 
)
static
static void cpw.mods.fml.common.registry.GameRegistry.onPlayerChangedDimension ( EntityPlayer  player)
static
static void cpw.mods.fml.common.registry.GameRegistry.onPlayerLogin ( EntityPlayer  player)
static
static void cpw.mods.fml.common.registry.GameRegistry.onPlayerLogout ( EntityPlayer  player)
static
static void cpw.mods.fml.common.registry.GameRegistry.onPlayerRespawn ( EntityPlayer  player)
static
static void cpw.mods.fml.common.registry.GameRegistry.registerBlock ( net.minecraft.block.Block  block)
static

Register a block with the world

static void cpw.mods.fml.common.registry.GameRegistry.registerBlock ( net.minecraft.block.Block  block,
String  name 
)
static

Register a block with the specified mod specific name : overrides the standard type based name

Parameters
blockThe block to register
nameThe mod-unique name to register it as
static void cpw.mods.fml.common.registry.GameRegistry.registerBlock ( net.minecraft.block.Block  block,
Class<?extends ItemBlock itemclass 
)
static

Register a block with the world, with the specified item class

Deprecated in favour of named versions

Parameters
blockThe block to register
itemclassThe item type to register with it
static void cpw.mods.fml.common.registry.GameRegistry.registerBlock ( net.minecraft.block.Block  block,
Class<?extends ItemBlock itemclass,
String  name 
)
static

Register a block with the world, with the specified item class and block name

Parameters
blockThe block to register
itemclassThe item type to register with it
nameThe mod-unique name to register it with
static void cpw.mods.fml.common.registry.GameRegistry.registerBlock ( net.minecraft.block.Block  block,
Class<?extends ItemBlock itemclass,
String  name,
String  modId 
)
static

Register a block with the world, with the specified item class, block name and owning modId

Parameters
blockThe block to register
itemclassThe iterm type to register with it
nameThe mod-unique name to register it with
modIdThe modId that will own the block name. null defaults to the active modId
static void cpw.mods.fml.common.registry.GameRegistry.registerCraftingHandler ( ICraftingHandler  handler)
static
static void cpw.mods.fml.common.registry.GameRegistry.registerCustomItemStack ( String  name,
ItemStack  itemStack 
)
static

Manually register a custom item stack with FML for later tracking. It is automatically scoped with the active modid

Parameters
nameThe name to register it under
itemStackThe itemstack to register
static void cpw.mods.fml.common.registry.GameRegistry.registerFuelHandler ( IFuelHandler  handler)
static
static void cpw.mods.fml.common.registry.GameRegistry.registerItem ( net.minecraft.item.Item  item,
String  name 
)
static

Register an item with the item registry with a custom name : this allows for easier server->client resolution

Parameters
itemThe item to register
nameThe mod-unique name of the item
static void cpw.mods.fml.common.registry.GameRegistry.registerItem ( net.minecraft.item.Item  item,
String  name,
String  modId 
)
static

Register the specified Item with a mod specific name : overrides the standard type based name

Parameters
itemThe item to register
nameThe mod-unique name to register it as - null will remove a custom name
modIdAn 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
static void cpw.mods.fml.common.registry.GameRegistry.registerPickupHandler ( IPickupNotifier  handler)
static
static void cpw.mods.fml.common.registry.GameRegistry.registerPlayerTracker ( IPlayerTracker  tracker)
static
static void cpw.mods.fml.common.registry.GameRegistry.registerTileEntity ( Class<?extends TileEntity tileEntityClass,
String  id 
)
static
static void cpw.mods.fml.common.registry.GameRegistry.registerTileEntityWithAlternatives ( Class<?extends TileEntity tileEntityClass,
String  id,
String...  alternatives 
)
static

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
tileEntityClassThe tileEntity class to register
idThe primary ID, this will be the ID that the tileentity saves as
alternativesA list of alternative IDs that will also map to this class. These will never save, but they will load
static void cpw.mods.fml.common.registry.GameRegistry.registerWorldGenerator ( IWorldGenerator  generator)
static

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

Parameters
generator
static void cpw.mods.fml.common.registry.GameRegistry.removeBiome ( BiomeGenBase  biome)
static

The documentation for this class was generated from the following file: