Record Class SetSoundDataPayload
java.lang.Object
java.lang.Record
com.mrbysco.soundmimicry.networking.SetSoundDataPayload
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
public record SetSoundDataPayload(net.minecraft.core.BlockPos pos, net.minecraft.resources.ResourceLocation dimension, String soundLocation, String soundSource, String offset, String volume, String pitch, String minVolume)
extends Record
implements net.minecraft.network.protocol.common.custom.CustomPacketPayload
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B extends net.minecraft.network.FriendlyByteBuf>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B extends net.minecraft.network.FriendlyByteBuf,T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf, SetSoundDataPayload> static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<SetSoundDataPayload> -
Constructor Summary
ConstructorsConstructorDescriptionSetSoundDataPayload(net.minecraft.core.BlockPos pos, net.minecraft.resources.ResourceLocation dimension, String soundLocation, String soundSource, String offset, String volume, String pitch, String minVolume) Creates an instance of aSetSoundDataPayloadrecord class.SetSoundDataPayload(net.minecraft.network.FriendlyByteBuf packetBuffer) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocationReturns the value of thedimensionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theminVolumerecord component.offset()Returns the value of theoffsetrecord component.pitch()Returns the value of thepitchrecord component.net.minecraft.core.BlockPospos()Returns the value of theposrecord component.Returns the value of thesoundLocationrecord component.Returns the value of thesoundSourcerecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type()volume()Returns the value of thevolumerecord component.voidwrite(net.minecraft.network.FriendlyByteBuf buf)
-
Field Details
-
CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf,SetSoundDataPayload> CODEC -
ID
public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<SetSoundDataPayload> ID
-
-
Constructor Details
-
SetSoundDataPayload
public SetSoundDataPayload(net.minecraft.network.FriendlyByteBuf packetBuffer) -
SetSoundDataPayload
public SetSoundDataPayload(net.minecraft.core.BlockPos pos, net.minecraft.resources.ResourceLocation dimension, String soundLocation, String soundSource, String offset, String volume, String pitch, String minVolume) Creates an instance of aSetSoundDataPayloadrecord class.- Parameters:
pos- the value for theposrecord componentdimension- the value for thedimensionrecord componentsoundLocation- the value for thesoundLocationrecord componentsoundSource- the value for thesoundSourcerecord componentoffset- the value for theoffsetrecord componentvolume- the value for thevolumerecord componentpitch- the value for thepitchrecord componentminVolume- the value for theminVolumerecord component
-
-
Method Details
-
write
public void write(net.minecraft.network.FriendlyByteBuf buf) -
type
public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type()- Specified by:
typein interfacenet.minecraft.network.protocol.common.custom.CustomPacketPayload
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
pos
public net.minecraft.core.BlockPos pos()Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
dimension
public net.minecraft.resources.ResourceLocation dimension()Returns the value of thedimensionrecord component.- Returns:
- the value of the
dimensionrecord component
-
soundLocation
Returns the value of thesoundLocationrecord component.- Returns:
- the value of the
soundLocationrecord component
-
soundSource
Returns the value of thesoundSourcerecord component.- Returns:
- the value of the
soundSourcerecord component
-
offset
Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
volume
Returns the value of thevolumerecord component.- Returns:
- the value of the
volumerecord component
-
pitch
Returns the value of thepitchrecord component.- Returns:
- the value of the
pitchrecord component
-
minVolume
Returns the value of theminVolumerecord component.- Returns:
- the value of the
minVolumerecord component
-