Record Class CameraShake.Shake

java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.camera.CameraShake.Shake
Record Components:
intensity - how far the camera turns, in degrees, over the shake's life (its start, middle and end)
ticks - how long it lasts
frequency - how fast it rattles; 1 is a sharp impact, lower is a rumble
origin - where it comes from, or null for one felt the same everywhere
radius - with an origin: the distance at which nothing is felt any more
Enclosing class:
CameraShake

public static record CameraShake.Shake(Curve intensity, int ticks, float frequency, @Nullable net.minecraft.world.phys.Vec3 origin, float radius) extends Record
One shake.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Shake(Curve intensity, int ticks, float frequency, @Nullable net.minecraft.world.phys.Vec3 origin, float radius)
    Creates an instance of a Shake record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    float
    Returns the value of the frequency record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the intensity record component.
    @Nullable net.minecraft.world.phys.Vec3
    Returns the value of the origin record component.
    float
    Returns the value of the radius record component.
    int
    Returns the value of the ticks record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • Shake

      public Shake(Curve intensity, int ticks, float frequency, @Nullable @Nullable net.minecraft.world.phys.Vec3 origin, float radius)
      Creates an instance of a Shake record class.
      Parameters:
      intensity - the value for the intensity record component
      ticks - the value for the ticks record component
      frequency - the value for the frequency record component
      origin - the value for the origin record component
      radius - the value for the radius record component
  • Method Details

    • 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 '=='.
      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.
    • intensity

      public Curve intensity()
      Returns the value of the intensity record component.
      Returns:
      the value of the intensity record component
    • ticks

      public int ticks()
      Returns the value of the ticks record component.
      Returns:
      the value of the ticks record component
    • frequency

      public float frequency()
      Returns the value of the frequency record component.
      Returns:
      the value of the frequency record component
    • origin

      @Nullable public @Nullable net.minecraft.world.phys.Vec3 origin()
      Returns the value of the origin record component.
      Returns:
      the value of the origin record component
    • radius

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