net.minecraftforge.common
Class MinecraftForge

java.lang.Object
  extended by net.minecraftforge.common.MinecraftForge

public class MinecraftForge
extends Object


Field Summary
static EventBus EVENT_BUS
          The core Forge EventBusses, all events for Forge will be fired on these, you should use this to register all your listeners.
static EventBus ORE_GEN_BUS
           
static boolean SPAWNER_ALLOW_ON_INVERTED
          Deprecated. 
static EventBus TERRAIN_GEN_BUS
           
 
Constructor Summary
MinecraftForge()
           
 
Method Summary
static void addGrassPlant(Block block, int metadata, int weight)
          Register a new plant to be planted when bonemeal is used on grass.
static void addGrassSeed(ItemStack seed, int weight)
          Register a new seed to be dropped when breaking tall grass.
static int getBlockHarvestLevel(Block block, int metadata, String toolClass)
          Returns the block harvest level for a particular tool class.
static String getBrandingVersion()
           
static void initialize()
          Method invoked by FML before any other mods are loaded.
static void removeBlockEffectiveness(Block block, int metadata, String toolClass)
          Remove a block effectiveness mapping.
static void removeBlockEffectiveness(Block block, String toolClass)
          Remove a block effectiveness mapping.
static void setBlockHarvestLevel(Block block, int metadata, String toolClass, int harvestLevel)
          Register a block to be harvested by a tool class.
static void setBlockHarvestLevel(Block block, String toolClass, int harvestLevel)
          Register a block to be harvested by a tool class.
static void setToolClass(Item tool, String toolClass, int harvestLevel)
          Register a tool as a tool class with a given harvest level.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_BUS

public static final EventBus EVENT_BUS
The core Forge EventBusses, all events for Forge will be fired on these, you should use this to register all your listeners. This replaces every register*Handler() function in the old version of Forge. TERRAIN_GEN_BUS for terrain gen events ORE_GEN_BUS for ore gen events EVENT_BUS for everything else


TERRAIN_GEN_BUS

public static final EventBus TERRAIN_GEN_BUS

ORE_GEN_BUS

public static final EventBus ORE_GEN_BUS

SPAWNER_ALLOW_ON_INVERTED

@Deprecated
public static boolean SPAWNER_ALLOW_ON_INVERTED
Deprecated. 
Constructor Detail

MinecraftForge

public MinecraftForge()
Method Detail

addGrassPlant

public static void addGrassPlant(Block block,
                                 int metadata,
                                 int weight)
Register a new plant to be planted when bonemeal is used on grass.

Parameters:
block - The block to place.
metadata - The metadata to set for the block when being placed.
weight - The weight of the plant, where red flowers are 10 and yellow flowers are 20.

addGrassSeed

public static void addGrassSeed(ItemStack seed,
                                int weight)
Register a new seed to be dropped when breaking tall grass.

Parameters:
seed - The item to drop as a seed.
weight - The relative probability of the seeds, where wheat seeds are 10.

setToolClass

public static void setToolClass(Item tool,
                                String toolClass,
                                int harvestLevel)
Register a tool as a tool class with a given harvest level.

Parameters:
tool - The custom tool to register.
toolClass - The tool class to register as. The predefined tool clases are "pickaxe", "shovel", "axe". You can add others for custom tools.
harvestLevel - The harvest level of the tool.

setBlockHarvestLevel

public static void setBlockHarvestLevel(Block block,
                                        int metadata,
                                        String toolClass,
                                        int harvestLevel)
Register a block to be harvested by a tool class. This is the metadata sensitive version, use it if your blocks are using metadata variants. By default, this sets the block class as effective against that type.

Parameters:
block - The block to register.
metadata - The metadata for the block subtype.
toolClass - The tool class to register as able to remove this block. You may register the same block multiple times with different tool classes, if multiple tool types can be used to harvest this block.
harvestLevel - The minimum tool harvest level required to successfully harvest the block.
See Also:
for details on tool classes.

removeBlockEffectiveness

public static void removeBlockEffectiveness(Block block,
                                            int metadata,
                                            String toolClass)
Remove a block effectiveness mapping. Since setBlockHarvestLevel makes the tool class effective against the block by default, this can be used to remove that mapping. This will force a block to be harvested at the same speed regardless of tool quality, while still requiring a given harvesting level.

Parameters:
block - The block to remove effectiveness from.
metadata - The metadata for the block subtype.
toolClass - The tool class to remove the effectiveness mapping from.
See Also:
for details on tool classes.

setBlockHarvestLevel

public static void setBlockHarvestLevel(Block block,
                                        String toolClass,
                                        int harvestLevel)
Register a block to be harvested by a tool class. By default, this sets the block class as effective against that type.

Parameters:
block - The block to register.
toolClass - The tool class to register as able to remove this block. You may register the same block multiple times with different tool classes, if multiple tool types can be used to harvest this block.
harvestLevel - The minimum tool harvest level required to successfully harvest the block.
See Also:
for details on tool classes.

getBlockHarvestLevel

public static int getBlockHarvestLevel(Block block,
                                       int metadata,
                                       String toolClass)
Returns the block harvest level for a particular tool class.

Parameters:
block - The block to check.
metadata - The metadata for the block subtype.
toolClass - The tool class to check as able to remove this block.
Returns:
The harvest level or -1 if no mapping exists.
See Also:
for details on tool classes.

removeBlockEffectiveness

public static void removeBlockEffectiveness(Block block,
                                            String toolClass)
Remove a block effectiveness mapping. Since setBlockHarvestLevel makes the tool class effective against the block by default, this can be used to remove that mapping. This will force a block to be harvested at the same speed regardless of tool quality, while still requiring a given harvesting level.

Parameters:
block - The block to remove effectiveness from.
toolClass - The tool class to remove the effectiveness mapping from.
See Also:
for details on tool classes.

initialize

public static void initialize()
Method invoked by FML before any other mods are loaded.


getBrandingVersion

public static String getBrandingVersion()