Class LootEntry
java.lang.Object
com.github.darksoulq.abyssallib.world.data.loot.LootEntry
- Direct Known Subclasses:
LootEntry.EmptyEntry, LootEntry.ItemEntry
An abstract representation of a single choice within a loot pool.
Entries can represent items, empty slots, or recursive loot tables.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA loot entry that represents a "no drop" chance.static classA loot entry that generates a specific item stack. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLootEntry(int weight, int quality, List<LootCondition> conditions, List<LootFunction> functions) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidexpand(LootContext context, Consumer<org.bukkit.inventory.ItemStack> generator) Generates the actual content of the entry and passes it to the sink.booleantest(LootContext context) Tests if this entry can be selected in the given context.
-
Field Details
-
CODEC
-
-
Constructor Details
-
LootEntry
public LootEntry(int weight, int quality, List<LootCondition> conditions, List<LootFunction> functions) - Parameters:
weight- Entry weight.quality- Entry quality.conditions- Activation conditions.functions- Item modifiers.
-
-
Method Details
-
test
Tests if this entry can be selected in the given context.- Parameters:
context- The currentLootContext.- Returns:
trueif all conditions pass.
-
expand
public abstract void expand(LootContext context, Consumer<org.bukkit.inventory.ItemStack> generator) Generates the actual content of the entry and passes it to the sink.- Parameters:
context- The currentLootContext.generator- TheConsumerfor generated stacks.
-