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:
parent
ecf20f1a76
commit
df437491f1
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue