Having fun with the new forge!

Done in a different branch because of a depreciated api.
This commit is contained in:
modmuss50 2015-04-26 14:17:59 +01:00
parent b82f79dc04
commit 566430d490

View file

@ -2,6 +2,7 @@ package techreborn;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.ProgressManager;
import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent;
@ -40,49 +41,67 @@ public class Core {
@Mod.EventHandler @Mod.EventHandler
public void preinit(FMLPreInitializationEvent event) public void preinit(FMLPreInitializationEvent event)
{ {
ProgressManager.ProgressBar bar = ProgressManager.push("TechReborn preInit", 1);
INSTANCE = this; INSTANCE = this;
String path = event.getSuggestedConfigurationFile().getAbsolutePath() String path = event.getSuggestedConfigurationFile().getAbsolutePath()
.replace(ModInfo.MOD_ID, "TechReborn"); .replace(ModInfo.MOD_ID, "TechReborn");
bar.step("Loading Config");
config = ConfigTechReborn.initialize(new File(path)); config = ConfigTechReborn.initialize(new File(path));
LogHelper.info("PreInitialization Compleate"); LogHelper.info("PreInitialization Complete");
ProgressManager.pop(bar);
} }
@Mod.EventHandler @Mod.EventHandler
public void init(FMLInitializationEvent event) public void init(FMLInitializationEvent event)
{ {
ProgressManager.ProgressBar bar = ProgressManager.push("TechReborn Init", 10);
bar.step("Loading Blocks");
// Register ModBlocks // Register ModBlocks
ModBlocks.init(); ModBlocks.init();
bar.step("Loading Items");
// Register ModItems // Register ModItems
ModItems.init(); ModItems.init();
bar.step("Loading Recipes");
// Recipes // Recipes
ModRecipes.init(); ModRecipes.init();
bar.step("Loading Compat");
// Compat // Compat
CompatManager.init(event); CompatManager.init(event);
bar.step("Loading WorldGen");
// WorldGen // WorldGen
GameRegistry.registerWorldGenerator(new TROreGen(), 0); GameRegistry.registerWorldGenerator(new TROreGen(), 0);
bar.step("Loading Gui Handler");
// Register Gui Handler // Register Gui Handler
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler()); NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
bar.step("Loading Packets");
// packets // packets
PacketHandler.setChannels(NetworkRegistry.INSTANCE.newChannel( PacketHandler.setChannels(NetworkRegistry.INSTANCE.newChannel(
ModInfo.MOD_ID + "_packets", new PacketHandler())); ModInfo.MOD_ID + "_packets", new PacketHandler()));
bar.step("Loading Achievements");
// Achievements // Achievements
TRAchievements.init(); TRAchievements.init();
bar.step("Loading Multiblocks");
// Multiblock events // Multiblock events
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler()); MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
FMLCommonHandler.instance().bus() FMLCommonHandler.instance().bus()
.register(new MultiblockServerTickHandler()); .register(new MultiblockServerTickHandler());
bar.step("Loading Client things");
proxy.init(); proxy.init();
LogHelper.info("Initialization Compleate"); LogHelper.info("Initialization Complete");
ProgressManager.pop(bar);
} }
@Mod.EventHandler @Mod.EventHandler
public void postinit(FMLPostInitializationEvent event) public void postinit(FMLPostInitializationEvent event)
{ {
ProgressManager.ProgressBar bar = ProgressManager.push("TechReborn Init", 1);
bar.step("Loading Recipes");
// Has to be done here as Buildcraft registers there recipes late // Has to be done here as Buildcraft registers there recipes late
RecipeManager.init(); RecipeManager.init();
ProgressManager.pop(bar);
} }
} }