Record Class EntityScreenShakePacket
java.lang.Object
java.lang.Record
net.frozenblock.lib.screenshake.impl.network.EntityScreenShakePacket
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
public record EntityScreenShakePacket(int entityId, float intensity, int duration, int falloffStart, 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, EntityScreenShakePacket> static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<EntityScreenShakePacket> -
Constructor Summary
ConstructorsConstructorDescriptionEntityScreenShakePacket(int entityId, float intensity, int duration, int falloffStart, float maxDistance, int ticks) Creates an instance of aEntityScreenShakePacketrecord class.EntityScreenShakePacket(net.minecraft.network.FriendlyByteBuf buf) -
Method Summary
Modifier and TypeMethodDescriptionintduration()Returns the value of thedurationrecord component.intentityId()Returns the value of theentityIdrecord 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.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<EntityScreenShakePacket> PACKET_TYPE -
CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf,EntityScreenShakePacket> CODEC
-
-
Constructor Details
-
EntityScreenShakePacket
public EntityScreenShakePacket(net.minecraft.network.FriendlyByteBuf buf) -
EntityScreenShakePacket
public EntityScreenShakePacket(int entityId, float intensity, int duration, int falloffStart, float maxDistance, int ticks) Creates an instance of aEntityScreenShakePacketrecord class.- Parameters:
entityId- the value for theentityIdrecord componentintensity- the value for theintensityrecord componentduration- the value for thedurationrecord componentfalloffStart- the value for thefalloffStartrecord 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. All components in this record class are compared with '=='. -
entityId
public int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-
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
-
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
-