It doesn't exist anymore, you have to make the methods manually, it looks a bit like this:
public class MyMessage {
int value;
public MyMessage(int value) {
this.value = value;
}
public static void encode(MyMessage msg, PacketBuffer buffer) {
buffer.writeInt(msg.value);
}
public static MyMessage decode(PacketBuffer buffer) {
return new MyMessage(buffer.readInt()); //Remember to read in the same oreder you wrote!
}
public static void handle(MyMessage msg, Supplier<NetworkEvent.Context> ctx) {
if (ctx.get().getDirection() == NetworkDirection.PLAY_TO_SERVER) { //Checks if the packet's direction is to the server
ctx.get().enqueueWork(() -> {
//Your code goes here
});
}
ctx.get().setPacketHandled(true);
}
}
I'm 99% sure that's correct, kinda freestyled it though. To send it use SimpleChannel#sendToServer, don't forget to register it with SimpleChannel#registerMessage, and don't worry if you don't understand it right away, it took me a while to fully understand packets in 1.15.