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

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf,ScreenShakePacket>
     
    static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<ScreenShakePacket>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ScreenShakePacket(float intensity, int duration, int falloffStart, net.minecraft.world.phys.Vec3 pos, float maxDistance, int ticks)
    Creates an instance of a ScreenShakePacket record class.
    ScreenShakePacket(net.minecraft.network.FriendlyByteBuf buf)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the duration record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the falloffStart record component.
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the intensity record component.
    float
    Returns the value of the maxDistance record component.
    net.minecraft.world.phys.Vec3
    pos()
    Returns the value of the pos record component.
    int
    Returns the value of the ticks record component.
    final String
    Returns a string representation of this record class.
    @NotNull net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<?>
     
    void
    write(net.minecraft.network.FriendlyByteBuf buf)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a ScreenShakePacket record class.
      Parameters:
      intensity - the value for the intensity record component
      duration - the value for the duration record component
      falloffStart - the value for the falloffStart record component
      pos - the value for the pos record component
      maxDistance - the value for the maxDistance record component
      ticks - the value for the ticks record 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:
      type in interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • intensity

      public float intensity()
      Returns the value of the intensity record component.
      Returns:
      the value of the intensity record component
    • duration

      public int duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • falloffStart

      public int falloffStart()
      Returns the value of the falloffStart record component.
      Returns:
      the value of the falloffStart record component
    • pos

      public net.minecraft.world.phys.Vec3 pos()
      Returns the value of the pos record component.
      Returns:
      the value of the pos record component
    • maxDistance

      public float maxDistance()
      Returns the value of the maxDistance record component.
      Returns:
      the value of the maxDistance record component
    • ticks

      public int ticks()
      Returns the value of the ticks record component.
      Returns:
      the value of the ticks record component