Skip to content

Commit

Permalink
Hotfix client side configs, badges (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightenom authored Aug 20, 2024
1 parent 94c7a75 commit f05b86f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![BlockUI CurseForge](https://img.shields.io/curseforge/dt/522992?logo=curseforge&color=F16436&label=BlockUI)](https://www.curseforge.com/minecraft/mc-mods/blockui)
[![Release 1.20.1](https://img.shields.io/github/actions/workflow/status/ldtteam/blockui/release.yml?branch=version%2F1.20.1&label=Build%201.20.1&event=push)](https://github.com/ldtteam/BlockUI/actions/workflows/release.yml?query=branch%3Aversion%2F1.20.1+event%3Apush)
[![Release 1.21.1](https://img.shields.io/github/actions/workflow/status/ldtteam/blockui/release.yml?branch=version%2Fmain&label=Build%201.21.1&event=push)](https://github.com/ldtteam/BlockUI/actions/workflows/release.yml?query=branch%3Aversion%2Fmain+event%3Apush)

### BlockUI

An XML based UI management system for minecraft.
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/ldtteam/common/config/ClientConfigHelper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.ldtteam.common.config;

import net.neoforged.fml.ModContainer;
import net.neoforged.neoforge.client.gui.ConfigurationScreen;
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;

/**
* Client bouncer class
*/
public class ClientConfigHelper
{
static registerClient(final ModContainer modContainer)
{
modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new);
}
}
6 changes: 5 additions & 1 deletion src/main/java/com/ldtteam/common/config/Configurations.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ public Configurations(final ModContainer modContainer,
// register events for watchers
modBus.addListener(ModConfigEvent.Loading.class, event -> onConfigLoad(event.getConfig()));
modBus.addListener(ModConfigEvent.Reloading.class, event -> onConfigReload(event.getConfig()));
modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new);

if (FMLEnvironment.dist.isClient())
{
ClientConfigHelper.registerClient(modContainer);
}
}

private <T extends AbstractConfiguration> Pair<T, ModConfig> createConfig(final Function<Builder, T> factory,
Expand Down

0 comments on commit f05b86f

Please sign in to comment.