Record Class AttributePhysicsState
java.lang.Object
java.lang.Record
com.viaversion.viafabricplus.bedrock.movement.replay.AttributePhysicsState
public record AttributePhysicsState(Map<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>, AttributePhysicsState.Value> values, Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> update, Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> sync)
extends Record
Base values and modifier ownership are independent of cached attribute totals and dirty synchronization sets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Constructor Summary
ConstructorsConstructorDescriptionAttributePhysicsState(Map<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>, AttributePhysicsState.Value> values, Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> update, Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> sync) Creates an instance of aAttributePhysicsStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyChanges(AttributePhysicsState previous, net.minecraft.world.entity.ai.attributes.AttributeMap attributes) static AttributePhysicsStatecapture(net.minecraft.world.entity.ai.attributes.AttributeMap attributes) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.voidrestore(net.minecraft.world.entity.ai.attributes.AttributeMap attributes) Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> sync()Returns the value of thesyncrecord component.final StringtoString()Returns a string representation of this record class.Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> update()Returns the value of theupdaterecord component.Map<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>, AttributePhysicsState.Value> values()Returns the value of thevaluesrecord component.
-
Constructor Details
-
AttributePhysicsState
public AttributePhysicsState(Map<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>, AttributePhysicsState.Value> values, Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> update, Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> sync) Creates an instance of aAttributePhysicsStaterecord class.- Parameters:
values- the value for thevaluesrecord componentupdate- the value for theupdaterecord componentsync- the value for thesyncrecord component
-
-
Method Details
-
capture
public static AttributePhysicsState capture(net.minecraft.world.entity.ai.attributes.AttributeMap attributes) -
restore
public void restore(net.minecraft.world.entity.ai.attributes.AttributeMap attributes) -
applyChanges
public void applyChanges(AttributePhysicsState previous, net.minecraft.world.entity.ai.attributes.AttributeMap attributes) -
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). -
values
public Map<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>, AttributePhysicsState.Value> values()Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-
update
Returns the value of theupdaterecord component.- Returns:
- the value of the
updaterecord component
-
sync
Returns the value of thesyncrecord component.- Returns:
- the value of the
syncrecord component
-