net.minecraftforge.common

## Class ChestGenHooks

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

-     public class ChestGenHooks
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `BONUS_CHEST`
    `static java.lang.String` | `DUNGEON_CHEST`
    `static java.lang.String` | `MINESHAFT_CORRIDOR`
    `static java.lang.String` | `PYRAMID_DESERT_CHEST`
    `static java.lang.String` | `PYRAMID_JUNGLE_CHEST`
    `static java.lang.String` | `PYRAMID_JUNGLE_DISPENSER`
    `static java.lang.String` | `STRONGHOLD_CORRIDOR`
    `static java.lang.String` | `STRONGHOLD_CROSSING`
    `static java.lang.String` | `STRONGHOLD_LIBRARY`
    `static java.lang.String` | `VILLAGE_BLACKSMITH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChestGenHooks(java.lang.String category)`
    `ChestGenHooks(java.lang.String category, WeightedRandomChestContent[] items, int min, int max)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addItem(java.lang.String category, WeightedRandomChestContent item)`
    `void` | `addItem(WeightedRandomChestContent item)` Adds a new entry into the possible items to generate.
    `static ItemStack[]` | `generateStacks(java.util.Random rand, ItemStack source, int min, int max)` Generates an array of items based on the input min/max count.
    `int` | `getCount(java.util.Random rand)` Gets a random number between countMin and countMax.
    `static int` | `getCount(java.lang.String category, java.util.Random rand)`
    `static ChestGenHooks` | `getInfo(java.lang.String category)` Retrieves, or creates the info class for the specified category.
    `WeightedRandomChestContent[]` | `getItems(java.util.Random rnd)` Gets an array of all random objects that are associated with this category.
    `static WeightedRandomChestContent[]` | `getItems(java.lang.String category, java.util.Random rnd)`
    `int` | `getMax()`
    `int` | `getMin()`
    `ItemStack` | `getOneItem(java.util.Random rand)` Returns a single ItemStack from the possible items in this registry, Useful if you just want a quick and dirty random Item.
    `static ItemStack` | `getOneItem(java.lang.String category, java.util.Random rand)`
    `void` | `removeItem(ItemStack item)` Removes all items that match the input item stack, Only metadata and item ID are checked.
    `static void` | `removeItem(java.lang.String category, ItemStack item)`
    `void` | `setMax(int value)`
    `void` | `setMin(int value)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### MINESHAFT_CORRIDOR

          public static final java.lang.String MINESHAFT_CORRIDOR

      See Also:
        Constant Field Values

    - #### PYRAMID_DESERT_CHEST

          public static final java.lang.String PYRAMID_DESERT_CHEST

      See Also:
        Constant Field Values

    - #### PYRAMID_JUNGLE_CHEST

          public static final java.lang.String PYRAMID_JUNGLE_CHEST

      See Also:
        Constant Field Values

    - #### PYRAMID_JUNGLE_DISPENSER

          public static final java.lang.String PYRAMID_JUNGLE_DISPENSER

      See Also:
        Constant Field Values

    - #### STRONGHOLD_CORRIDOR

          public static final java.lang.String STRONGHOLD_CORRIDOR

      See Also:
        Constant Field Values

    - #### STRONGHOLD_LIBRARY

          public static final java.lang.String STRONGHOLD_LIBRARY

      See Also:
        Constant Field Values

    - #### STRONGHOLD_CROSSING

          public static final java.lang.String STRONGHOLD_CROSSING

      See Also:
        Constant Field Values

    - #### VILLAGE_BLACKSMITH

          public static final java.lang.String VILLAGE_BLACKSMITH

      See Also:
        Constant Field Values

    - #### BONUS_CHEST

          public static final java.lang.String BONUS_CHEST

      See Also:
        Constant Field Values

    - #### DUNGEON_CHEST

          public static final java.lang.String DUNGEON_CHEST

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ChestGenHooks

          public ChestGenHooks(java.lang.String category)

    - #### ChestGenHooks

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

  - ### Method Detail

    - #### getInfo

          public static ChestGenHooks getInfo(java.lang.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(java.util.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(java.lang.String category,
                                              java.util.Random rnd)

    - #### getCount

          public static int getCount(java.lang.String category,
                     java.util.Random rand)

    - #### addItem

          public static void addItem(java.lang.String category,
                     WeightedRandomChestContent item)

    - #### removeItem

          public static void removeItem(java.lang.String category,
                        ItemStack item)

    - #### getOneItem

          public static ItemStack getOneItem(java.lang.String category,
                             java.util.Random rand)

    - #### 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(java.util.Random rnd)

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

    - #### getCount

          public int getCount(java.util.Random rand)

      Gets a random number between countMin and countMax.
      Parameters:
        `rand` - A RNG
      Returns:
        A random number where countMin <= num <= countMax

    - #### getOneItem

          public ItemStack getOneItem(java.util.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:
        `rand` - A Random Number gen
      Returns:
        A single ItemStack, or null if it could not get one.

    - #### getMin

          public int getMin()

    - #### getMax

          public int getMax()

    - #### setMin

          public void setMin(int value)

    - #### setMax

          public void setMax(int value)