package top.r3944realms.lib39.core.network;

import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
import top.r3944realms.lib39.core.network.toClient.SyncNBTLookupDataEntityS2CPayload;

/**
 * The type Fabric network handler.
 */
public class FabricNetworkHandler {

    /**
     * 注册客户端接收的数据包
     */
    public static void registerClientReceivers() {
        PayloadTypeRegistry.playS2C().register(
                SyncNBTLookupDataEntityS2CPayload.TYPE,
                SyncNBTLookupDataEntityS2CPayload.STREAM_CODEC
        );
        ClientPlayNetworking.registerGlobalReceiver(
                SyncNBTLookupDataEntityS2CPayload.TYPE,
                SyncNBTLookupDataEntityS2CPayload::handle
        );
    }
}
