package de.winniepat.citrus.mixins;

import net.minecraft.client.option.SimpleOption;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import java.util.Optional;

@Mixin(SimpleOption.DoubleSliderCallbacks.class)
public class GammaBypassMixin {

    @Inject(method = "validate(Ljava/lang/Object;)Ljava/util/Optional;", at = @At("HEAD"), cancellable = true)
    private void onValidate(Object value, CallbackInfoReturnable<Optional<?>> cir) {
        cir.setReturnValue(Optional.of(value));
    }
}