Skip to content

Commit

Permalink
Fix #38 (#39)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gegy authored and shadowfacts committed Jun 10, 2018
1 parent ecf20f1 commit df43749
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/net/shadowfacts/forgelin/Forgelin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import net.minecraftforge.fml.common.FMLCommonHandler
import net.minecraftforge.fml.common.Loader
import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.Mod.EventHandler
import net.minecraftforge.fml.common.event.FMLConstructionEvent
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent

/**
* @author shadowfacts
Expand All @@ -17,9 +17,9 @@ object Forgelin {
const val VERSION = "@VERSION@"

@EventHandler
fun onConstruction(event: FMLConstructionEvent) {
fun onPreInit(event: FMLPreInitializationEvent) {
Loader.instance().modList.forEach {
ForgelinAutomaticEventSubscriber.subscribeAutomatic(it, event.asmHarvestedData, FMLCommonHandler.instance().side)
ForgelinAutomaticEventSubscriber.subscribeAutomatic(it, event.asmData, FMLCommonHandler.instance().side)
}
}
}

0 comments on commit df43749

Please sign in to comment.