/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  net.minecraft.class_243
 *  net.minecraft.class_2664
 *  org.spongepowered.asm.mixin.Final
 *  org.spongepowered.asm.mixin.Mixin
 *  org.spongepowered.asm.mixin.Mutable
 *  org.spongepowered.asm.mixin.Shadow
 */
package meteordevelopment.meteorclient.mixin;

import java.util.Optional;
import meteordevelopment.meteorclient.mixininterface.IExplosionS2CPacket;
import net.minecraft.class_243;
import net.minecraft.class_2664;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;

@Mixin(value={class_2664.class})
public abstract class ExplosionS2CPacketMixin
implements IExplosionS2CPacket {
    @Shadow
    @Final
    @Mutable
    private Optional<class_243> comp_2884;

    @Override
    public void meteor$setVelocityX(float velocity) {
        if (this.comp_2884.isPresent()) {
            class_243 kb = this.comp_2884.get();
            this.comp_2884 = Optional.of(new class_243((double)velocity, kb.field_1351, kb.field_1350));
        } else {
            this.comp_2884 = Optional.of(new class_243((double)velocity, 0.0, 0.0));
        }
    }

    @Override
    public void meteor$setVelocityY(float velocity) {
        if (this.comp_2884.isPresent()) {
            class_243 kb = this.comp_2884.get();
            this.comp_2884 = Optional.of(new class_243(kb.field_1352, (double)velocity, kb.field_1350));
        } else {
            this.comp_2884 = Optional.of(new class_243(0.0, (double)velocity, 0.0));
        }
    }

    @Override
    public void meteor$setVelocityZ(float velocity) {
        if (this.comp_2884.isPresent()) {
            class_243 kb = this.comp_2884.get();
            this.comp_2884 = Optional.of(new class_243(kb.field_1352, kb.field_1351, (double)velocity));
        } else {
            this.comp_2884 = Optional.of(new class_243(0.0, 0.0, (double)velocity));
        }
    }
}

