package com.zivilon.cinder_loe.world.sounds;

import net.minecraft.client.audio.ISound;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.ResourceLocation;

public class MobileSoundHandler implements ISound {
    private final EntityPlayer player;
    private final ResourceLocation soundLocation;

    public MobileSoundHandler(EntityPlayer player, String soundName) {
        this.player = player;
        this.soundLocation = new ResourceLocation("cinder_loe", soundName);
    }

    @Override
    public ResourceLocation getPositionedSoundLocation() {
        return this.soundLocation;
    }

    @Override
    public float getVolume() {
        return 1.0F;
    }

    @Override
    public float getPitch() {
        return 1.0F;
    }


    @Override
    public float getXPosF() {
        return (float) player.posX;
    }
    @Override
    public float getYPosF() {
        return (float) player.posY;
    }

    @Override
    public float getZPosF() {
        return (float) player.posZ;
    }

    @Override
    public boolean canRepeat() {
        return true;
    }

    @Override
    public int getRepeatDelay() {
        return 0;
    }

    @Override
    public ISound.AttenuationType getAttenuationType() {
        return ISound.AttenuationType.LINEAR;
    }
}
