Record Class PhysicalInput

java.lang.Object
java.lang.Record
com.viaversion.viafabricplus.bedrock.movement.replay.PhysicalInput

public record PhysicalInput(net.minecraft.world.entity.player.Input keys, float strafe, float forward) extends Record
Raw input polling is recorded separately from posture, item-use scaling, and automatic jumping.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PhysicalInput(net.minecraft.world.entity.player.Input keys, float strafe, float forward)
    Creates an instance of a PhysicalInput record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    capture(net.minecraft.client.player.ClientInput input)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    float
    Returns the value of the forward record component.
    final int
    Returns a hash code value for this object.
    net.minecraft.world.entity.player.Input
    Returns the value of the keys record component.
    void
    restore(net.minecraft.client.player.ClientInput input)
     
    float
    Returns the value of the strafe record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PhysicalInput

      public PhysicalInput(net.minecraft.world.entity.player.Input keys, float strafe, float forward)
      Creates an instance of a PhysicalInput record class.
      Parameters:
      keys - the value for the keys record component
      strafe - the value for the strafe record component
      forward - the value for the forward record component
  • Method Details

    • capture

      public static PhysicalInput capture(net.minecraft.client.player.ClientInput input)
    • restore

      public void restore(net.minecraft.client.player.ClientInput input)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • keys

      public net.minecraft.world.entity.player.Input keys()
      Returns the value of the keys record component.
      Returns:
      the value of the keys record component
    • strafe

      public float strafe()
      Returns the value of the strafe record component.
      Returns:
      the value of the strafe record component
    • forward

      public float forward()
      Returns the value of the forward record component.
      Returns:
      the value of the forward record component