package me.km.networking;

import java.util.function.Supplier;
import me.km.Server;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.fml.network.NetworkEvent;

public class PlayerLeftClickEmpty {
    public static void writeBytes(PlayerLeftClickEmpty pd, PacketBuffer buf) {
    }

    public static PlayerLeftClickEmpty fromBytes(PacketBuffer buf) {
        return new PlayerLeftClickEmpty();
    }

    public static void handle(PlayerLeftClickEmpty pd, Supplier<NetworkEvent.Context> context) {
        context.get().enqueueWork(() -> {
            Server.scriptEvents.onEmptyLeftClick(context.get().getSender());
        });
        context.get().setPacketHandled(true);
    }
}
