Class CompositeEntryBase
java.lang.Object
net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer
net.minecraft.world.level.storage.loot.entries.CompositeEntryBase
- All Implemented Interfaces:
ComposableEntryContainer, Validatable
- Direct Known Subclasses:
AlternativesEntry, EntryGroup, SequentialEntry
Base class for loot pool entry containers that delegate to one or more children.
The actual functionality is provided by composing the children into one composed container (see
compose(List)).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceNested classes/interfaces inherited from class LootPoolEntryContainer
LootPoolEntryContainer.Builder<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<LootPoolEntryContainer> private final ComposableEntryContainerstatic final ProblemReporter.ProblemFields inherited from class LootPoolEntryContainer
conditionsFields inherited from interface ComposableEntryContainer
ALWAYS_FALSE, ALWAYS_TRUE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCompositeEntryBase(List<LootPoolEntryContainer> children, List<LootItemCondition> conditions) -
Method Summary
Modifier and TypeMethodDescriptionabstract com.mojang.serialization.MapCodec<? extends CompositeEntryBase> codec()protected abstract ComposableEntryContainercompose(List<? extends ComposableEntryContainer> entries) static <T extends CompositeEntryBase>
com.mojang.serialization.MapCodec<T> createCodec(CompositeEntryBase.CompositeEntryConstructor<T> constructor) final booleanexpand(LootContext context, Consumer<LootPoolEntry> output) Expand this loot pool entry container by callingentryConsumerwith any applicable entriesvoidvalidate(ValidationContext context) Methods inherited from class LootPoolEntryContainer
canRun, commonFieldsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ComposableEntryContainer
and, or
-
Field Details
-
NO_CHILDREN_PROBLEM
-
children
-
composedChildren
-
-
Constructor Details
-
CompositeEntryBase
protected CompositeEntryBase(List<LootPoolEntryContainer> children, List<LootItemCondition> conditions)
-
-
Method Details
-
codec
- Specified by:
codecin classLootPoolEntryContainer
-
validate
- Specified by:
validatein interfaceValidatable- Overrides:
validatein classLootPoolEntryContainer
-
compose
protected abstract ComposableEntryContainer compose(List<? extends ComposableEntryContainer> entries) -
expand
Description copied from interface:ComposableEntryContainerExpand this loot pool entry container by callingentryConsumerwith any applicable entries- Returns:
- whether this loot pool entry container successfully expanded or not
-
createCodec
public static <T extends CompositeEntryBase> com.mojang.serialization.MapCodec<T> createCodec(CompositeEntryBase.CompositeEntryConstructor<T> constructor)
-