Packet handler is no longer passed a Supplier<NetworkEvent.Context> it is passed the NetworkEvent.Context directly.
public static void handle(MyMessage msg, Supplier<NetworkEvent.Context> ctx) {
ctx.get().enqueueWork(() -> {
// Work that needs to be thread-safe (most work)
ServerPlayer sender = ctx.get().getSender(); // the client that sent this packet
// Do stuff
});
ctx.get().setPacketHandled(true);
}
becomes
public static void handle(MyMessage msg, NetworkEvent.Context ctx) {
ctx.enqueueWork(() -> {
// Work that needs to be thread-safe (most work)
ServerPlayer sender = ctx.getSender(); // the client that sent this packet
// Do stuff
});
ctx.setPacketHandled(true);
}
Packet handler is no longer passed a
Supplier<NetworkEvent.Context>
it is passed theNetworkEvent.Context
directly.becomes
Unsure if anything else there needs updating.