package com.anthonyhilyard.iceberg.mixin; import java.lang.reflect.Field; import com.anthonyhilyard.iceberg.Loader; import com.anthonyhilyard.iceberg.config.IcebergConfigSpec; import com.electronwill.nightconfig.core.UnmodifiableConfig; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.mrcrayfish.configured.client.screen.ConfigScreen; import com.mrcrayfish.configured.client.screen.ListMenuScreen; import com.mrcrayfish.configured.client.screen.ModConfigSelectionScreen; import com.mrcrayfish.configured.client.screen.ModConfigSelectionScreen.FileItem; import com.mrcrayfish.configured.client.screen.WorldSelectionScreen; import com.mrcrayfish.configured.client.screen.ConfigScreen.FolderEntry; import com.mrcrayfish.configured.client.screen.ConfigScreen.IEntry; import com.mrcrayfish.configured.client.screen.widget.IconButton; import com.mrcrayfish.configured.util.ConfigHelper; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.reflect.FieldUtils; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.At; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.narration.ScreenNarrationCollector; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.unsafe.UnsafeHacks; @Mixin(FileItem.class) public class ConfiguredModConfigSelectionScreenMixin { @Shadow(aliases = "this$0", remap = false) @Final ModConfigSelectionScreen this$0; @Shadow(remap = false) @Final protected ModConfig config; @Shadow(remap = false) @Final protected Component title; @Shadow(remap = false) private boolean hasRequiredPermission() { return true; } @Inject(method = "createModifyButton", at = @At(value = "HEAD"), remap = false, cancellable = true) private void createModifyButton(ModConfig config, CallbackInfoReturnable