Record Class ScreenShakePacket
java.lang.Object
java.lang.Record
net.frozenblock.lib.screenshake.impl.network.ScreenShakePacket
- All Implemented Interfaces:
net.fabricmc.fabric.api.networking.v1.FabricPacket
public record ScreenShakePacket(float intensity, int duration, int falloffStart, double x, double y, double z, float maxDistance, int ticks)
extends Record
implements net.fabricmc.fabric.api.networking.v1.FabricPacket
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.fabricmc.fabric.api.networking.v1.PacketType<ScreenShakePacket> -
Constructor Summary
ConstructorsConstructorDescriptionScreenShakePacket(float intensity, int duration, int falloffStart, double x, double y, double z, 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.net.fabricmc.fabric.api.networking.v1.PacketType<?> getType()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.voidwrite(net.minecraft.network.FriendlyByteBuf buf) doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.doublez()Returns the value of thezrecord component.
-
Field Details
-
PACKET_TYPE
-
-
Constructor Details
-
ScreenShakePacket
public ScreenShakePacket(net.minecraft.network.FriendlyByteBuf buf) -
ScreenShakePacket
public ScreenShakePacket(float intensity, int duration, int falloffStart, double x, double y, double z, 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 componentx- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componentmaxDistance- the value for themaxDistancerecord componentticks- the value for theticksrecord component
-
-
Method Details
-
write
public void write(net.minecraft.network.FriendlyByteBuf buf) - Specified by:
writein interfacenet.fabricmc.fabric.api.networking.v1.FabricPacket
-
getType
public net.fabricmc.fabric.api.networking.v1.PacketType<?> getType()- Specified by:
getTypein interfacenet.fabricmc.fabric.api.networking.v1.FabricPacket
-
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 '=='. -
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
-
x
public double x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public double y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public double z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord 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
-