public class ScreenNetworkingImpl extends java.lang.Object implements ScreenNetworking
ScreenNetworking.MessageReceiver| Modifier and Type | Field and Description |
|---|---|
static net.minecraft.util.Identifier |
SCREEN_MESSAGE_C2S |
static net.minecraft.util.Identifier |
SCREEN_MESSAGE_S2C |
| Modifier and Type | Method and Description |
|---|---|
static void |
handle(java.util.concurrent.Executor executor,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.network.PacketByteBuf buf) |
static void |
init() |
static ScreenNetworking |
of(SyncedGuiDescription description,
NetworkSide networkSide)
Gets a networking handler for the GUI description that is active on the specified side.
|
void |
receive(net.minecraft.util.Identifier message,
ScreenNetworking.MessageReceiver receiver)
Registers a message receiver for the message.
|
void |
send(net.minecraft.util.Identifier message,
java.util.function.Consumer<net.minecraft.network.PacketByteBuf> writer)
Sends a screen message to the other side of the connection.
|
public static final net.minecraft.util.Identifier SCREEN_MESSAGE_S2C
public static final net.minecraft.util.Identifier SCREEN_MESSAGE_C2S
public void receive(net.minecraft.util.Identifier message,
ScreenNetworking.MessageReceiver receiver)
ScreenNetworkingreceive in interface ScreenNetworkingmessage - the screen message IDreceiver - the message receiverpublic void send(net.minecraft.util.Identifier message,
java.util.function.Consumer<net.minecraft.network.PacketByteBuf> writer)
ScreenNetworkingsend in interface ScreenNetworkingmessage - the screen message IDwriter - a writer that writes the message contents to a packet buffer;
should not read the bufferpublic static void init()
public static void handle(java.util.concurrent.Executor executor,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.network.PacketByteBuf buf)
public static ScreenNetworking of(SyncedGuiDescription description, NetworkSide networkSide)
ScreenNetworkingof in interface ScreenNetworkingdescription - the GUI descriptionnetworkSide - the network side