/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  net.minecraft.class_1163
 *  net.minecraft.class_1920
 *  net.minecraft.class_2338
 *  org.spongepowered.asm.mixin.Mixin
 *  org.spongepowered.asm.mixin.injection.At
 *  org.spongepowered.asm.mixin.injection.Inject
 *  org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable
 */
package meteordevelopment.meteorclient.mixin;

import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.world.Ambience;
import net.minecraft.class_1163;
import net.minecraft.class_1920;
import net.minecraft.class_2338;
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.CallbackInfoReturnable;

@Mixin(value={class_1163.class})
public abstract class BiomeColorsMixin {
    @Inject(method={"method_4961"}, at={@At(value="HEAD")}, cancellable=true)
    private static void onGetWaterColor(class_1920 world, class_2338 pos, CallbackInfoReturnable<Integer> info) {
        Ambience ambience = Modules.get().get(Ambience.class);
        if (ambience.isActive() && ambience.customWaterColor.get().booleanValue()) {
            info.setReturnValue((Object)ambience.waterColor.get().getPacked());
        }
    }

    @Inject(method={"method_4966"}, at={@At(value="HEAD")}, cancellable=true)
    private static void onGetFoliageColor(class_1920 world, class_2338 pos, CallbackInfoReturnable<Integer> info) {
        Ambience ambience = Modules.get().get(Ambience.class);
        if (ambience.isActive() && ambience.customFoliageColor.get().booleanValue()) {
            info.setReturnValue((Object)ambience.foliageColor.get().getPacked());
        }
    }

    @Inject(method={"method_4962"}, at={@At(value="HEAD")}, cancellable=true)
    private static void onGetGrassColor(class_1920 world, class_2338 pos, CallbackInfoReturnable<Integer> info) {
        Ambience ambience = Modules.get().get(Ambience.class);
        if (ambience.isActive() && ambience.customGrassColor.get().booleanValue()) {
            info.setReturnValue((Object)ambience.grassColor.get().getPacked());
        }
    }
}

