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
ConstructorDescriptionPlaybackConfig
(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 aPlaybackConfig
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the value of theattenuationDistance
record component.static PlaybackConfig
defaultUI
(float volume, float pitch, int offsetTicks) static PlaybackConfig
defaultUIMusic
(float volume, float pitch, int offsetTicks) static PlaybackConfig
defaultWorld
(float volume, float pitch, net.minecraft.world.phys.Vec3 pos, int attenuationDistance, boolean relative, int offsetTicks) static PlaybackConfig
defaultWorldMusic
(float volume, float pitch, net.minecraft.world.phys.Vec3 pos, int attenuationDistance, boolean relative, int offsetTicks) static PlaybackConfig
deserializeNbt
(net.minecraft.nbt.CompoundTag nbt) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of theoffsetTicks
record component.float
pitch()
Returns the value of thepitch
record component.net.minecraft.world.phys.Vec3
pos()
Returns the value of thepos
record component.boolean
relative()
Returns the value of therelative
record component.net.minecraft.nbt.CompoundTag
boolean
Returns the value of theshowNowPlayingText
record component.Returns the value of thesoundSourceName
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.float
volume()
Returns the value of thevolume
record component.
-
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 aPlaybackConfig
record class.- Parameters:
type
- the value for thetype
record componentsoundSourceName
- the value for thesoundSourceName
record componentvolume
- the value for thevolume
record componentpitch
- the value for thepitch
record componentpos
- the value for thepos
record componentattenuationDistance
- the value for theattenuationDistance
record componentrelative
- the value for therelative
record componentoffsetTicks
- the value for theoffsetTicks
record componentshowNowPlayingText
- the value for theshowNowPlayingText
record component
-
-
Method Details
-
defaultUI
-
defaultWorld
public static PlaybackConfig defaultWorld(float volume, float pitch, net.minecraft.world.phys.Vec3 pos, int attenuationDistance, boolean relative, int offsetTicks) -
defaultUIMusic
-
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
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
soundSourceName
Returns the value of thesoundSourceName
record component.- Returns:
- the value of the
soundSourceName
record component
-
volume
public float volume()Returns the value of thevolume
record component.- Returns:
- the value of the
volume
record component
-
pitch
public float pitch()Returns the value of thepitch
record component.- Returns:
- the value of the
pitch
record component
-
pos
public net.minecraft.world.phys.Vec3 pos()Returns the value of thepos
record component.- Returns:
- the value of the
pos
record component
-
attenuationDistance
public int attenuationDistance()Returns the value of theattenuationDistance
record component.- Returns:
- the value of the
attenuationDistance
record component
-
relative
public boolean relative()Returns the value of therelative
record component.- Returns:
- the value of the
relative
record component
-
offsetTicks
public int offsetTicks()Returns the value of theoffsetTicks
record component.- Returns:
- the value of the
offsetTicks
record component
-
showNowPlayingText
public boolean showNowPlayingText()Returns the value of theshowNowPlayingText
record component.- Returns:
- the value of the
showNowPlayingText
record component
-