Record Class ConditionalLootTableSubProviderContext
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.data.ConditionalLootTableSubProviderContext
- All Implemented Interfaces:
LootTableSubProvider.Context, BootstrapContextAccess, BootstrapContextAccessExtension, LootTableSubProviderContextExtension
public record ConditionalLootTableSubProviderContext(LootTableSubProvider.Context wrapped, List<ICondition> conditions)
extends Record
implements LootTableSubProvider.Context
Wrapper around a
LootTableSubProvider.Context that adds conditions to all loot tables registered to the wrapped context.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ICondition> The field for theconditionsrecord component.private final LootTableSubProvider.ContextThe field for thewrappedrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionConditionalLootTableSubProviderContext(LootTableSubProvider.Context wrapped, List<ICondition> conditions) Creates an instance of aConditionalLootTableSubProviderContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaccept(ResourceKey<LootTable> key, LootTable.Builder value) Returns the value of theconditionsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.<S> Stream<Holder.Reference<S>> listContextElements(ResourceKey<? extends Registry<? extends S>> key) Deprecated.<S> HolderGetter<S> lookup(ResourceKey<? extends Registry<? extends S>> key) final StringtoString()Returns a string representation of this record class.wrapped()Returns the value of thewrappedrecord component.Methods inherited from interface BootstrapContextAccessExtension
holderLookupMethods inherited from interface LootTableSubProviderContextExtension
withConditions
-
Field Details
-
wrapped
The field for thewrappedrecord component. -
conditions
The field for theconditionsrecord component.
-
-
Constructor Details
-
ConditionalLootTableSubProviderContext
public ConditionalLootTableSubProviderContext(LootTableSubProvider.Context wrapped, List<ICondition> conditions) Creates an instance of aConditionalLootTableSubProviderContextrecord class.- Parameters:
wrapped- the value for thewrappedrecord componentconditions- the value for theconditionsrecord component
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceLootTableSubProvider.Context
-
lookup
- Specified by:
lookupin interfaceBootstrapContextAccess
-
listContextElements
@Deprecated public <S> Stream<Holder.Reference<S>> listContextElements(ResourceKey<? extends Registry<? extends S>> key) Deprecated.- Specified by:
listContextElementsin interfaceBootstrapContextAccess
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
wrapped
Returns the value of thewrappedrecord component.- Returns:
- the value of the
wrappedrecord component
-
conditions
Returns the value of theconditionsrecord component.- Returns:
- the value of the
conditionsrecord component
-