public abstract class LootModifier extends java.lang.Object implements IGlobalLootModifier
Modifier and Type | Field and Description |
---|---|
private java.util.function.Predicate<LootContext> |
combinedConditions |
protected ILootCondition[] |
conditions |
Modifier | Constructor and Description |
---|---|
protected |
LootModifier(ILootCondition[] conditionsIn)
Constructs a LootModifier.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<ItemStack> |
apply(java.util.List<ItemStack> generatedLoot,
LootContext context)
Applies the modifier to the list of generated loot.
|
protected abstract java.util.List<ItemStack> |
doApply(java.util.List<ItemStack> generatedLoot,
LootContext context)
Applies the modifier to the generated loot (all loot conditions have already been checked
and have returned true).
|
protected final ILootCondition[] conditions
private final java.util.function.Predicate<LootContext> combinedConditions
protected LootModifier(ILootCondition[] conditionsIn)
conditionsIn
- the ILootConditions that need to be matched before the loot is modified.@Nonnull public final java.util.List<ItemStack> apply(java.util.List<ItemStack> generatedLoot, LootContext context)
IGlobalLootModifier
apply
in interface IGlobalLootModifier
generatedLoot
- the list of ItemStacks that will be dropped, generated by loot tablescontext
- the LootContext, identical to what is passed to loot tables@Nonnull protected abstract java.util.List<ItemStack> doApply(java.util.List<ItemStack> generatedLoot, LootContext context)
generatedLoot
- the list of ItemStacks that will be dropped, generated by loot tablescontext
- the LootContext, identical to what is passed to loot tables