package top.r3944realms.lib39.example.core.network;

import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent;
import net.neoforged.neoforge.network.registration.PayloadRegistrar;
import top.r3944realms.lib39.Lib39;
import top.r3944realms.lib39.example.core.network.toServer.ClientDataPayload;

/**
 * The type Ex network handler.
 */
public class ExNetworkHandler {
    /**
     * Register.
     *
     * @param event the event
     */
    public static void register(RegisterPayloadHandlersEvent event) {
        PayloadRegistrar registrar = event.registrar(Lib39.ModInfo.VERSION);
        registrar.playToServer(
                ClientDataPayload.TYPE,
                ClientDataPayload.STREAM_CODEC,
                ClientDataPayload::handle
        );

    }
}