Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

image.png.d1c234994c7f49f5a938d0a18b47d689.png

@Mod(DetailArmorBar.MOD_ID)
public class DetailArmorBar {
    private static DetailArmorBarConfig config = null;

    public DetailArmorBar() {
        if (FMLEnvironment.dist == Dist.CLIENT) {
            onInitializeClient();
            ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, DABForgeConfig.SPEC);
        }
    }
  
    public void onInitializeClient() {
    }
}
public class DABForgeConfig {
    public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
    public static final ForgeConfigSpec SPEC;

    public static final ForgeConfigSpec.ConfigValue<ProtectionEffect> effectType;
    public static final ForgeConfigSpec.ConfigValue<EffectSpeed> effectSpeed;
    public static final ForgeConfigSpec.ConfigValue<Animation> effectThorn;

    public static final ForgeConfigSpec.ConfigValue<Boolean> toggleEnchants;
    public static final ForgeConfigSpec.ConfigValue<Boolean> toggleNetherites;
    public static final ForgeConfigSpec.ConfigValue<Boolean> toggleArmorTypes;
    public static final ForgeConfigSpec.ConfigValue<Boolean> toggleThorns;
    public static final ForgeConfigSpec.ConfigValue<Boolean> toggleDurability;
    public static final ForgeConfigSpec.ConfigValue<Boolean> toggleMending;
    public static final ForgeConfigSpec.ConfigValue<Boolean> toggleEmptyBar;
    public static final ForgeConfigSpec.ConfigValue<Boolean> toggleItemBar;

    static {
        BUILDER.push("Detail Armor Bar Settings");

        effectType = BUILDER.defineEnum("option.detailarmorbar.effects.effect_type", ProtectionEffect.AURA);
        effectSpeed = BUILDER.defineEnum("option.detailarmorbar.effects.effect_speed", EffectSpeed.NORMAL);
        effectThorn = BUILDER.defineEnum("option.detailarmorbar.effects.thorn", Animation.ANIMATION);

        toggleEnchants = BUILDER.define("option.detailarmorbar.toggle.enchantments", true);
        toggleNetherites = BUILDER.define("option.detailarmorbar.toggle.netherites", true);
        toggleArmorTypes = BUILDER.define("option.detailarmorbar.toggle.armor_types", true);
        toggleThorns = BUILDER.define("option.detailarmorbar.toggle.thorns", true);
        toggleDurability = BUILDER.define("option.detailarmorbar.toggle.durability", true);
        toggleMending = BUILDER.define("option.detailarmorbar.toggle.mending", true);
        toggleEmptyBar = BUILDER.define("option.detailarmorbar.toggle.empty_bar", true);
        toggleItemBar = BUILDER.define("option.detailarmorbar.toggle.item_types", true);

        BUILDER.pop();
        SPEC = BUILDER.build();
    }
}

Config has been setup. Config file is created, but the Config button doesn't work. (disabled) Am I missing something?

 

My Forge version is 37.0.44

Edited by RedLime

  • Author
31 minutes ago, poopoodice said:

I think there's a pr for this... long time ago.

You have to implement it yourself.

How do I implement it?

  • Author
8 minutes ago, diesieben07 said:

With pain and suffering.

Or you give up and tell your users to use Configured.

thanks, but can I config button to activate myself and open my Screen directly? (ex. Minecraft#openScreen())

  • Author
2 minutes ago, diesieben07 said:

You can register your own handler for it:


ModLoadingContext.get().registerExtensionPoint(
  ConfigGuiHandler.ConfigGuiFactory.class, 
  new ConfigGuiFactory((mc, modScreen) -> {
      return new YourScreen(...);
  })
);

 

Yooo Thanks :) I'll try it later!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.