Class ScreenNetworkingImpl
java.lang.Object
io.github.cottonmc.cotton.gui.impl.ScreenNetworkingImpl
- All Implemented Interfaces:
ScreenNetworking
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.cottonmc.cotton.gui.networking.ScreenNetworking
ScreenNetworking.MessageReceiver -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic net.minecraft.util.Identifierstatic net.minecraft.util.Identifier -
Method Summary
Modifier and TypeMethodDescriptionstatic voidhandle(Executor executor, net.minecraft.entity.player.PlayerEntity player, net.minecraft.network.PacketByteBuf buf)static voidinit()static ScreenNetworkingof(SyncedGuiDescription description, NetworkSide networkSide)Gets a networking handler for the GUI description that is active on the specified side.voidreceive(net.minecraft.util.Identifier message, ScreenNetworking.MessageReceiver receiver)Registers a message receiver for the message.voidSends a screen message to the other side of the connection.
-
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:ScreenNetworkingRegisters a message receiver for the message.- Specified by:
receivein interfaceScreenNetworking- Parameters:
message- the screen message IDreceiver- the message receiver
-
send
public void send(net.minecraft.util.Identifier message, Consumer<net.minecraft.network.PacketByteBuf> writer)Description copied from interface:ScreenNetworkingSends a screen message to the other side of the connection.- Specified by:
sendin interfaceScreenNetworking- Parameters:
message- the screen message IDwriter- 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
Description copied from interface:ScreenNetworkingGets a networking handler for the GUI description that is active on the specified side.- Parameters:
description- the GUI descriptionnetworkSide- the network side- Returns:
- the network handler
-