package net.minecraft.world.entity.npc;

import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.level.Level;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.trading.MerchantOffer;
import javax.annotation.Nullable;
import net.minecraft.world.item.trading.MerchantOffers;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.MerchantContainer;
import net.minecraft.world.item.trading.Merchant;

public class ClientSideMerchant implements Merchant {
    private final MerchantContainer container;
    private final Player source;
    private MerchantOffers offers;
    private int xp;
    
    public ClientSideMerchant(final Player bec) {
        this.offers = new MerchantOffers();
        this.source = bec;
        this.container = new MerchantContainer(this);
    }
    
    @Nullable
    @Override
    public Player getTradingPlayer() {
        return this.source;
    }
    
    @Override
    public void setTradingPlayer(@Nullable final Player bec) {
    }
    
    @Override
    public MerchantOffers getOffers() {
        return this.offers;
    }
    
    @Override
    public void overrideOffers(@Nullable final MerchantOffers bpa) {
        this.offers = bpa;
    }
    
    @Override
    public void notifyTrade(final MerchantOffer boz) {
        boz.increaseUses();
    }
    
    @Override
    public void notifyTradeUpdated(final ItemStack bki) {
    }
    
    @Override
    public Level getLevel() {
        return this.source.level;
    }
    
    @Override
    public int getVillagerXp() {
        return this.xp;
    }
    
    @Override
    public void overrideXp(final int integer) {
        this.xp = integer;
    }
    
    @Override
    public boolean showProgressBar() {
        return true;
    }
    
    @Override
    public SoundEvent getNotifyTradeSound() {
        return SoundEvents.VILLAGER_YES;
    }
}
