Record Class ScreenShakePacket
java.lang.Object
java.lang.Record
net.frozenblock.lib.screenshake.impl.network.ScreenShakePacket
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
public record ScreenShakePacket(float intensity, int duration, int falloffStart, net.minecraft.world.phys.Vec3 pos, float maxDistance, int ticks)
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, ScreenShakePacket> static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<ScreenShakePacket> -
Constructor Summary
ConstructorsConstructorDescriptionScreenShakePacket(float intensity, int duration, int falloffStart, net.minecraft.world.phys.Vec3 pos, float maxDistance, int ticks) Creates an instance of aScreenShakePacketrecord class.ScreenShakePacket(net.minecraft.network.FriendlyByteBuf buf) -
Method Summary
Modifier and TypeMethodDescriptionintduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefalloffStartrecord component.final inthashCode()Returns a hash code value for this object.floatReturns the value of theintensityrecord component.floatReturns the value of themaxDistancerecord component.net.minecraft.world.phys.Vec3pos()Returns the value of theposrecord component.intticks()Returns the value of theticksrecord component.final StringtoString()Returns a string representation of this record class.@NotNull net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<?> type()voidwrite(net.minecraft.network.FriendlyByteBuf buf)
-
Field Details
-
PACKET_TYPE
public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<ScreenShakePacket> PACKET_TYPE -
CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf,ScreenShakePacket> CODEC
-
-
Constructor Details
-
ScreenShakePacket
public ScreenShakePacket(net.minecraft.network.FriendlyByteBuf buf) -
ScreenShakePacket
public ScreenShakePacket(float intensity, int duration, int falloffStart, net.minecraft.world.phys.Vec3 pos, float maxDistance, int ticks) Creates an instance of aScreenShakePacketrecord class.- Parameters:
intensity- the value for theintensityrecord componentduration- the value for thedurationrecord componentfalloffStart- the value for thefalloffStartrecord componentpos- the value for theposrecord componentmaxDistance- the value for themaxDistancerecord componentticks- the value for theticksrecord component
-
-
Method Details
-
write
public void write(net.minecraft.network.FriendlyByteBuf buf) -
type
@NotNull public @NotNull net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<?> 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
intensity
public float intensity()Returns the value of theintensityrecord component.- Returns:
- the value of the
intensityrecord component
-
duration
public int duration()Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
falloffStart
public int falloffStart()Returns the value of thefalloffStartrecord component.- Returns:
- the value of the
falloffStartrecord component
-
pos
public net.minecraft.world.phys.Vec3 pos()Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
maxDistance
public float maxDistance()Returns the value of themaxDistancerecord component.- Returns:
- the value of the
maxDistancerecord component
-
ticks
public int ticks()Returns the value of theticksrecord component.- Returns:
- the value of the
ticksrecord component
-