Record Class S2CRadarsPacket

java.lang.Object
java.lang.Record
net.nullved.pmweatherapi.network.S2CRadarsPacket
Record Components:
tag - The CompoundTag to send
All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload

public record S2CRadarsPacket(net.minecraft.nbt.CompoundTag tag) extends Record implements net.minecraft.network.protocol.common.custom.CustomPacketPayload
A packet for sending radar information from Server -> Client (S2C)
Since:
0.14.15.3
  • 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.RegistryFriendlyByteBuf,S2CRadarsPacket>
     
    static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<S2CRadarsPacket>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    S2CRadarsPacket(net.minecraft.nbt.CompoundTag tag)
    Creates an instance of a S2CRadarsPacket record class.
    S2CRadarsPacket(net.minecraft.network.RegistryFriendlyByteBuf buf)
    Creates a new S2CRadarsPacket from a RegistryFriendlyByteBuf
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    void
    handle(net.minecraft.world.entity.player.Player player)
    Handles the packet on the CLIENT SIDE
    final int
    Returns a hash code value for this object.
    net.minecraft.nbt.CompoundTag
    tag()
    Returns the value of the tag record component.
    final String
    Returns a string representation of this record class.
    net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>
    Gets the packet type
    void
    write(net.minecraft.network.FriendlyByteBuf buf)
    Writes the data into the given FriendlyByteBuf

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload

    toVanillaClientbound, toVanillaServerbound
  • Field Details

    • TYPE

      public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<S2CRadarsPacket> TYPE
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,S2CRadarsPacket> STREAM_CODEC
  • Constructor Details

    • S2CRadarsPacket

      public S2CRadarsPacket(net.minecraft.network.RegistryFriendlyByteBuf buf)
      Creates a new S2CRadarsPacket from a RegistryFriendlyByteBuf
      Parameters:
      buf - The RegistryFriendlyByteBuf to read a CompoundTag from
      Since:
      0.14.15.3
    • S2CRadarsPacket

      public S2CRadarsPacket(net.minecraft.nbt.CompoundTag tag)
      Creates an instance of a S2CRadarsPacket record class.
      Parameters:
      tag - the value for the tag record component
  • Method Details

    • write

      public void write(net.minecraft.network.FriendlyByteBuf buf)
      Writes the data into the given FriendlyByteBuf
      Parameters:
      buf - The FriendlyByteBuf to write into
      Since:
      0.14.15.3
    • handle

      public void handle(net.minecraft.world.entity.player.Player player)
      Handles the packet on the CLIENT SIDE
      Parameters:
      player - The player the packet was sent to
      Since:
      0.14.15.3
    • type

      public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type()
      Gets the packet type
      Specified by:
      type in interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
      Returns:
      The packet type
      Since:
      0.14.15.3
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • tag

      public net.minecraft.nbt.CompoundTag tag()
      Returns the value of the tag record component.
      Returns:
      the value of the tag record component