Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.minecraftforge.common
Class ChestGenHooks

    java.lang.Object
      net.minecraftforge.common.ChestGenHooks

    public class ChestGenHooks

extends Object

Field Summary
`static String` | `BONUS_CHEST`
`static String` | `MINESHAFT_CORRIDOR`
`static String` | `PYRAMID_DESERT_CHEST`
`static String` | `PYRAMID_JUNGLE_CHEST`
`static String` | `PYRAMID_JUNGLE_DISPENSER`
`static String` | `STRONGHOLD_CORRIDOR`
`static String` | `STRONGHOLD_CROSSING`
`static String` | `STRONGHOLD_LIBRARY`
`static String` | `VILLAGE_BLACKSMITH`

Constructor Summary
`ChestGenHooks(String category)`
`ChestGenHooks(String category, WeightedRandomChestContent[] items, int min, int max)`

Method Summary
`static void` | `addItem(String category, WeightedRandomChestContent item)`
`void` | `addItem(WeightedRandomChestContent item)` Adds a new entry into the possible items to generate.
`static ItemStack[]` | `generateStacks(Random rand, ItemStack source, int min, int max)` Generates an array of items based on the input min/max count.
`int` | `getCount(Random rand)` Gets a random number between countMin and countMax.
`static int` | `getCount(String category, Random rand)`
`static ChestGenHooks` | `getInfo(String category)` Retrieves, or creates the info class for the specified category.
`WeightedRandomChestContent[]` | `getItems()` Gets an array of all random objects that are associated with this category.
`static WeightedRandomChestContent[]` | `getItems(String category)`
`int` | `getMax()`
`int` | `getMin()`
`void` | `removeItem(ItemStack item)` Removes all items that match the input item stack, Only metadata and item ID are checked.
`static void` | `removeItem(String category, ItemStack item)`
`void` | `setMax(int value)`
`void` | `setMin(int value)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MINESHAFT_CORRIDOR

    public static final String MINESHAFT_CORRIDOR

See Also:
  Constant Field Values

### PYRAMID_DESERT_CHEST

    public static final String PYRAMID_DESERT_CHEST

See Also:
  Constant Field Values

### PYRAMID_JUNGLE_CHEST

    public static final String PYRAMID_JUNGLE_CHEST

See Also:
  Constant Field Values

### PYRAMID_JUNGLE_DISPENSER

    public static final String PYRAMID_JUNGLE_DISPENSER

See Also:
  Constant Field Values

### STRONGHOLD_CORRIDOR

    public static final String STRONGHOLD_CORRIDOR

See Also:
  Constant Field Values

### STRONGHOLD_LIBRARY

    public static final String STRONGHOLD_LIBRARY

See Also:
  Constant Field Values

### STRONGHOLD_CROSSING

    public static final String STRONGHOLD_CROSSING

See Also:
  Constant Field Values

### VILLAGE_BLACKSMITH

    public static final String VILLAGE_BLACKSMITH

See Also:
  Constant Field Values

### BONUS_CHEST

    public static final String BONUS_CHEST

See Also:
  Constant Field Values

Constructor Detail

### ChestGenHooks

    public ChestGenHooks(String category)

### ChestGenHooks

    public ChestGenHooks(String category,
                         WeightedRandomChestContent[] items,
                         int min,
                         int max)

Method Detail

### getInfo

    public static ChestGenHooks getInfo(String category)

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

  Parameters:
    `category` - The category name
  Returns:
    A instance of ChestGenHooks for the specified category.

### generateStacks

    public static ItemStack[] generateStacks(Random rand,
                                             ItemStack source,
                                             int min,
                                             int max)

  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:
    `rand` - A random number generator
    `source` - Source item stack
    `min` - Minimum number of items
    `max` - Maximum number of items
  Returns:
    An array containing the generated item stacks

### getItems

    public static WeightedRandomChestContent[] getItems(String category)

### getCount

    public static int getCount(String category,
                               Random rand)

### addItem

    public static void addItem(String category,
                               WeightedRandomChestContent item)

### removeItem

    public static void removeItem(String category,
                                  ItemStack item)

### addItem

    public void addItem(WeightedRandomChestContent item)

  Adds a new entry into the possible items to generate.

  Parameters:
    `item` - The item to add.

### removeItem

    public void 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:
    `item` - The item to check

### getItems

    public WeightedRandomChestContent[] getItems()

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

  Returns:
    The random objects

### getCount

    public int getCount(Random rand)

  Gets a random number between countMin and countMax.

  Parameters:
    `rand` - A RNG
  Returns:
    A random number where countMin <= num <= countMax

### getMin

    public int getMin()

### getMax

    public int getMax()

### setMin

    public void setMin(int value)

### setMax

    public void setMax(int value)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD