Class LootPoolSingletonContainer
java.lang.Object
net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer
net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer
- All Implemented Interfaces:
ComposableEntryContainer
- Direct Known Subclasses:
DynamicLoot,EmptyLootItem,LootItem,NestedLootTable,TagEntry
A LootPoolEntryContainer that expands into a single LootPoolEntry.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class(package private) static classprotected classprotected static interface -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final BiFunction<ItemStack, LootContext, ItemStack> static final intstatic final intprivate final LootPoolEntryprotected final List<LootItemFunction> Functions that are ran on the entry.protected final intThe quality of the entry.protected final intThe weight of the entry.Fields inherited from class net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer
conditionsFields inherited from interface net.minecraft.world.level.storage.loot.entries.ComposableEntryContainer
ALWAYS_FALSE, ALWAYS_TRUE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLootPoolSingletonContainer(int weight, int quality, List<LootItemCondition> conditions, List<LootItemFunction> functions) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcreateItemStack(Consumer<ItemStack> stackConsumer, LootContext lootContext) Generate the loot stacks of this entry.booleanexpand(LootContext lootContext, Consumer<LootPoolEntry> entryConsumer) Expand this loot pool entry container by callingentryConsumerwith any applicable entriesstatic LootPoolSingletonContainer.Builder<?> simpleBuilder(LootPoolSingletonContainer.EntryConstructor entryBuilder) protected static <T extends LootPoolSingletonContainer>
com.mojang.datafixers.Products.P4<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<T>, Integer, Integer, List<LootItemCondition>, List<LootItemFunction>> singletonFields(com.mojang.serialization.codecs.RecordCodecBuilder.Instance<T> instance) voidvalidate(ValidationContext validationContext) Methods inherited from class net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer
canRun, commonFields, getTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.level.storage.loot.entries.ComposableEntryContainer
and, or
-
Field Details
-
DEFAULT_WEIGHT
public static final int DEFAULT_WEIGHT- See Also:
-
DEFAULT_QUALITY
public static final int DEFAULT_QUALITY- See Also:
-
weight
protected final int weightThe weight of the entry. -
quality
protected final int qualityThe quality of the entry. -
functions
Functions that are ran on the entry. -
compositeFunction
-
entry
-
-
Constructor Details
-
LootPoolSingletonContainer
protected LootPoolSingletonContainer(int weight, int quality, List<LootItemCondition> conditions, List<LootItemFunction> functions)
-
-
Method Details
-
singletonFields
protected static <T extends LootPoolSingletonContainer> com.mojang.datafixers.Products.P4<com.mojang.serialization.codecs.RecordCodecBuilder.Mu<T>,Integer, singletonFieldsInteger, List<LootItemCondition>, List<LootItemFunction>> (com.mojang.serialization.codecs.RecordCodecBuilder.Instance<T> instance) -
validate
- Overrides:
validatein classLootPoolEntryContainer
-
createItemStack
Generate the loot stacks of this entry. Contrary to the method name this method does not always generate one stack, it can also generate zero or multiple stacks. -
expand
Expand this loot pool entry container by callingentryConsumerwith any applicable entries- Returns:
- whether this loot pool entry container successfully expanded or not
-
simpleBuilder
public static LootPoolSingletonContainer.Builder<?> simpleBuilder(LootPoolSingletonContainer.EntryConstructor entryBuilder)
-