aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/common/CommonProxy.java
blob: 88e0de163b09641f86351c390458f1bb12df94f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package gtPlusPlus.core.common;

import static gtPlusPlus.core.lib.CORE.DEBUG;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.*;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.entity.InternalEntityRegistry;
import gtPlusPlus.core.handler.*;
import gtPlusPlus.core.handler.events.BlockEventHandler;
import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.recipe.RECIPE_CONSTANTS;
import gtPlusPlus.core.tileentities.ModTileEntities;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.debug.DEBUG_INIT;
import gtPlusPlus.core.util.player.PlayerCache;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import net.minecraft.entity.Entity;
import net.minecraftforge.common.MinecraftForge;

public class CommonProxy {

	public static Meta_GT_Proxy GtProxy;

	public CommonProxy(){
		//Should Register Gregtech Materials I've Made
		MinecraftForge.EVENT_BUS.register(this);
		FMLCommonHandler.instance().bus().register(this);
		if (LoadedMods.Gregtech){
			if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
				Utils.LOG_INFO("We're using Gregtech 5.09 Experimental.");
			}
			else {
				Utils.LOG_INFO("We're using Gregtech 5.08 or an equivalent fork.");
			}
			Utils.LOG_INFO("Setting up our own GT_Proxy.");
			GtProxy = new Meta_GT_Proxy();
		}
		else {
			GtProxy = null;
		}
	}

	public void preInit(final FMLPreInitializationEvent e) {
		Utils.LOG_INFO("Doing some house cleaning.");
		LoadedMods.checkLoaded();
		Utils.LOG_INFO("Making sure we're ready to party!");


		if (!DEBUG){
			Utils.LOG_WARNING("Development mode not enabled.");
		}
		else if (DEBUG){
			Utils.LOG_INFO("Development mode enabled.");
		}
		else {
			Utils.LOG_WARNING("Development mode not set.");
		}
		AddToCreativeTab.initialiseTabs();
		COMPAT_IntermodStaging.preInit();
		//Apparently I should do this here. Might put it in Init for a test.
		//Growthcraft_Handler.run();
	}

	public void init(final FMLInitializationEvent e) {
		//Debug Loading
		if (CORE.DEBUG){
			DEBUG_INIT.registerHandlers();
		}
		ModItems.init();
		ModBlocks.init();
		RECIPE_CONSTANTS.initialise();
		//Prevents my Safes being destroyed.
		MinecraftForge.EVENT_BUS.register(new PickaxeBlockBreakEventHandler());
		//Block Handler for all events.
		MinecraftForge.EVENT_BUS.register(new BlockEventHandler());

		//Compat Handling
		COMPAT_HANDLER.registerMyModsOreDictEntries();
		COMPAT_HANDLER.intermodOreDictionarySupport();
		COMPAT_IntermodStaging.init();
	}

	public void postInit(final FMLPostInitializationEvent e) {
		Utils.LOG_INFO("Cleaning up, doing postInit.");
		PlayerCache.initCache();
		//Compat Handling
		COMPAT_HANDLER.InitialiseHandlerThenAddRecipes();
		COMPAT_HANDLER.RemoveRecipesFromOtherMods();
		COMPAT_HANDLER.startLoadingGregAPIBasedRecipes();
		COMPAT_IntermodStaging.postInit();
	}


	public void serverStarting(final FMLServerStartingEvent e)
	{
		COMPAT_HANDLER.InitialiseLateHandlerThenAddRecipes();
	}

	public void registerNetworkStuff(){
		GuiHandler.init();
	}
	
	public void registerEntities(){
		InternalEntityRegistry.registerEntities();
	}

	public void registerTileEntities(){
		ModTileEntities.init();
	}

	public void registerRenderThings() {

	}

	public int addArmor(final String armor) {
		return 0;
	}

	public void generateMysteriousParticles(final Entity entity) {
	}

}