/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.llamalad7.mixinextras.injector.ModifyExpressionValue
 *  net.minecraft.class_10090
 *  net.minecraft.class_11659
 *  net.minecraft.class_20
 *  net.minecraft.class_330
 *  net.minecraft.class_4587
 *  org.spongepowered.asm.mixin.Mixin
 *  org.spongepowered.asm.mixin.injection.At
 *  org.spongepowered.asm.mixin.injection.Inject
 *  org.spongepowered.asm.mixin.injection.callback.CallbackInfo
 */
package meteordevelopment.meteorclient.mixin;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import java.util.List;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
import net.minecraft.class_10090;
import net.minecraft.class_11659;
import net.minecraft.class_20;
import net.minecraft.class_330;
import net.minecraft.class_4587;
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;

@Mixin(value={class_330.class})
public abstract class MapRendererMixin {
    @ModifyExpressionValue(method={"method_1773"}, at={@At(value="FIELD", target="Lnet/minecraft/class_10090;field_53639:Ljava/util/List;")})
    private List<class_20> getIconsProxy(List<class_20> original) {
        return Modules.get().get(NoRender.class).noMapMarkers() ? List.of() : original;
    }

    @Inject(method={"method_1773"}, at={@At(value="HEAD")}, cancellable=true)
    private void onDraw(class_10090 state, class_4587 matrices, class_11659 queue, boolean skipRenderingDecorations, int light, CallbackInfo ci) {
        if (Modules.get().get(NoRender.class).noMapContents()) {
            ci.cancel();
        }
    }
}

