Skip to content

Commit

Permalink
1.20.1 (fabric) loads
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysdh540 committed Aug 1, 2023
1 parent 3832c1a commit 9411c1f
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@

import net.minecraft.resources.ResourceLocation;

#if PRE_CURRENT_MC_1_19_2
import net.minecraftforge.api.ModLoadingContext;
#elif POST_CURRENT_MC_1_20_1
import fuzs.forgeconfigapiport.api.config.v2.ForgeConfigRegistry;
#endif
import net.minecraftforge.fml.config.IConfigSpec;
import net.minecraftforge.fml.config.ModConfig;

Expand All @@ -36,7 +40,11 @@ public static void registerCommand(LiteralArgumentBuilder<CommandSourceStack> co
}

public static void registerConfig(String id, ModConfig.Type type, IConfigSpec<?> spec, String fileName) {
#if PRE_CURRENT_MC_1_19_2
ModLoadingContext.registerConfig(id, type, spec, fileName);
#elif POST_CURRENT_MC_1_20_1
ForgeConfigRegistry.INSTANCE.register(id, type, spec, fileName);
#endif
}

public static <A extends ArgumentType<?>, T extends ArgumentTypeInfo.Template<A>, I extends ArgumentTypeInfo<A, T>>
Expand Down

0 comments on commit 9411c1f

Please sign in to comment.