Class ScreenNetworkingImpl

java.lang.Object
io.github.cottonmc.cotton.gui.impl.ScreenNetworkingImpl
All Implemented Interfaces:
ScreenNetworking

public class ScreenNetworkingImpl extends Object implements ScreenNetworking
  • Field Details

    • SCREEN_MESSAGE_S2C

      public static final net.minecraft.util.Identifier SCREEN_MESSAGE_S2C
    • SCREEN_MESSAGE_C2S

      public static final net.minecraft.util.Identifier SCREEN_MESSAGE_C2S
  • Method Details

    • receive

      public void receive(net.minecraft.util.Identifier message, ScreenNetworking.MessageReceiver receiver)
      Description copied from interface: ScreenNetworking
      Registers a message receiver for the message.
      Specified by:
      receive in interface ScreenNetworking
      Parameters:
      message - the screen message ID
      receiver - the message receiver
    • send

      public void send(net.minecraft.util.Identifier message, Consumer<net.minecraft.network.PacketByteBuf> writer)
      Description copied from interface: ScreenNetworking
      Sends a screen message to the other side of the connection.
      Specified by:
      send in interface ScreenNetworking
      Parameters:
      message - the screen message ID
      writer - a writer that writes the message contents to a packet buffer; should not read the buffer
    • init

      public static void init()
    • handle

      public static void handle(Executor executor, net.minecraft.entity.player.PlayerEntity player, net.minecraft.network.PacketByteBuf buf)
    • of

      public static ScreenNetworking of(SyncedGuiDescription description, NetworkSide networkSide)
      Description copied from interface: ScreenNetworking
      Gets a networking handler for the GUI description that is active on the specified side.
      Parameters:
      description - the GUI description
      networkSide - the network side
      Returns:
      the network handler