YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
net.minecraftforge.common.MinecraftForge Class Reference

Static Public Member Functions

static void addGrassPlant (Block block, int metadata, int weight)
 
static void addGrassSeed (ItemStack seed, int weight)
 
static void setToolClass (Item tool, String toolClass, int harvestLevel)
 
static void setBlockHarvestLevel (Block block, int metadata, String toolClass, int harvestLevel)
 
static void removeBlockEffectiveness (Block block, int metadata, String toolClass)
 
static void setBlockHarvestLevel (Block block, String toolClass, int harvestLevel)
 
static int getBlockHarvestLevel (Block block, int metadata, String toolClass)
 
static void removeBlockEffectiveness (Block block, String toolClass)
 
static void initialize ()
 
static String getBrandingVersion ()
 

Static Public Attributes

static final EventBus EVENT_BUS = new EventBus()
 
static final EventBus TERRAIN_GEN_BUS = new EventBus()
 
static final EventBus ORE_GEN_BUS = new EventBus()
 

Member Function Documentation

static void net.minecraftforge.common.MinecraftForge.addGrassPlant ( Block  block,
int  metadata,
int  weight 
)
static

Register a new plant to be planted when bonemeal is used on grass.

Parameters
blockThe block to place.
metadataThe metadata to set for the block when being placed.
weightThe weight of the plant, where red flowers are 10 and yellow flowers are 20.
static void net.minecraftforge.common.MinecraftForge.addGrassSeed ( ItemStack  seed,
int  weight 
)
static

Register a new seed to be dropped when breaking tall grass.

Parameters
seedThe item to drop as a seed.
weightThe relative probability of the seeds, where wheat seeds are 10.
static int net.minecraftforge.common.MinecraftForge.getBlockHarvestLevel ( Block  block,
int  metadata,
String  toolClass 
)
static

Returns the block harvest level for a particular tool class.

Parameters
blockThe block to check.
metadataThe metadata for the block subtype.
toolClassThe tool class to check as able to remove this block.
See Also
MinecraftForge::setToolClass for details on tool classes.
Returns
The harvest level or -1 if no mapping exists.
static String net.minecraftforge.common.MinecraftForge.getBrandingVersion ( )
static
static void net.minecraftforge.common.MinecraftForge.initialize ( )
static

Method invoked by FML before any other mods are loaded.

static void net.minecraftforge.common.MinecraftForge.removeBlockEffectiveness ( Block  block,
int  metadata,
String  toolClass 
)
static

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
blockThe block to remove effectiveness from.
metadataThe metadata for the block subtype.
toolClassThe tool class to remove the effectiveness mapping from.
See Also
MinecraftForge::setToolClass for details on tool classes.
static void net.minecraftforge.common.MinecraftForge.removeBlockEffectiveness ( Block  block,
String  toolClass 
)
static

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
blockThe block to remove effectiveness from.
toolClassThe tool class to remove the effectiveness mapping from.
See Also
MinecraftForge::setToolClass for details on tool classes.
static void net.minecraftforge.common.MinecraftForge.setBlockHarvestLevel ( Block  block,
int  metadata,
String  toolClass,
int  harvestLevel 
)
static

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
blockThe block to register.
metadataThe metadata for the block subtype.
toolClassThe 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.
harvestLevelThe minimum tool harvest level required to successfully harvest the block.
See Also
MinecraftForge::setToolClass for details on tool classes.
static void net.minecraftforge.common.MinecraftForge.setBlockHarvestLevel ( Block  block,
String  toolClass,
int  harvestLevel 
)
static

Register a block to be harvested by a tool class. By default, this sets the block class as effective against that type.

Parameters
blockThe block to register.
toolClassThe 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.
harvestLevelThe minimum tool harvest level required to successfully harvest the block.
See Also
MinecraftForge::setToolClass for details on tool classes.
static void net.minecraftforge.common.MinecraftForge.setToolClass ( Item  tool,
String  toolClass,
int  harvestLevel 
)
static

Register a tool as a tool class with a given harvest level.

Parameters
toolThe custom tool to register.
toolClassThe tool class to register as. The predefined tool clases are "pickaxe", "shovel", "axe". You can add others for custom tools.
harvestLevelThe harvest level of the tool.

Member Data Documentation

final EventBus net.minecraftforge.common.MinecraftForge.EVENT_BUS = new EventBus()
static

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

final EventBus net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS = new EventBus()
static
final EventBus net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS = new EventBus()
static

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