Class PMWNetworking

java.lang.Object
net.nullved.pmweatherapi.network.PMWNetworking

public class PMWNetworking extends Object
The base networking class for PMWeatherAPI
Since:
0.14.15.3
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.ResourceLocation
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    register(Object... args)
    Registers all of PMWeatherAPI's packets.
    static <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload, B extends net.minecraft.network.FriendlyByteBuf>
    void
    registerClientboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec, BiConsumer<T,net.minecraft.world.entity.player.Player> handler, Object... args)
    Registers a clientbound packet payload
    static <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>
    void
    registerServerboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec, BiConsumer<T,net.minecraft.world.entity.player.Player> handler, Object... args)
    Registers a serverbound packet payload
    static void
    serverSendRadarsToAll(net.minecraft.nbt.CompoundTag tag)
    Sends all radars to all clients
    static void
    serverSendRadarsToPlayer(net.minecraft.nbt.CompoundTag tag, net.minecraft.world.entity.player.Player player)
    Sends all radars to a specific player

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • RADARS_ID

      public static final net.minecraft.resources.ResourceLocation RADARS_ID
  • Constructor Details

    • PMWNetworking

      public PMWNetworking()
  • Method Details

    • register

      public static void register(Object... args)
      Registers all of PMWeatherAPI's packets. Should not be called
      Parameters:
      args - The arguments to pass
      Since:
      0.14.15.3
    • registerServerboundPacket

      public static <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> void registerServerboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec, BiConsumer<T,net.minecraft.world.entity.player.Player> handler, Object... args)
      Registers a serverbound packet payload
      Type Parameters:
      T - A packet extending CustomPacketPayload
      Parameters:
      type - The CustomPacketPayload.Type of the packet
      codec - The StreamCodec for the packet
      handler - The handle method for the packet
      args - Additional arguments. args[0] should be the PayloadRegistrar
      Since:
      0.14.15.3
    • registerClientboundPacket

      public static <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload, B extends net.minecraft.network.FriendlyByteBuf> void registerClientboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec, BiConsumer<T,net.minecraft.world.entity.player.Player> handler, Object... args)
      Registers a clientbound packet payload
      Type Parameters:
      T - A packet extending CustomPacketPayload
      Parameters:
      type - The CustomPacketPayload.Type of the packet
      codec - The StreamCodec for the packet
      handler - The handle method for the packet
      args - Additional arguments. args[0] should be the PayloadRegistrar
      Since:
      0.14.15.3
    • serverSendRadarsToAll

      public static void serverSendRadarsToAll(net.minecraft.nbt.CompoundTag tag)
      Sends all radars to all clients
      Parameters:
      tag - The tag to send, generated by the RadarServerStorage
      Since:
      0.14.15.3
    • serverSendRadarsToPlayer

      public static void serverSendRadarsToPlayer(net.minecraft.nbt.CompoundTag tag, net.minecraft.world.entity.player.Player player)
      Sends all radars to a specific player
      Parameters:
      tag - The tag to send, generated by the RadarServerStorage
      Since:
      0.14.15.3