Record Class AttributeUtil.BaseModifier
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.util.AttributeUtil.BaseModifier
- Enclosing class:
AttributeUtil
private static record AttributeUtil.BaseModifier(AttributeModifier base, List<AttributeModifier> children)
extends Record
Stores a single base modifier (determined by
IAttributeExtension.getBaseId()) and any other children non-base modifiers for the same attribute.
Used during attribute merging logic within AttributeUtil.applyTextFor(net.minecraft.world.item.ItemStack, java.util.function.Consumer<net.minecraft.network.chat.Component>, com.google.common.collect.Multimap<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>, net.minecraft.world.entity.ai.attributes.AttributeModifier>, net.neoforged.neoforge.common.util.AttributeTooltipContext).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AttributeModifierThe field for thebaserecord component.private final List<AttributeModifier> The field for thechildrenrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBaseModifier(AttributeModifier base, List<AttributeModifier> children) Creates an instance of aBaseModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbase()Returns the value of thebaserecord component.children()Returns the value of thechildrenrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
base
The field for thebaserecord component. -
children
The field for thechildrenrecord component.
-
-
Constructor Details
-
BaseModifier
Creates an instance of aBaseModifierrecord class.- Parameters:
base- the value for thebaserecord componentchildren- the value for thechildrenrecord component
-
-
Method Details
-
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). -
base
Returns the value of thebaserecord component.- Returns:
- the value of the
baserecord component
-
children
Returns the value of thechildrenrecord component.- Returns:
- the value of the
childrenrecord component
-