public class GameRegistry extends Object
Constructor and Description |
---|
GameRegistry() |
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 ItemStack |
findItemStack(String modId,
String name,
int stackSize)
Lookup an itemstack based on mod and name.
|
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 |
registerCustomItemStack(String name,
ItemStack itemStack)
Manually register a custom item stack with FML for later tracking.
|
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) |
public static void registerWorldGenerator(IWorldGenerator generator)
generator
- public static void generateWorld(int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
chunkX
- chunkZ
- world
- chunkGenerator
- chunkProvider
- public static Object buildBlock(ModContainer container, Class<?> type, Mod.Block annotation) throws Exception
container
- type
- annotation
- Exception
public static void registerItem(Item item, String name)
item
- The item to registername
- The mod-unique name of the itempublic static void registerItem(Item item, String name, String modId)
item
- The item to registername
- The mod-unique name to register it as - null will remove a custom namemodId
- 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@Deprecated public static void registerBlock(Block block)
public static void registerBlock(Block block, String name)
block
- The block to registername
- The mod-unique name to register it as@Deprecated public static void registerBlock(Block block, Class<? extends ItemBlock> itemclass)
block
- The block to registeritemclass
- The item type to register with itpublic static void registerBlock(Block block, Class<? extends ItemBlock> itemclass, String name)
block
- The block to registeritemclass
- The item type to register with itname
- The mod-unique name to register it withpublic static void registerBlock(Block block, Class<? extends ItemBlock> itemclass, String name, String modId)
block
- The block to registeritemclass
- The iterm type to register with itname
- The mod-unique name to register it withmodId
- The modId that will own the block name. null defaults to the active modIdpublic static void addRecipe(IRecipe recipe)
public static void addSmelting(int input, ItemStack output, float xp)
public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id)
public static void registerTileEntityWithAlternatives(Class<? extends TileEntity> tileEntityClass, String id, String... alternatives)
tileEntityClass
- The tileEntity class to registerid
- The primary ID, this will be the ID that the tileentity saves asalternatives
- A list of alternative IDs that will also map to this class. These will never save, but they will loadpublic static void addBiome(BiomeGenBase biome)
public static void removeBiome(BiomeGenBase biome)
public static void registerFuelHandler(IFuelHandler handler)
public static int getFuelValue(ItemStack itemStack)
public static void registerCraftingHandler(ICraftingHandler handler)
public static void onItemCrafted(EntityPlayer player, ItemStack item, IInventory craftMatrix)
public static void onItemSmelted(EntityPlayer player, ItemStack item)
public static void registerPickupHandler(IPickupNotifier handler)
public static void onPickupNotification(EntityPlayer player, EntityItem item)
public static void registerPlayerTracker(IPlayerTracker tracker)
public static void onPlayerLogin(EntityPlayer player)
public static void onPlayerLogout(EntityPlayer player)
public static void onPlayerChangedDimension(EntityPlayer player)
public static void onPlayerRespawn(EntityPlayer player)
public static Block findBlock(String modId, String name)
modId
- The modid owning the blockname
- The name of the block itselfpublic static Item findItem(String modId, String name)
modId
- The modid owning the itemname
- The name of the item itselfpublic static void registerCustomItemStack(String name, ItemStack itemStack)
name
- The name to register it underitemStack
- The itemstack to registerpublic static ItemStack findItemStack(String modId, String name, int stackSize)
modId
- The modid of the stack ownername
- The name of the stackstackSize
- The size of the stack returned