package aeronicamc.mods.mxtune.mixins;

import aeronicamc.mods.mxtune.sound.ClientAudio;
import net.minecraft.client.resources.sounds.Sound;
import net.minecraft.client.resources.sounds.SoundInstance;
import net.minecraft.client.sounds.ChannelAccess;
import net.minecraft.client.sounds.SoundEngine;
import net.minecraft.client.sounds.WeighedSoundEvents;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.phys.Vec3;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;

import java.util.concurrent.CompletableFuture;

@Mixin(SoundEngine.class)
public class MixinSoundEngine
{
    /**
     * Our injection point that occurs right after the {@link ChannelAccess.ChannelHandle} has been initialized
     * @param soundInstance                    {@link SoundInstance}
     * @param ci                        ignored
     * @param weighedSoundEvents        {@link WeighedSoundEvents}
     * @param resourcelocation          {@link ResourceLocation}
     * @param sound                     {@link Sound}
     * @param f                         volume
     * @param f1                        attenuated volume
     * @param soundSource             {@link SoundSource}
     * @param f2                        ISound volume clamped(0.0F, 1.0F)
     * @param f3                        ISound pitch clamped(0.5F, 2.0F)
     * @param attenuation    ISound$AttenuationType {@link SoundInstance.Attenuation}
     * @param flag                      ISound boolean isRelative
     * @param vector3d                  ISound sound location vector
     * @param flag2                     ISound boolean shouldLoop
     * @param flag3                     iSound boolean shouldStream
     * @param completablefuture         CompletableFuture<ChannelAccess.ChannelHandle>
     * @param channelHandle      {@link ChannelAccess.ChannelHandle}
     */
    @Inject(method = "play(Lnet/net/minecraft/client/resources/sounds/SoundInstance;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/sounds/ChannelAccess$ChannelHandle;execute(Ljava/util/function/Consumer;)V", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILEXCEPTION)
    public void onPlaySound(SoundInstance soundInstance, CallbackInfo ci, WeighedSoundEvents weighedSoundEvents, ResourceLocation resourcelocation, Sound sound, float f, float f1, SoundSource soundSource, float f2, float f3, SoundInstance.Attenuation attenuation, boolean flag, Vec3 vector3d, boolean flag2, boolean flag3, CompletableFuture completablefuture, ChannelAccess.ChannelHandle channelHandle)
    {
        ClientAudio.submitStream(soundInstance, flag3, channelHandle);
    }
}

@@ -2146,20 +2146,16 @@
 ay(Lnet/
-net/
 minecraf

Correct SoundInstance package