forked from GregTechCEu/GregTech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGregTechMod.java
More file actions
95 lines (81 loc) · 3.15 KB
/
GregTechMod.java
File metadata and controls
95 lines (81 loc) · 3.15 KB
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
package gregtech;
import gregtech.api.GTValues;
import gregtech.api.GregTechAPI;
import gregtech.api.modules.ModuleContainerRegistryEvent;
import gregtech.client.utils.BloomEffectUtil;
import gregtech.integration.cc.ComputerCraft;
import gregtech.integration.groovy.GroovyScriptCompat;
import gregtech.modules.GregTechModules;
import gregtech.modules.ModuleManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.*;
@Mod(modid = GTValues.MODID,
name = "GregTech",
acceptedMinecraftVersions = "[1.12.2,1.13)",
version = GregTechVersion.VERSION,
dependencies = "required:forge@[14.23.5.2847,);"
+ "required-after:codechickenlib@[3.2.3,);"
+ "after:forestry;"
+ "after:jei@[4.15.0,);"
+ "after:crafttweaker@[4.1.20,);"
+ "after:groovyscript@[0.4.0,);")
public class GregTechMod {
// Hold this so that we can reference non-interface methods without
// letting the GregTechAPI object see them as immediately.
private ModuleManager moduleManager;
public GregTechMod() {
GregTechAPI.instance = this;
FluidRegistry.enableUniversalBucket();
if (FMLCommonHandler.instance().getSide().isClient()) {
BloomEffectUtil.init();
}
}
@EventHandler
public void onConstruction(FMLConstructionEvent event) {
moduleManager = ModuleManager.getInstance();
GregTechAPI.moduleManager = moduleManager;
moduleManager.registerContainer(new GregTechModules());
MinecraftForge.EVENT_BUS.post(new ModuleContainerRegistryEvent());
/* GroovyScript must be initialized during construction since the first load stage is right after construction */
GroovyScriptCompat.init();
}
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
moduleManager.setup(event);
moduleManager.onPreInit(event);
}
@EventHandler
public void init(FMLInitializationEvent event) {
moduleManager.onInit(event);
ComputerCraft.init();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
moduleManager.onPostInit(event);
moduleManager.processIMC(FMLInterModComms.fetchRuntimeMessages(GregTechAPI.instance));
}
@EventHandler
public void loadComplete(FMLLoadCompleteEvent event) {
moduleManager.onLoadComplete(event);
}
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
moduleManager.onServerStarting(event);
}
@EventHandler
public void serverStarted(FMLServerStartedEvent event) {
moduleManager.onServerStarted(event);
}
@EventHandler
public void serverStopped(FMLServerStoppedEvent event) {
moduleManager.onServerStopped(event);
}
@EventHandler
public void respondIMC(FMLInterModComms.IMCEvent event) {
moduleManager.processIMC(event.getMessages());
}
}