-
Notifications
You must be signed in to change notification settings - Fork 754
/
TConstruct.java
192 lines (161 loc) · 6.88 KB
/
TConstruct.java
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
package tconstruct;
import tconstruct.achievements.TAchievements;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.network.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.relauncher.Side;
import java.util.logging.Logger;
import net.minecraft.crash.CallableMinecraftVersion;
import net.minecraft.world.gen.structure.MapGenStructureIO;
import net.minecraftforge.common.MinecraftForge;
import tconstruct.client.event.EventCloakRender;
import tconstruct.common.*;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.*;
import tconstruct.library.util.TabTools;
import tconstruct.plugins.PluginController;
import tconstruct.util.*;
import tconstruct.util.config.*;
import tconstruct.util.landmine.behavior.Behavior;
import tconstruct.util.landmine.behavior.stackCombo.SpecialStackHandler;
import tconstruct.util.player.TPlayerHandler;
import tconstruct.worldgen.*;
import tconstruct.worldgen.village.*;
/** TConstruct, the tool mod.
* Craft your tools with style, then modify until the original is gone!
* @author mDiyo
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "${version}",
dependencies = "required-after:Forge@[9.11,);required-after:Mantle;after:ForgeMultipart;after:MineFactoryReloaded;after:NotEnoughItems;after:Waila;after:ThermalExpansion")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = tconstruct.util.network.TPacketHandler.class)
public class TConstruct
{
/** The value of one ingot in millibuckets */
public static final int ingotLiquidValue = 144;
public static final int oreLiquidValue = ingotLiquidValue * 2;
public static final int blockLiquidValue = ingotLiquidValue * 9;
public static final int chunkLiquidValue = ingotLiquidValue / 2;
public static final int nuggetLiquidValue = ingotLiquidValue / 9;
public static final int liquidUpdateAmount = 6;
// Shared mod logger
public static final Logger logger = Logger.getLogger("TConstruct");
/* Instance of this mod, used for grabbing prototype fields */
@Instance("TConstruct")
public static TConstruct instance;
/* Proxies for sides, used for graphics processing */
@SidedProxy(clientSide = "tconstruct.client.TProxyClient", serverSide = "tconstruct.common.TProxyCommon")
public static TProxyCommon proxy;
public TConstruct()
{
logger.setParent(FMLCommonHandler.instance().getFMLLogger());
if (Loader.isModLoaded("Natura"))
{
System.out.println("[TConstruct] Natura, what are we going to do tomorrow night?");
System.out.println("[Natura] TConstruct, we're going to take over the world!");
}
else
{
System.out.println("[TConstruct] Preparing to take over the world");
}
EnvironmentChecks.verifyEnvironmentSanity();
PluginController.getController().registerBuiltins();
}
@EventHandler
public void preInit (FMLPreInitializationEvent event)
{
PHConstruct.initProps(event.getSuggestedConfigurationFile());
TConstructRegistry.materialTab = new TabTools("TConstructMaterials");
TConstructRegistry.toolTab = new TabTools("TConstructTools");
TConstructRegistry.blockTab = new TabTools("TConstructBlocks");
tableCasting = new LiquidCasting();
basinCasting = new LiquidCasting();
chiselDetailing = new Detailing();
content = new TContent();
events = new TEventHandler();
MinecraftForge.EVENT_BUS.register(events);
MinecraftForge.EVENT_BUS.register(new TEventHandlerAchievement());
TRecipes.oreRegistry();
proxy.registerRenderer();
proxy.addNames();
proxy.readManuals();
proxy.registerKeys();
proxy.registerTickHandler();
GameRegistry.registerWorldGenerator(new TBaseWorldGenerator());
MinecraftForge.TERRAIN_GEN_BUS.register(new TerrainGenEventHandler());
GameRegistry.registerFuelHandler(content);
GameRegistry.registerCraftingHandler(new TCraftingHandler());
NetworkRegistry.instance().registerGuiHandler(instance, proxy);
if (PHConstruct.addToVillages)
{
// adds to the villager spawner egg
VillagerRegistry.instance().registerVillagerId(78943);
// moved down, not needed if 'addToVillages' is false
VillagerRegistry.instance().registerVillageTradeHandler(78943, new TVillageTrades());
VillagerRegistry.instance().registerVillageCreationHandler(new VillageToolStationHandler());
VillagerRegistry.instance().registerVillageCreationHandler(new VillageSmelteryHandler());
try
{
// if (new CallableMinecraftVersion(null).minecraftVersion().equals("1.6.4"))
// {
MapGenStructureIO.func_143031_a(ComponentToolWorkshop.class, "TConstruct:ToolWorkshopStructure");
MapGenStructureIO.func_143031_a(ComponentSmeltery.class, "TConstruct:SmelteryStructure");
// }
}
catch (Throwable e)
{
}
}
playerTracker = new TPlayerHandler();
GameRegistry.registerPlayerTracker(playerTracker);
MinecraftForge.EVENT_BUS.register(playerTracker);
PluginController.getController().preInit();
}
@EventHandler
public void init (FMLInitializationEvent event)
{
if (event.getSide() == Side.CLIENT)
{
MinecraftForge.EVENT_BUS.register(new EventCloakRender());
}
DimensionBlacklist.getBadBimensions();
GameRegistry.registerWorldGenerator(new SlimeIslandGen(TRepo.slimePool.blockID, 0));
PluginController.getController().init();
if (PHConstruct.achievementsEnabled)
{
TAchievements.init();
}
}
@EventHandler
public void postInit (FMLPostInitializationEvent evt)
{
proxy.postInit();
Behavior.registerBuiltInBehaviors();
SpecialStackHandler.registerBuiltInStackHandlers();
TRecipes.modIntegration();
TRecipes.addOreDictionarySmelteryRecipes();
content.createEntities();
TRecipes.modRecipes();
PluginController.getController().postInit();
}
public static LiquidCasting getTableCasting ()
{
return tableCasting;
}
public static LiquidCasting getBasinCasting ()
{
return basinCasting;
}
public static Detailing getChiselDetailing ()
{
return chiselDetailing;
}
public static TContent content;
public static TEventHandler events;
public static TPlayerHandler playerTracker;
public static LiquidCasting tableCasting;
public static LiquidCasting basinCasting;
public static Detailing chiselDetailing;
}