Interface IPacketRegistry


public interface IPacketRegistry
  • Method Summary

    Modifier and Type
    Method
    Description
    <P extends IForestryPacketClient>
    void
    clientbound(net.minecraft.resources.ResourceLocation id, Class<P> packetClass, Function<net.minecraft.network.FriendlyByteBuf,P> decoder, BiConsumer<P,net.minecraft.world.entity.player.Player> packetHandler)
    Register a packet during the play phase that is handled on the main render thread on the client.
    <P extends IForestryPacketServer>
    void
    serverbound(net.minecraft.resources.ResourceLocation id, Class<P> packetClass, Function<net.minecraft.network.FriendlyByteBuf,P> decoder, BiConsumer<P,net.minecraft.server.level.ServerPlayer> packetHandler)
    Register a packet during the play phase that is handled on the main server thread when the sender is not null.
  • Method Details

    • serverbound

      <P extends IForestryPacketServer> void serverbound(net.minecraft.resources.ResourceLocation id, Class<P> packetClass, Function<net.minecraft.network.FriendlyByteBuf,P> decoder, BiConsumer<P,net.minecraft.server.level.ServerPlayer> packetHandler)
      Register a packet during the play phase that is handled on the main server thread when the sender is not null.
    • clientbound

      <P extends IForestryPacketClient> void clientbound(net.minecraft.resources.ResourceLocation id, Class<P> packetClass, Function<net.minecraft.network.FriendlyByteBuf,P> decoder, BiConsumer<P,net.minecraft.world.entity.player.Player> packetHandler)
      Register a packet during the play phase that is handled on the main render thread on the client.