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 Classes
    Modifier and Type
    Class
    Description
    static final record 
     
    static final record 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 a AttributePhysicsState record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyChanges(AttributePhysicsState previous, net.minecraft.world.entity.ai.attributes.AttributeMap attributes)
     
    capture(net.minecraft.world.entity.ai.attributes.AttributeMap attributes)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    void
    restore(net.minecraft.world.entity.ai.attributes.AttributeMap attributes)
     
    Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>>
    Returns the value of the sync record component.
    final String
    Returns a string representation of this record class.
    Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>>
    Returns the value of the update record component.
    Map<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>, AttributePhysicsState.Value>
    Returns the value of the values record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a AttributePhysicsState record class.
      Parameters:
      values - the value for the values record component
      update - the value for the update record component
      sync - the value for the sync record 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • values

      public Map<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>, AttributePhysicsState.Value> values()
      Returns the value of the values record component.
      Returns:
      the value of the values record component
    • update

      public Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> update()
      Returns the value of the update record component.
      Returns:
      the value of the update record component
    • sync

      public Set<net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute>> sync()
      Returns the value of the sync record component.
      Returns:
      the value of the sync record component