split into client/server config

This commit is contained in:
alterNERDtive 2023-06-19 07:14:58 +02:00
parent a431939dbf
commit 8d6955b510
Signed by: alterNERDtive
GPG key ID: 547787A4FE6533F1
2 changed files with 13 additions and 5 deletions

View file

@ -9,6 +9,7 @@ import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
public class Configuration { public class Configuration {
public static final ForgeConfigSpec CONFIG; public static final ForgeConfigSpec CONFIG;
public static final ForgeConfigSpec CLIENTCONFIG;
public static BooleanValue FORTUNE_ENABLED; public static BooleanValue FORTUNE_ENABLED;
public static IntValue FORTUNE_LEVEL; public static IntValue FORTUNE_LEVEL;
@ -42,11 +43,7 @@ public class Configuration {
static { static {
Builder builder = new Builder(); Builder builder = new Builder();
setupConfig(builder);
CONFIG = builder.build();
}
private static void setupConfig(Builder builder) {
// Fortune changes // Fortune changes
builder.push("Fortune"); builder.push("Fortune");
builder.comment("Replace the maximum Fortune level for the Vault Enchanter and remove the Fortunate Expertise"); builder.comment("Replace the maximum Fortune level for the Vault Enchanter and remove the Fortunate Expertise");
@ -112,8 +109,18 @@ public class Configuration {
ROUTER_VAULTAR_FIX = builder.define("routerVaultarFix", true); ROUTER_VAULTAR_FIX = builder.define("routerVaultarFix", true);
builder.comment("Fix №5 fragments of all relics having half the weight"); builder.comment("Fix №5 fragments of all relics having half the weight");
FRAGMENT_WEIGHT_FIX = builder.define("fragmentFix", true); FRAGMENT_WEIGHT_FIX = builder.define("fragmentFix", true);
builder.pop();
CONFIG = builder.build();
builder = new Builder();
// Bug fixes
builder.push("Fixes");
builder.comment("Fix performance issues when determining item colours (WARNING: will make jewels and unidentified gear go white)"); builder.comment("Fix performance issues when determining item colours (WARNING: will make jewels and unidentified gear go white)");
COLOURLESS = builder.define("colourPerformanceFix", true); COLOURLESS = builder.define("colourPerformanceFix", true);
builder.pop(); builder.pop();
CLIENTCONFIG = builder.build();
} }
} }

View file

@ -18,7 +18,8 @@ public class VaultModTweaks
public VaultModTweaks() public VaultModTweaks()
{ {
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Configuration.CONFIG); ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, Configuration.CONFIG);
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, Configuration.CLIENTCONFIG);
} }
private void setup(final FMLCommonSetupEvent event) private void setup(final FMLCommonSetupEvent event)