Record Class PlaybackConfig

java.lang.Object
java.lang.Record
de.mrjulsen.dragnsounds.core.data.PlaybackConfig

public record PlaybackConfig(ESoundType type, String soundSourceName, float volume, float pitch, net.minecraft.world.phys.Vec3 pos, int attenuationDistance, boolean relative, int offsetTicks, boolean showNowPlayingText) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlaybackConfig(ESoundType type, String soundSourceName, float volume, float pitch, net.minecraft.world.phys.Vec3 pos, int attenuationDistance, boolean relative, int offsetTicks, boolean showNowPlayingText)
    Creates an instance of a PlaybackConfig record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the attenuationDistance record component.
    defaultUI(float volume, float pitch, int offsetTicks)
     
    defaultUIMusic(float volume, float pitch, int offsetTicks)
     
    defaultWorld(float volume, float pitch, net.minecraft.world.phys.Vec3 pos, int attenuationDistance, boolean relative, int offsetTicks)
     
    defaultWorldMusic(float volume, float pitch, net.minecraft.world.phys.Vec3 pos, int attenuationDistance, boolean relative, int offsetTicks)
     
    deserializeNbt(net.minecraft.nbt.CompoundTag nbt)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the offsetTicks record component.
    float
    Returns the value of the pitch record component.
    net.minecraft.world.phys.Vec3
    pos()
    Returns the value of the pos record component.
    boolean
    Returns the value of the relative record component.
    net.minecraft.nbt.CompoundTag
     
    boolean
    Returns the value of the showNowPlayingText record component.
    Returns the value of the soundSourceName record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the type record component.
    float
    Returns the value of the volume record component.

    Methods inherited from class java.lang.Object

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

    • PlaybackConfig

      public PlaybackConfig(ESoundType type, String soundSourceName, float volume, float pitch, net.minecraft.world.phys.Vec3 pos, int attenuationDistance, boolean relative, int offsetTicks, boolean showNowPlayingText)
      Creates an instance of a PlaybackConfig record class.
      Parameters:
      type - the value for the type record component
      soundSourceName - the value for the soundSourceName record component
      volume - the value for the volume record component
      pitch - the value for the pitch record component
      pos - the value for the pos record component
      attenuationDistance - the value for the attenuationDistance record component
      relative - the value for the relative record component
      offsetTicks - the value for the offsetTicks record component
      showNowPlayingText - the value for the showNowPlayingText record component
  • Method Details

    • defaultUI

      public static PlaybackConfig defaultUI(float volume, float pitch, int offsetTicks)
    • defaultWorld

      public static PlaybackConfig defaultWorld(float volume, float pitch, net.minecraft.world.phys.Vec3 pos, int attenuationDistance, boolean relative, int offsetTicks)
    • defaultUIMusic

      public static PlaybackConfig defaultUIMusic(float volume, float pitch, int offsetTicks)
    • defaultWorldMusic

      public static PlaybackConfig defaultWorldMusic(float volume, float pitch, net.minecraft.world.phys.Vec3 pos, int attenuationDistance, boolean relative, int offsetTicks)
    • serializeNbt

      public net.minecraft.nbt.CompoundTag serializeNbt()
    • deserializeNbt

      public static PlaybackConfig deserializeNbt(net.minecraft.nbt.CompoundTag nbt)
    • 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.
    • type

      public ESoundType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • soundSourceName

      public String soundSourceName()
      Returns the value of the soundSourceName record component.
      Returns:
      the value of the soundSourceName record component
    • volume

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

      public float pitch()
      Returns the value of the pitch record component.
      Returns:
      the value of the pitch record component
    • pos

      public net.minecraft.world.phys.Vec3 pos()
      Returns the value of the pos record component.
      Returns:
      the value of the pos record component
    • attenuationDistance

      public int attenuationDistance()
      Returns the value of the attenuationDistance record component.
      Returns:
      the value of the attenuationDistance record component
    • relative

      public boolean relative()
      Returns the value of the relative record component.
      Returns:
      the value of the relative record component
    • offsetTicks

      public int offsetTicks()
      Returns the value of the offsetTicks record component.
      Returns:
      the value of the offsetTicks record component
    • showNowPlayingText

      public boolean showNowPlayingText()
      Returns the value of the showNowPlayingText record component.
      Returns:
      the value of the showNowPlayingText record component