2014-06-19 20:18:04 +02:00
package com.pahimar.ee3.handler ;
2016-05-18 19:53:13 +02:00
import com.pahimar.ee3.exchange.EnergyValueRegistry ;
import com.pahimar.ee3.recipe.AludelRecipeManager ;
import com.pahimar.ee3.recipe.RecipeRegistry ;
import com.pahimar.ee3.util.LogHelper ;
2014-09-04 21:15:16 +02:00
import cpw.mods.fml.common.FMLCommonHandler ;
2014-06-19 20:18:04 +02:00
import cpw.mods.fml.common.eventhandler.SubscribeEvent ;
2014-09-04 21:15:16 +02:00
import cpw.mods.fml.relauncher.Side ;
2014-06-19 20:18:04 +02:00
import net.minecraftforge.event.world.WorldEvent ;
2016-05-18 19:53:13 +02:00
public class WorldEventHandler {
2014-09-16 18:08:16 +02:00
public static boolean hasInitilialized = false ;
2014-07-14 18:04:20 +02:00
2014-06-19 20:18:04 +02:00
@SubscribeEvent
2016-05-18 19:53:13 +02:00
public void onWorldLoadEvent ( WorldEvent . Load event ) {
if ( ! hasInitilialized & & FMLCommonHandler . instance ( ) . getEffectiveSide ( ) = = Side . SERVER ) {
RecipeRegistry . getInstance ( ) . registerVanillaRecipes ( ) ;
AludelRecipeManager . registerRecipes ( ) ;
long startTime = System . nanoTime ( ) ;
EnergyValueRegistry . INSTANCE . compute ( ) ;
LogHelper . info ( EnergyValueRegistry . ENERGY_VALUE_MARKER , " Energy value system initialized {} values after {} ms " , EnergyValueRegistry . INSTANCE . getEnergyValues ( ) . size ( ) , ( System . nanoTime ( ) - startTime ) / 100000 ) ;
2014-07-14 18:04:20 +02:00
hasInitilialized = true ;
}
2014-06-19 20:18:04 +02:00
}
}