Class S2CStoragePacket<C extends IClientStorage<?>>

java.lang.Object
net.nullved.pmweatherapi.network.S2CStoragePacket<C>
Type Parameters:
C - The IClientStorage that will be synced to
All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
Direct Known Subclasses:
S2CMetarPacket, S2CRadarPacket, S2CWSRPacket

public abstract class S2CStoragePacket<C extends IClientStorage<?>> extends Object implements net.minecraft.network.protocol.common.custom.CustomPacketPayload
A base packet for the Storages system that syncs data from the Server -> Client (S2C)
Since:
0.15.3.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
    net.minecraft.nbt.CompoundTag
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    S2CStoragePacket(net.minecraft.nbt.CompoundTag tag)
     
    S2CStoragePacket(net.minecraft.network.RegistryFriendlyByteBuf buf)
    Creates a new S2CStoragePacket from a RegistryFriendlyByteBuf
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract C
    Gets the IClientStorage that will be synced to.
    void
    handle(net.minecraft.world.entity.player.Player player)
    Handles the packet on the CLIENT SIDE
    net.minecraft.nbt.CompoundTag
    tag()
    Gets the CompoundTag send with the packet
    void
    write(net.minecraft.network.FriendlyByteBuf buf)
    Writes the data into the given FriendlyByteBuf

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

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

    toVanillaClientbound, toVanillaServerbound, type
  • Field Details

    • tag

      public net.minecraft.nbt.CompoundTag tag
  • Constructor Details

    • S2CStoragePacket

      public S2CStoragePacket(net.minecraft.nbt.CompoundTag tag)
    • S2CStoragePacket

      public S2CStoragePacket(net.minecraft.network.RegistryFriendlyByteBuf buf)
      Creates a new S2CStoragePacket from a RegistryFriendlyByteBuf
      Parameters:
      buf - The RegistryFriendlyByteBuf to read a CompoundTag from
      Since:
      0.15.3.3
  • Method Details

    • getStorage

      public abstract C getStorage()
      Gets the IClientStorage that will be synced to.
      Returns:
      The storage to be synced.
      Since:
      0.15.3.3
    • tag

      public net.minecraft.nbt.CompoundTag tag()
      Gets the CompoundTag send with the packet
      Returns:
      The packet data
      Since:
      0.15.3.3
    • 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.15.3.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.15.3.3