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

Public Member Functions

 ChestGenHooks (String category)
 
 ChestGenHooks (String category, WeightedRandomChestContent[] items, int min, int max)
 
void addItem (WeightedRandomChestContent item)
 
void removeItem (ItemStack item)
 
WeightedRandomChestContent[] getItems (Random rnd)
 
int getCount (Random rand)
 
ItemStack getOneItem (Random rand)
 
int getMin ()
 
int getMax ()
 
void setMin (int value)
 
void setMax (int value)
 

Static Public Member Functions

static ChestGenHooks getInfo (String category)
 
static ItemStack[] generateStacks (Random rand, ItemStack source, int min, int max)
 
static WeightedRandomChestContent[] getItems (String category, Random rnd)
 
static int getCount (String category, Random rand)
 
static void addItem (String category, WeightedRandomChestContent item)
 
static void removeItem (String category, ItemStack item)
 
static ItemStack getOneItem (String category, Random rand)
 

Static Public Attributes

static final String MINESHAFT_CORRIDOR = "mineshaftCorridor"
 
static final String PYRAMID_DESERT_CHEST = "pyramidDesertyChest"
 
static final String PYRAMID_JUNGLE_CHEST = "pyramidJungleChest"
 
static final String PYRAMID_JUNGLE_DISPENSER = "pyramidJungleDispenser"
 
static final String STRONGHOLD_CORRIDOR = "strongholdCorridor"
 
static final String STRONGHOLD_LIBRARY = "strongholdLibrary"
 
static final String STRONGHOLD_CROSSING = "strongholdCrossing"
 
static final String VILLAGE_BLACKSMITH = "villageBlacksmith"
 
static final String BONUS_CHEST = "bonusChest"
 
static final String DUNGEON_CHEST = "dungeonChest"
 

Constructor & Destructor Documentation

net.minecraftforge.common.ChestGenHooks.ChestGenHooks ( String  category)
net.minecraftforge.common.ChestGenHooks.ChestGenHooks ( String  category,
WeightedRandomChestContent[]  items,
int  min,
int  max 
)

Member Function Documentation

static void net.minecraftforge.common.ChestGenHooks.addItem ( String  category,
WeightedRandomChestContent  item 
)
static
void net.minecraftforge.common.ChestGenHooks.addItem ( WeightedRandomChestContent  item)

Adds a new entry into the possible items to generate.

Parameters
itemThe item to add.
static ItemStack [] net.minecraftforge.common.ChestGenHooks.generateStacks ( Random  rand,
ItemStack  source,
int  min,
int  max 
)
static

Generates an array of items based on the input min/max count. If the stack can not hold the total amount, it will be split into stacks of size 1.

Parameters
randA random number generator
sourceSource item stack
minMinimum number of items
maxMaximum number of items
Returns
An array containing the generated item stacks
static int net.minecraftforge.common.ChestGenHooks.getCount ( String  category,
Random  rand 
)
static
int net.minecraftforge.common.ChestGenHooks.getCount ( Random  rand)

Gets a random number between countMin and countMax.

Parameters
randA RNG
Returns
A random number where countMin <= num <= countMax
static ChestGenHooks net.minecraftforge.common.ChestGenHooks.getInfo ( String  category)
static

Retrieves, or creates the info class for the specified category.

Parameters
categoryThe category name
Returns
A instance of ChestGenHooks for the specified category.
static WeightedRandomChestContent [] net.minecraftforge.common.ChestGenHooks.getItems ( String  category,
Random  rnd 
)
static
WeightedRandomChestContent [] net.minecraftforge.common.ChestGenHooks.getItems ( Random  rnd)

Gets an array of all random objects that are associated with this category.

Returns
The random objects
int net.minecraftforge.common.ChestGenHooks.getMax ( )
int net.minecraftforge.common.ChestGenHooks.getMin ( )
static ItemStack net.minecraftforge.common.ChestGenHooks.getOneItem ( String  category,
Random  rand 
)
static
ItemStack net.minecraftforge.common.ChestGenHooks.getOneItem ( Random  rand)

Returns a single ItemStack from the possible items in this registry, Useful if you just want a quick and dirty random Item.

Parameters
randA Random Number gen
Returns
A single ItemStack, or null if it could not get one.
static void net.minecraftforge.common.ChestGenHooks.removeItem ( String  category,
ItemStack  item 
)
static
void net.minecraftforge.common.ChestGenHooks.removeItem ( ItemStack  item)

Removes all items that match the input item stack, Only metadata and item ID are checked. If the input item has a metadata of -1, all metadatas will match.

Parameters
itemThe item to check
void net.minecraftforge.common.ChestGenHooks.setMax ( int  value)
void net.minecraftforge.common.ChestGenHooks.setMin ( int  value)

Member Data Documentation

final String net.minecraftforge.common.ChestGenHooks.BONUS_CHEST = "bonusChest"
static
final String net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST = "dungeonChest"
static
final String net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR = "mineshaftCorridor"
static
final String net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST = "pyramidDesertyChest"
static
final String net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST = "pyramidJungleChest"
static
final String net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_DISPENSER = "pyramidJungleDispenser"
static
final String net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR = "strongholdCorridor"
static
final String net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING = "strongholdCrossing"
static
final String net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY = "strongholdLibrary"
static
final String net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH = "villageBlacksmith"
static

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