Record Class PortalSoundManager.SoundConfiguration<T>
java.lang.Object
java.lang.Record
tech.anonymoushacker1279.openportals.portal.config.PortalSoundManager.SoundConfiguration<T>
- Type Parameters:
T- the type of context object (Entity or Level)- Record Components:
soundIdentifier- the identifier of the sound to playvolumeFunction- function to determine the volumepitchFunction- function to determine the pitch
- Enclosing class:
PortalSoundManager
-
Constructor Summary
Constructors -
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.Returns the value of thepitchFunctionrecord component.static <T> PortalSoundManager.SoundConfiguration<T> silent()Create a default sound configuration with no sound.@Nullable net.minecraft.resources.IdentifierReturns the value of thesoundIdentifierrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevolumeFunctionrecord component.
-
Constructor Details
-
SoundConfiguration
public SoundConfiguration(@Nullable @Nullable net.minecraft.resources.Identifier soundIdentifier, Function<T, Float> volumeFunction, Function<T, Float> pitchFunction) Creates an instance of aSoundConfigurationrecord class.- Parameters:
soundIdentifier- the value for thesoundIdentifierrecord componentvolumeFunction- the value for thevolumeFunctionrecord componentpitchFunction- the value for thepitchFunctionrecord component
-
-
Method Details
-
silent
Create a default sound configuration with no sound. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
soundIdentifier
@Nullable public @Nullable net.minecraft.resources.Identifier soundIdentifier()Returns the value of thesoundIdentifierrecord component.- Returns:
- the value of the
soundIdentifierrecord component
-
volumeFunction
Returns the value of thevolumeFunctionrecord component.- Returns:
- the value of the
volumeFunctionrecord component
-
pitchFunction
Returns the value of thepitchFunctionrecord component.- Returns:
- the value of the
pitchFunctionrecord component
-