use of net.minecraftforge.fml.common.ModContainer in project Gaspunk by Ladysnake.
the class GasDeserializer method loadGases.
@SubscribeEvent
public static void loadGases(RegistryEvent.Register<IGas> event) {
ModContainer gaspunkContainer = Loader.instance().activeModContainer();
Loader.instance().getActiveModList().forEach(GasDeserializer::loadGases);
Loader.instance().setActiveModContainer(gaspunkContainer);
File configFolder = new File(GasPunk.lib.getConfigFolder(), GasPunk.MOD_ID + "/custom_gases");
// if the config folder was just created or couldn't be created, no need to search it
if (!configFolder.mkdirs() && configFolder.exists()) {
try {
Files.walk(configFolder.toPath()).forEach(path -> loadGases(configFolder.toPath(), path));
} catch (IOException e) {
e.printStackTrace();
}
}
}
Aggregations