public class ChestGenHooks extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BONUS_CHEST |
static String |
DUNGEON_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 and Description |
---|
ChestGenHooks(String category) |
ChestGenHooks(String category,
WeightedRandomChestContent[] items,
int min,
int max) |
Modifier and Type | Method and Description |
---|---|
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(Random rnd)
Gets an array of all random objects that are associated with this category.
|
static WeightedRandomChestContent[] |
getItems(String category,
Random rnd) |
int |
getMax() |
int |
getMin() |
ItemStack |
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.
|
static ItemStack |
getOneItem(String category,
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(String category,
ItemStack item) |
void |
setMax(int value) |
void |
setMin(int value) |
public static final String MINESHAFT_CORRIDOR
public static final String PYRAMID_DESERT_CHEST
public static final String PYRAMID_JUNGLE_CHEST
public static final String PYRAMID_JUNGLE_DISPENSER
public static final String STRONGHOLD_CORRIDOR
public static final String STRONGHOLD_LIBRARY
public static final String STRONGHOLD_CROSSING
public static final String VILLAGE_BLACKSMITH
public static final String BONUS_CHEST
public static final String DUNGEON_CHEST
public ChestGenHooks(String category)
public ChestGenHooks(String category, WeightedRandomChestContent[] items, int min, int max)
public static ChestGenHooks getInfo(String category)
category
- The category namepublic static ItemStack[] generateStacks(Random rand, ItemStack source, int min, int max)
rand
- A random number generatorsource
- Source item stackmin
- Minimum number of itemsmax
- Maximum number of itemspublic static WeightedRandomChestContent[] getItems(String category, Random rnd)
public static void addItem(String category, WeightedRandomChestContent item)
public void addItem(WeightedRandomChestContent item)
item
- The item to add.public void removeItem(ItemStack item)
item
- The item to checkpublic WeightedRandomChestContent[] getItems(Random rnd)
public int getCount(Random rand)
rand
- A RNGpublic ItemStack getOneItem(Random rand)
rand
- A Random Number genpublic int getMin()
public int getMax()
public void setMin(int value)
public void setMax(int value)