blob: 55bde81bb7b07d6443700c4ed0198ba8a687702c (
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
package gtPlusPlus.core.common;
import static gtPlusPlus.core.lib.CORE.DEBUG;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.registry.GameRegistry;
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.RECIPES_Old_Circuits;
import gtPlusPlus.core.recipe.common.CI;
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 earlier 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();
BookHandler.run();
//Registration of entities and renderers
Utils.LOG_INFO("[Proxy] Calling Entity registrator.");
registerEntities();
Utils.LOG_INFO("[Proxy] Calling Tile Entity registrator.");
registerTileEntities();
}
public void init(final FMLInitializationEvent e) {
//Debug Loading
if (CORE.DEBUG){
DEBUG_INIT.registerHandlers();
}
ModItems.init();
ModBlocks.init();
CI.Init();
//Prevents my Safes being destroyed.
MinecraftForge.EVENT_BUS.register(new PickaxeBlockBreakEventHandler());
//Block Handler for all events.
MinecraftForge.EVENT_BUS.register(new BlockEventHandler());
Utils.LOG_INFO("[Proxy] Calling Render registrator.");
registerRenderThings();
//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();
//Circuits
if (CORE.configSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
RECIPES_Old_Circuits.handleCircuits();
new RECIPES_Old_Circuits();
}
//Make Burnables burnable
if (!CORE.burnables.isEmpty()){
BurnableFuelHandler fuelHandler = new BurnableFuelHandler();
GameRegistry.registerFuelHandler(fuelHandler);
Utils.LOG_INFO("[Fuel Handler] Registering "+fuelHandler.getClass().getName());
}
//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) {
}
}
|