Record Class SoundContext
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.sound.SoundContext
- Record Components:
position- where it plays: a place in the world, or, for a soundrelativeto the listener, its offset from themsound- the sound event it plays (asminecraft:entity.zombie.ambient), or null if not known yetsource- its sound category, the one its volume slider is forrelative- whether it plays relative to the listener (music, the menus, a few of the game's own) instead of at a place in the world
public record SoundContext(net.minecraft.world.phys.Vec3 position, @Nullable net.minecraft.resources.Identifier sound, net.minecraft.sounds.SoundSource source, boolean relative)
extends Record
A sound a
SoundFilterProvider is asked about.-
Constructor Summary
ConstructorsConstructorDescriptionSoundContext(net.minecraft.world.phys.Vec3 position, @Nullable net.minecraft.resources.Identifier sound, net.minecraft.sounds.SoundSource source, boolean relative) Creates an instance of aSoundContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleaninWorld()Whether it plays at a place in the world.net.minecraft.world.phys.Vec3position()Returns the value of thepositionrecord component.booleanrelative()Returns the value of therelativerecord component.@Nullable net.minecraft.resources.Identifiersound()Returns the value of thesoundrecord component.net.minecraft.sounds.SoundSourcesource()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SoundContext
public SoundContext(net.minecraft.world.phys.Vec3 position, @Nullable net.minecraft.resources.Identifier sound, net.minecraft.sounds.SoundSource source, boolean relative) Creates an instance of aSoundContextrecord class.
-
-
Method Details
-
inWorld
public boolean inWorld()Whether it plays at a place in the world. -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
position
-
sound
-
source
-
relative
-