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 ze) {
        this.player = ze;
    }
    
    @Override
    protected void onCooldownStarted(final Item bke, final int integer) {
        super.onCooldownStarted(bke, integer);
        this.player.connection.send(new ClientboundCooldownPacket(bke, integer));
    }
    
    @Override
    protected void onCooldownEnded(final Item bke) {
        super.onCooldownEnded(bke);
        this.player.connection.send(new ClientboundCooldownPacket(bke, 0));
    }
}
