public class ChestGenHooks
extends java.lang.Object
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 |
NETHER_FORTRESS |
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 and Description |
---|
ChestGenHooks(java.lang.String category) |
ChestGenHooks(java.lang.String category,
java.util.List<WeightedRandomChestContent> items,
int min,
int max) |
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.
|
java.util.List<WeightedRandomChestContent> |
getItems(java.util.Random rnd)
Gets an array of all random objects that are associated with this category.
|
static java.util.List<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) |
static void |
init(java.lang.String category,
java.util.List<WeightedRandomChestContent> items,
int min,
int max) |
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) |
public static final java.lang.String MINESHAFT_CORRIDOR
public static final java.lang.String PYRAMID_DESERT_CHEST
public static final java.lang.String PYRAMID_JUNGLE_CHEST
public static final java.lang.String PYRAMID_JUNGLE_DISPENSER
public static final java.lang.String STRONGHOLD_CORRIDOR
public static final java.lang.String STRONGHOLD_LIBRARY
public static final java.lang.String STRONGHOLD_CROSSING
public static final java.lang.String VILLAGE_BLACKSMITH
public static final java.lang.String BONUS_CHEST
public static final java.lang.String DUNGEON_CHEST
public static final java.lang.String NETHER_FORTRESS
public ChestGenHooks(java.lang.String category)
public ChestGenHooks(java.lang.String category, java.util.List<WeightedRandomChestContent> items, int min, int max)
public static void init(java.lang.String category, java.util.List<WeightedRandomChestContent> items, int min, int max)
public static ChestGenHooks getInfo(java.lang.String category)
category
- The category namepublic static ItemStack[] generateStacks(java.util.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 java.util.List<WeightedRandomChestContent> getItems(java.lang.String category, java.util.Random rnd)
public static int getCount(java.lang.String category, java.util.Random rand)
public static void addItem(java.lang.String category, WeightedRandomChestContent item)
public static void removeItem(java.lang.String category, ItemStack item)
public static ItemStack getOneItem(java.lang.String category, java.util.Random rand)
public void addItem(WeightedRandomChestContent item)
item
- The item to add.public void removeItem(ItemStack item)
item
- The item to checkpublic java.util.List<WeightedRandomChestContent> getItems(java.util.Random rnd)
public int getCount(java.util.Random rand)
rand
- A RNGpublic ItemStack getOneItem(java.util.Random rand)
rand
- A Random Number genpublic int getMin()
public int getMax()
public void setMin(int value)
public void setMax(int value)