Record Class OffsetProviderContext

java.lang.Object
java.lang.Record
com.jtprince.coordinateoffset.provider.OffsetProviderContext
Record Components:
player - The Player that will receive this new Offset.
previousLocation - The previous location of the Player before this Offset begins to take effect. If the player is joining the server or the death location is unknown for a respawn, this will be null.
playerLocation - The real location that the Player will be at as soon as this Offset begins to take effect. Note that this may be different from player.getLocation() because the Provider is called before a teleport completes.
reason - The reason that a new Offset is being requested.

@NullMarked public record OffsetProviderContext(OffsetPlayer player, @Nullable OffsetLocation previousLocation, OffsetLocation playerLocation, @Nullable Offset previousOffset, OffsetProviderContext.ProvideReason reason) extends Record
Container for relevant information when calculating a new Offset.
  • Constructor Details

  • Method Details

    • worldName

      @Deprecated public String worldName()
      Deprecated.
    • 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.
    • player

      public OffsetPlayer player()
      Returns the value of the player record component.
      Returns:
      the value of the player record component
    • previousLocation

      public @Nullable OffsetLocation previousLocation()
      Returns the value of the previousLocation record component.
      Returns:
      the value of the previousLocation record component
    • playerLocation

      public OffsetLocation playerLocation()
      Returns the value of the playerLocation record component.
      Returns:
      the value of the playerLocation record component
    • previousOffset

      public @Nullable Offset previousOffset()
      Returns the value of the previousOffset record component.
      Returns:
      the value of the previousOffset record component
    • reason

      Returns the value of the reason record component.
      Returns:
      the value of the reason record component