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, Validatable
- Direct Known Subclasses:
DynamicLoot, EmptyLootItem, LootItem, NestedLootTable, SlotLoot, TagEntry
A LootPoolEntryContainer that expands into a single LootPoolEntry.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static classprotected classprotected static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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 LootPoolEntryContainer
conditionsFields inherited from interface ComposableEntryContainer
ALWAYS_FALSE, ALWAYS_TRUE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLootPoolSingletonContainer(int weight, int quality, List<LootItemCondition> conditions, List<LootItemFunction> functions) -
Method Summary
Modifier and TypeMethodDescriptionabstract com.mojang.serialization.MapCodec<? extends LootPoolSingletonContainer> codec()protected abstract voidcreateItemStack(Consumer<ItemStack> output, LootContext context) Generate the loot stacks of this entry.booleanexpand(LootContext context, Consumer<LootPoolEntry> output) Expand this loot pool entry container by callingentryConsumerwith any applicable entriesstatic LootPoolSingletonContainer.Builder<?> simpleBuilder(LootPoolSingletonContainer.EntryConstructor constructor) 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> i) voidvalidate(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
-
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
-
codec
- Specified by:
codecin classLootPoolEntryContainer
-
singletonFields
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> i) -
validate
- Specified by:
validatein interfaceValidatable- 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
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 constructor)
-