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 class
protected class
protected static interface
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final BiFunction
<ItemStack, LootContext, ItemStack> static final int
static final int
private final LootPoolEntry
protected final List
<LootItemFunction> Functions that are ran on the entry.protected final int
The quality of the entry.protected final int
The weight of the entry.Fields inherited from class net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer
conditions
Fields inherited from interface net.minecraft.world.level.storage.loot.entries.ComposableEntryContainer
ALWAYS_FALSE, ALWAYS_TRUE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LootPoolSingletonContainer
(int pWeight, int pQuality, List<LootItemCondition> pConditions, List<LootItemFunction> pFunctions) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
createItemStack
(Consumer<ItemStack> pStackConsumer, LootContext pLootContext) Generate the loot stacks of this entry.boolean
expand
(LootContext pLootContext, Consumer<LootPoolEntry> pEntryConsumer) Expand this loot pool entry container by callingentryConsumer
with 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> p_299239_) void
validate
(ValidationContext pValidationContext) Methods inherited from class net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer
canRun, commonFields, getType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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> p_299239_) -
validate
- Overrides:
validate
in 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
Expand this loot pool entry container by callingentryConsumer
with any applicable entries- Returns:
- whether this loot pool entry container successfully expanded or not
-
simpleBuilder
public static LootPoolSingletonContainer.Builder<?> simpleBuilder(LootPoolSingletonContainer.EntryConstructor pEntryBuilder)
-