Because the automatic subscriber depends on the mod class loader, we need it to run after that has been initialized. That only happens in the construction event, so we have to search at some later stage.
This commit is contained in:
gegy1000 2018-06-11 01:27:26 +02:00 committed by Shadowfacts
parent ecf20f1a76
commit df437491f1
1 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import net.minecraftforge.fml.common.FMLCommonHandler
import net.minecraftforge.fml.common.Loader import net.minecraftforge.fml.common.Loader
import net.minecraftforge.fml.common.Mod import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.Mod.EventHandler import net.minecraftforge.fml.common.Mod.EventHandler
import net.minecraftforge.fml.common.event.FMLConstructionEvent import net.minecraftforge.fml.common.event.FMLPreInitializationEvent
/** /**
* @author shadowfacts * @author shadowfacts
@ -17,9 +17,9 @@ object Forgelin {
const val VERSION = "@VERSION@" const val VERSION = "@VERSION@"
@EventHandler @EventHandler
fun onConstruction(event: FMLConstructionEvent) { fun onPreInit(event: FMLPreInitializationEvent) {
Loader.instance().modList.forEach { Loader.instance().modList.forEach {
ForgelinAutomaticEventSubscriber.subscribeAutomatic(it, event.asmHarvestedData, FMLCommonHandler.instance().side) ForgelinAutomaticEventSubscriber.subscribeAutomatic(it, event.asmData, FMLCommonHandler.instance().side)
} }
} }
} }