/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  net.minecraft.class_2246
 *  net.minecraft.class_2248
 *  net.minecraft.class_2960
 *  net.minecraft.class_7923
 */
package meteordevelopment.meteorclient.gui.screens.settings;

import java.util.Collection;
import java.util.function.Predicate;
import meteordevelopment.meteorclient.gui.GuiTheme;
import meteordevelopment.meteorclient.gui.screens.settings.base.CollectionListSettingScreen;
import meteordevelopment.meteorclient.gui.widgets.WWidget;
import meteordevelopment.meteorclient.settings.BlockListSetting;
import meteordevelopment.meteorclient.utils.misc.Names;
import net.minecraft.class_2246;
import net.minecraft.class_2248;
import net.minecraft.class_2960;
import net.minecraft.class_7923;

public class BlockListSettingScreen
extends CollectionListSettingScreen<class_2248> {
    public BlockListSettingScreen(GuiTheme theme, BlockListSetting setting) {
        super(theme, "Select Blocks", setting, (Collection)setting.get(), class_7923.field_41175);
    }

    @Override
    protected boolean includeValue(class_2248 value) {
        if (class_7923.field_41175.method_10221((Object)value).method_12832().endsWith("_wall_banner")) {
            return false;
        }
        Predicate<class_2248> filter = ((BlockListSetting)this.setting).filter;
        if (filter == null) {
            return value != class_2246.field_10124;
        }
        return filter.test(value);
    }

    @Override
    protected WWidget getValueWidget(class_2248 value) {
        return this.theme.itemWithLabel(value.method_8389().method_7854(), Names.get(value));
    }

    @Override
    protected String[] getValueNames(class_2248 value) {
        return new String[]{Names.get(value), class_7923.field_41175.method_10221((Object)value).toString()};
    }

    @Override
    protected class_2248 getAdditionalValue(class_2248 value) {
        String path = class_7923.field_41175.method_10221((Object)value).method_12832();
        if (!path.endsWith("_banner")) {
            return null;
        }
        return (class_2248)class_7923.field_41175.method_63535(class_2960.method_60656((String)(path.substring(0, path.length() - 6) + "wall_banner")));
    }
}

