public class LootTable extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LootTable.Builder |
static class |
LootTable.Serializer |
Modifier and Type | Field and Description |
---|---|
private BiFunction<ItemStack,LootContext,ItemStack> |
combinedFunction |
static LootTable |
EMPTY |
private LootFunction[] |
functions |
static LootContextType |
GENERIC |
private static Logger |
LOGGER |
private LootPool[] |
pools |
private LootContextType |
type |
Modifier | Constructor and Description |
---|---|
private |
LootTable(LootContextType type,
LootPool[] pools,
LootFunction[] functions) |
Modifier and Type | Method and Description |
---|---|
static LootTable.Builder |
builder() |
List<ItemStack> |
generateLoot(LootContext context) |
void |
generateLoot(LootContext context,
Consumer<ItemStack> lootConsumer) |
void |
generateUnprocessedLoot(LootContext context,
Consumer<ItemStack> lootConsumer) |
private List<Integer> |
getFreeSlots(Inventory inventory,
Random random) |
LootContextType |
getType() |
static Consumer<ItemStack> |
processStacks(Consumer<ItemStack> lootConsumer) |
private void |
shuffle(List<ItemStack> drops,
int freeSlots,
Random random) |
void |
supplyInventory(Inventory inventory,
LootContext context) |
void |
validate(LootTableReporter reporter) |
private static final Logger LOGGER
public static final LootTable EMPTY
public static final LootContextType GENERIC
private final LootContextType type
private final LootPool[] pools
private final LootFunction[] functions
private final BiFunction<ItemStack,LootContext,ItemStack> combinedFunction
private LootTable(LootContextType type, LootPool[] pools, LootFunction[] functions)
public void generateUnprocessedLoot(LootContext context, Consumer<ItemStack> lootConsumer)
public void generateLoot(LootContext context, Consumer<ItemStack> lootConsumer)
public List<ItemStack> generateLoot(LootContext context)
public LootContextType getType()
public void validate(LootTableReporter reporter)
public void supplyInventory(Inventory inventory, LootContext context)
public static LootTable.Builder builder()