Record Class RiftSpec

java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.vfx.RiftSpec
Record Components:
width - its width at its widest, in blocks
height - its height, in blocks
color - the colour of its edge and glow, 0xRRGGBB; its inside is a dark shade of the same
openTicks - how long it takes to tear open
closeTicks - how long it takes to close
openSound - played as it opens; null for none
ambientSound - played over and over while it stays open; null for none
closeSound - played as it closes; null for none
ambientTicks - ticks between two plays of the ambient sound
volume - how loud its sounds are
particles - motes drawn into it while it is open; null for none
particleRate - motes a tick
shake - how hard the camera of a player beside it shakes as it opens and as it closes, in degrees; 0 for none

public record RiftSpec(float width, float height, int color, int openTicks, int closeTicks, @Nullable net.minecraft.sounds.SoundEvent openSound, @Nullable net.minecraft.sounds.SoundEvent ambientSound, @Nullable net.minecraft.sounds.SoundEvent closeSound, int ambientTicks, float volume, @Nullable ParticleSpec particles, float particleRate, float shake) extends Record
What a rift looks and sounds like: a tear in the air that opens, hangs there, and closes. See WorldRifts.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final RiftSpec
    A violet rift two blocks wide and four tall, with vanilla's portal sounds.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RiftSpec(float width, float height, int color, int openTicks, int closeTicks, @Nullable net.minecraft.sounds.SoundEvent openSound, @Nullable net.minecraft.sounds.SoundEvent ambientSound, @Nullable net.minecraft.sounds.SoundEvent closeSound, int ambientTicks, float volume, @Nullable ParticleSpec particles, float particleRate, float shake)
    Creates an instance of a RiftSpec record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minecraft.sounds.SoundEvent
    Returns the value of the ambientSound record component.
    int
    Returns the value of the ambientTicks record component.
     
    @Nullable net.minecraft.sounds.SoundEvent
    Returns the value of the closeSound record component.
    int
    Returns the value of the closeTicks record component.
    int
    Returns the value of the color record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the height record component.
    @Nullable net.minecraft.sounds.SoundEvent
    Returns the value of the openSound record component.
    int
    Returns the value of the openTicks record component.
    float
    Returns the value of the particleRate record component.
    @Nullable ParticleSpec
    Returns the value of the particles record component.
    float
    Returns the value of the shake record component.
    final String
    Returns a string representation of this record class.
    float
    Returns the value of the volume record component.
    float
    Returns the value of the width record component.

    Methods inherited from class Object

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

    • DEFAULT

      public static final RiftSpec DEFAULT
      A violet rift two blocks wide and four tall, with vanilla's portal sounds.
  • Constructor Details

    • RiftSpec

      public RiftSpec(float width, float height, int color, int openTicks, int closeTicks, @Nullable net.minecraft.sounds.SoundEvent openSound, @Nullable net.minecraft.sounds.SoundEvent ambientSound, @Nullable net.minecraft.sounds.SoundEvent closeSound, int ambientTicks, float volume, @Nullable ParticleSpec particles, float particleRate, float shake)
      Creates an instance of a RiftSpec record class.
      Parameters:
      width - the value for the width record component
      height - the value for the height record component
      color - the value for the color record component
      openTicks - the value for the openTicks record component
      closeTicks - the value for the closeTicks record component
      openSound - the value for the openSound record component
      ambientSound - the value for the ambientSound record component
      closeSound - the value for the closeSound record component
      ambientTicks - the value for the ambientTicks record component
      volume - the value for the volume record component
      particles - the value for the particles record component
      particleRate - the value for the particleRate record component
      shake - the value for the shake record component
  • Method Details

    • builder

      public static RiftSpec.Builder builder()
    • 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.
    • width

      public float width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public float height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • color

      public int color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • openTicks

      public int openTicks()
      Returns the value of the openTicks record component.
      Returns:
      the value of the openTicks record component
    • closeTicks

      public int closeTicks()
      Returns the value of the closeTicks record component.
      Returns:
      the value of the closeTicks record component
    • openSound

      public @Nullable net.minecraft.sounds.SoundEvent openSound()
      Returns the value of the openSound record component.
      Returns:
      the value of the openSound record component
    • ambientSound

      public @Nullable net.minecraft.sounds.SoundEvent ambientSound()
      Returns the value of the ambientSound record component.
      Returns:
      the value of the ambientSound record component
    • closeSound

      public @Nullable net.minecraft.sounds.SoundEvent closeSound()
      Returns the value of the closeSound record component.
      Returns:
      the value of the closeSound record component
    • ambientTicks

      public int ambientTicks()
      Returns the value of the ambientTicks record component.
      Returns:
      the value of the ambientTicks record component
    • volume

      public float volume()
      Returns the value of the volume record component.
      Returns:
      the value of the volume record component
    • particles

      public @Nullable ParticleSpec particles()
      Returns the value of the particles record component.
      Returns:
      the value of the particles record component
    • particleRate

      public float particleRate()
      Returns the value of the particleRate record component.
      Returns:
      the value of the particleRate record component
    • shake

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