Enforce specversion number for forgeSPI so we don't crash with weird errors later.
Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
parent
3c73dc2d0b
commit
b4ccafe718
2 changed files with 9 additions and 1 deletions
|
@ -291,7 +291,7 @@ project(':forge') {
|
|||
installer 'cpw.mods:modlauncher:0.11.+'
|
||||
installer 'net.minecraftforge:accesstransformers:0.15.+:shadowed'
|
||||
installer 'net.minecraftforge:eventbus:0.8.+:service'
|
||||
installer 'net.minecraftforge:forgespi:0.10.+'
|
||||
installer 'net.minecraftforge:forgespi:0.11.+'
|
||||
installer 'net.minecraftforge:coremods:0.4.+'
|
||||
installer 'net.minecraftforge:unsafe:0.2.+'
|
||||
installer 'com.electronwill.night-config:core:3.4.2'
|
||||
|
|
|
@ -31,6 +31,7 @@ import net.minecraftforge.api.distmarker.Dist;
|
|||
import net.minecraftforge.fml.loading.moddiscovery.BackgroundScanHandler;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModFile;
|
||||
import net.minecraftforge.forgespi.Environment;
|
||||
import net.minecraftforge.forgespi.coremod.ICoreModProvider;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
@ -124,6 +125,13 @@ public class FMLLoader
|
|||
final Package coremodPackage = coreModProvider.getClass().getPackage();
|
||||
LOGGER.debug(CORE,"FML found CoreMod version : {}", coremodPackage.getImplementationVersion());
|
||||
|
||||
|
||||
LOGGER.debug(CORE, "Found ForgeSPI package implementation version {}", Environment.class.getPackage().getImplementationVersion());
|
||||
LOGGER.debug(CORE, "Found ForgeSPI package specification {}", Environment.class.getPackage().getSpecificationVersion());
|
||||
if (Integer.parseInt(Environment.class.getPackage().getSpecificationVersion()) < 2) {
|
||||
throw new IncompatibleEnvironmentException("ForgeSPI is out of date, we cannot continue");
|
||||
}
|
||||
|
||||
try {
|
||||
Class.forName("com.electronwill.nightconfig.core.Config", false, environment.getClass().getClassLoader());
|
||||
Class.forName("com.electronwill.nightconfig.toml.TomlFormat", false, environment.getClass().getClassLoader());
|
||||
|
|
Loading…
Reference in a new issue