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 pWeight, int pQuality, List<LootItemCondition> pConditions, List<LootItemFunction> pFunctions) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcreateItemStack(Consumer<ItemStack> pStackConsumer, LootContext pLootContext) Generate the loot stacks of this entry.booleanexpand(LootContext p_79694_, Consumer<LootPoolEntry> p_79695_) Expand this loot pool entry container by callingentryConsumerwith any applicable entriesstatic LootPoolSingletonContainer.Builder<?> simpleBuilder(LootPoolSingletonContainer.EntryConstructor pEntryBuilder) 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> pInstance) voidvalidate(ValidationContext p_79686_) 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 pWeight, int pQuality, List<LootItemCondition> pConditions, List<LootItemFunction> pFunctions)
-
-
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> pInstance) -
validate
- Overrides:
validatein classLootPoolEntryContainer
-
createItemStack
protected abstract void createItemStack(Consumer<ItemStack> pStackConsumer, LootContext pLootContext) 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
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
-
simpleBuilder
public static LootPoolSingletonContainer.Builder<?> simpleBuilder(LootPoolSingletonContainer.EntryConstructor pEntryBuilder)
-