Record Class ConditionalLootTableSubProvider
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.data.ConditionalLootTableSubProvider
- All Implemented Interfaces:
LootTableSubProvider,LootTableSubProviderExtension
public record ConditionalLootTableSubProvider(LootTableSubProvider wrapped, List<ICondition> conditions)
extends Record
implements LootTableSubProvider
Wrapper around a
LootTableSubProvider that adds conditions to all loot tables generated in the wrapped provider.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ICondition> The field for theconditionsrecord component.private final LootTableSubProviderThe field for thewrappedrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionConditionalLootTableSubProvider(LootTableSubProvider wrapped, List<ICondition> conditions) Creates an instance of aConditionalLootTableSubProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconditionsrecord component.final booleanIndicates whether some other object is "equal to" this one.voidgenerate(BiConsumer<ResourceKey<LootTable>, LootTable.Builder> output) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.wrapped()Returns the value of thewrappedrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.common.extensions.LootTableSubProviderExtension
withConditions
-
Field Details
-
wrapped
The field for thewrappedrecord component. -
conditions
The field for theconditionsrecord component.
-
-
Constructor Details
-
ConditionalLootTableSubProvider
Creates an instance of aConditionalLootTableSubProviderrecord class.- Parameters:
wrapped- the value for thewrappedrecord componentconditions- the value for theconditionsrecord component
-
-
Method Details
-
generate
- Specified by:
generatein interfaceLootTableSubProvider
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
-