public class LootPool
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LootPool.Serializer |
Modifier and Type | Field and Description |
---|---|
private RandomValueRange |
bonusRolls |
private boolean |
isFrozen |
private java.util.List<LootEntry> |
lootEntries |
private java.lang.String |
name |
private java.util.List<LootCondition> |
poolConditions |
private RandomValueRange |
rolls |
Constructor and Description |
---|
LootPool(LootEntry[] lootEntriesIn,
LootCondition[] poolConditionsIn,
RandomValueRange rollsIn,
RandomValueRange bonusRollsIn,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addEntry(LootEntry entry) |
private void |
checkFrozen() |
protected void |
createLootRoll(java.util.Collection<ItemStack> stacks,
java.util.Random rand,
LootContext context) |
void |
freeze() |
void |
generateLoot(java.util.Collection<ItemStack> stacks,
java.util.Random rand,
LootContext context) |
RandomValueRange |
getBonusRolls() |
LootEntry |
getEntry(java.lang.String name) |
java.lang.String |
getName() |
RandomValueRange |
getRolls() |
boolean |
isFrozen() |
LootEntry |
removeEntry(java.lang.String name) |
void |
setBonusRolls(RandomValueRange v) |
void |
setRolls(RandomValueRange v) |
private final java.util.List<LootEntry> lootEntries
private final java.util.List<LootCondition> poolConditions
private RandomValueRange rolls
private RandomValueRange bonusRolls
private final java.lang.String name
private boolean isFrozen
public LootPool(LootEntry[] lootEntriesIn, LootCondition[] poolConditionsIn, RandomValueRange rollsIn, RandomValueRange bonusRollsIn, java.lang.String name)
protected void createLootRoll(java.util.Collection<ItemStack> stacks, java.util.Random rand, LootContext context)
public void generateLoot(java.util.Collection<ItemStack> stacks, java.util.Random rand, LootContext context)
public void freeze()
public boolean isFrozen()
private void checkFrozen()
public java.lang.String getName()
public RandomValueRange getRolls()
public RandomValueRange getBonusRolls()
public void setRolls(RandomValueRange v)
public void setBonusRolls(RandomValueRange v)
public LootEntry getEntry(java.lang.String name)
public LootEntry removeEntry(java.lang.String name)
public void addEntry(LootEntry entry)