isXander / YetAnotherConfigLib

YetAnotherConfigLib (yacl) is just that. A builder-based configuration library for Minecraft.
GNU Lesser General Public License v3.0
91 stars 34 forks source link

Feature request: Allow to execute more code in on save when using auto gui #148

Open EchoEllet opened 5 months ago

EchoEllet commented 5 months ago

Just like title

Currently there is no way to execute some code in on save when using auto gui using config class


public class ModConfig {
    public static ConfigClassHandler<ModConfig> HANDLER = ConfigClassHandler.createBuilder(ModConfig.class)
            .id(new ResourceLocation(GlowingOres.MOD_ID))
            .serializer(config -> GsonConfigSerializerBuilder.create(config)
                    .setPath(FabricLoader.getInstance().getConfigDir().resolve(GlowingOres.MOD_ID + ".json5"))
                    .setJson5(true)
                    .build())
            .build();

    @SerialEntry(comment = "The light for diamond ore block")
    @AutoGen(category = "")
    @IntSlider(min = 0, max = 15, step = 1)
    public int diamondOreLight = 15;
}

    YetAnotherConfigLib gui = ModConfig.HANDLER
                    .generateGui();
            return gui.generateScreen(screen);