You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Packet handler is no longer passed a Supplier<NetworkEvent.Context> it is passed the NetworkEvent.Context directly.
publicstaticvoidhandle(MyMessagemsg, Supplier<NetworkEvent.Context> ctx) {
ctx.get().enqueueWork(() -> {
// Work that needs to be thread-safe (most work)ServerPlayersender = ctx.get().getSender(); // the client that sent this packet// Do stuff
});
ctx.get().setPacketHandled(true);
}
becomes
publicstaticvoidhandle(MyMessagemsg, NetworkEvent.Contextctx) {
ctx.enqueueWork(() -> {
// Work that needs to be thread-safe (most work)ServerPlayersender = ctx.getSender(); // the client that sent this packet// Do stuff
});
ctx.setPacketHandled(true);
}
Unsure if anything else there needs updating.
The text was updated successfully, but these errors were encountered:
Packet handler is no longer passed a
Supplier<NetworkEvent.Context>
it is passed theNetworkEvent.Context
directly.becomes
Unsure if anything else there needs updating.
The text was updated successfully, but these errors were encountered: