package net.minecraft.world.item;

import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientboundCooldownPacket;
import net.minecraft.server.level.ServerPlayer;

public class ServerItemCooldowns extends ItemCooldowns {
    private final ServerPlayer player;
    
    public ServerItemCooldowns(final ServerPlayer xe) {
        this.player = xe;
    }
    
    @Override
    protected void onCooldownStarted(final Item bei, final int integer) {
        super.onCooldownStarted(bei, integer);
        this.player.connection.send(new ClientboundCooldownPacket(bei, integer));
    }
    
    @Override
    protected void onCooldownEnded(final Item bei) {
        super.onCooldownEnded(bei);
        this.player.connection.send(new ClientboundCooldownPacket(bei, 0));
    }
}
