package net.minecraft.client.resources.sounds;

import net.minecraft.sounds.SoundSource;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.entity.Entity;

public class EntityBoundSoundInstance extends AbstractTickableSoundInstance {
    private final Entity entity;
    
    public EntityBoundSoundInstance(final SoundEvent aah, final SoundSource aaj, final Entity akq) {
        this(aah, aaj, 1.0f, 1.0f, akq);
    }
    
    public EntityBoundSoundInstance(final SoundEvent aah, final SoundSource aaj, final float float3, final float float4, final Entity akq) {
        super(aah, aaj);
        this.volume = float3;
        this.pitch = float4;
        this.entity = akq;
        this.x = (float)this.entity.getX();
        this.y = (float)this.entity.getY();
        this.z = (float)this.entity.getZ();
    }
    
    @Override
    public void tick() {
        if (this.entity.removed) {
            this.stopped = true;
            return;
        }
        this.x = (float)this.entity.getX();
        this.y = (float)this.entity.getY();
        this.z = (float)this.entity.getZ();
    }
}
