2013-07-26 21:18:53 -07:00
|
|
|
package tconstruct;
|
|
|
|
|
|
2013-10-08 21:08:46 +11:00
|
|
|
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;
|
2013-09-29 09:05:08 -07:00
|
|
|
import net.minecraft.crash.CallableMinecraftVersion;
|
2013-09-28 08:45:28 -07:00
|
|
|
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
2013-07-26 21:18:53 -07:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2013-08-18 14:30:55 -07:00
|
|
|
import tconstruct.client.event.EventCloakRender;
|
2013-10-08 21:08:46 +11:00
|
|
|
import tconstruct.common.*;
|
2013-07-26 21:18:53 -07:00
|
|
|
import tconstruct.library.TConstructRegistry;
|
2013-10-08 21:08:46 +11:00
|
|
|
import tconstruct.library.crafting.*;
|
2013-07-26 21:18:53 -07:00
|
|
|
import tconstruct.library.util.TabTools;
|
2013-10-08 21:08:46 +11:00
|
|
|
import tconstruct.util.*;
|
|
|
|
|
import tconstruct.util.config.*;
|
2013-09-05 12:39:18 -07:00
|
|
|
import tconstruct.util.landmine.behavior.Behavior;
|
|
|
|
|
import tconstruct.util.landmine.behavior.stackCombo.SpecialStackHandler;
|
2013-07-26 21:18:53 -07:00
|
|
|
import tconstruct.util.player.TPlayerHandler;
|
2013-10-08 21:08:46 +11:00
|
|
|
import tconstruct.worldgen.*;
|
|
|
|
|
import tconstruct.worldgen.village.*;
|
2013-07-26 21:18:53 -07:00
|
|
|
|
2013-10-12 23:46:35 +01:00
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
/** TConstruct, the tool mod.
|
|
|
|
|
* Craft your tools with style, then modify until the original is gone!
|
|
|
|
|
* @author: mDiyo
|
|
|
|
|
* @dependencies: IC2 API, MFR API
|
|
|
|
|
*/
|
|
|
|
|
|
2013-10-07 20:49:55 -07:00
|
|
|
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.X_1.5.0d", dependencies = "required-after:Forge@[8.9,)")
|
2013-07-26 21:18:53 -07:00
|
|
|
@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 liquidUpdateAmount = 6;
|
|
|
|
|
|
2013-10-12 23:46:35 +01:00
|
|
|
// Shared mod logger
|
|
|
|
|
public static final Logger logger = Logger.getLogger("TConstruct");
|
|
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
/* 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()
|
|
|
|
|
{
|
2013-10-12 23:46:35 +01:00
|
|
|
logger.setParent(FMLCommonHandler.instance().getFMLLogger());
|
2013-07-26 21:18:53 -07:00
|
|
|
if (Loader.isModLoaded("Natura"))
|
|
|
|
|
{
|
2013-10-12 23:46:35 +01:00
|
|
|
TConstruct.logger.info("[TConstruct] Natura, what are we going to do tomorrow night?");
|
2013-09-08 22:41:47 -07:00
|
|
|
if (Loader.isModLoaded("ChaoticBastion"))
|
|
|
|
|
{
|
2013-10-12 23:46:35 +01:00
|
|
|
TConstruct.logger.info("[Natura] TConstruct, we're going to...");
|
|
|
|
|
TConstruct.logger.info("[ChaoticBastion] All your base are belong to us!");
|
2013-09-08 22:41:47 -07:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
2013-10-12 23:46:35 +01:00
|
|
|
TConstruct.logger.info("[Natura] TConstruct, we're going to take over the world!");
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-09-08 22:41:47 -07:00
|
|
|
if (Loader.isModLoaded("ChaoticBastion"))
|
|
|
|
|
{
|
2013-10-12 23:46:35 +01:00
|
|
|
TConstruct.logger.info("[TConstruct] Preparing to...");
|
|
|
|
|
TConstruct.logger.info("[ChaoticBastion] I'MA FIRING MY LAZOR!");
|
2013-09-08 22:41:47 -07:00
|
|
|
}
|
|
|
|
|
else
|
2013-10-12 23:46:35 +01:00
|
|
|
TConstruct.logger.info("[TConstruct] Preparing to take over the world");
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@EventHandler
|
2013-09-28 08:45:28 -07:00
|
|
|
public void preInit (FMLPreInitializationEvent event)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2013-09-28 08:45:28 -07:00
|
|
|
|
|
|
|
|
PHConstruct.initProps(event.getModConfigurationDirectory());
|
2013-07-26 21:18:53 -07:00
|
|
|
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();
|
|
|
|
|
events.unfuxOreDictionary();
|
|
|
|
|
MinecraftForge.EVENT_BUS.register(events);
|
|
|
|
|
content.oreRegistry();
|
|
|
|
|
|
|
|
|
|
proxy.registerRenderer();
|
|
|
|
|
proxy.registerTickHandler();
|
|
|
|
|
proxy.addNames();
|
|
|
|
|
proxy.readManuals();
|
|
|
|
|
proxy.registerKeys();
|
|
|
|
|
|
|
|
|
|
GameRegistry.registerWorldGenerator(new TBaseWorldGenerator());
|
|
|
|
|
MinecraftForge.TERRAIN_GEN_BUS.register(new TerrainGenEventHandler());
|
|
|
|
|
GameRegistry.registerFuelHandler(content);
|
|
|
|
|
GameRegistry.registerCraftingHandler(new TCraftingHandler());
|
|
|
|
|
NetworkRegistry.instance().registerGuiHandler(instance, proxy);
|
|
|
|
|
|
|
|
|
|
VillagerRegistry.instance().registerVillageTradeHandler(78943, new TVillageTrades());
|
|
|
|
|
if (PHConstruct.addToVillages)
|
|
|
|
|
{
|
|
|
|
|
VillagerRegistry.instance().registerVillageCreationHandler(new VillageToolStationHandler());
|
|
|
|
|
VillagerRegistry.instance().registerVillageCreationHandler(new VillageSmelteryHandler());
|
2013-09-28 08:45:28 -07:00
|
|
|
try
|
|
|
|
|
{
|
2013-09-29 09:05:08 -07:00
|
|
|
if (new CallableMinecraftVersion(null).minecraftVersion().equals("1.6.4"))
|
2013-09-28 08:45:28 -07:00
|
|
|
{
|
|
|
|
|
MapGenStructureIO.func_143031_a(ComponentToolWorkshop.class, "TConstruct:ToolWorkshopStructure");
|
|
|
|
|
MapGenStructureIO.func_143031_a(ComponentSmeltery.class, "TConstruct:SmelteryStructure");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Throwable e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
2013-09-29 09:05:08 -07:00
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
playerTracker = new TPlayerHandler();
|
|
|
|
|
GameRegistry.registerPlayerTracker(playerTracker);
|
|
|
|
|
MinecraftForge.EVENT_BUS.register(playerTracker);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@EventHandler
|
2013-09-28 08:45:28 -07:00
|
|
|
public void init (FMLInitializationEvent event)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2013-08-31 05:13:31 -07:00
|
|
|
if (event.getSide() == Side.CLIENT)
|
|
|
|
|
{
|
|
|
|
|
MinecraftForge.EVENT_BUS.register(new EventCloakRender());
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
content.intermodCommunication();
|
2013-10-01 19:44:04 -07:00
|
|
|
TwilightForestConfig.initProps(PHConstruct.cfglocation);
|
|
|
|
|
BOPConfig.initProps(PHConstruct.cfglocation);
|
|
|
|
|
DimensionBlacklist.getbaddimensions();
|
2013-08-12 05:58:15 -07:00
|
|
|
GameRegistry.registerWorldGenerator(new SlimeIslandGen(TContent.slimePool.blockID, 0));
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@EventHandler
|
2013-09-28 08:45:28 -07:00
|
|
|
public void postInit (FMLPostInitializationEvent evt)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2013-10-08 21:08:46 +11:00
|
|
|
proxy.postInit();
|
2013-08-31 05:13:31 -07:00
|
|
|
Behavior.registerBuiltInBehaviors();
|
|
|
|
|
SpecialStackHandler.registerBuiltInStackHandlers();
|
2013-07-26 21:18:53 -07:00
|
|
|
content.modIntegration();
|
2013-07-22 21:53:01 -07:00
|
|
|
TContent.modRecipes();
|
2013-07-26 21:18:53 -07:00
|
|
|
content.createEntities();
|
2013-08-08 00:47:08 -07:00
|
|
|
content.modRecipes();
|
2013-09-28 08:45:28 -07:00
|
|
|
}
|
2013-07-26 21:18:53 -07:00
|
|
|
|
2013-09-28 08:45:28 -07:00
|
|
|
public static LiquidCasting getTableCasting ()
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
|
|
|
|
return tableCasting;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-28 08:45:28 -07:00
|
|
|
public static LiquidCasting getBasinCasting ()
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
|
|
|
|
return basinCasting;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-28 08:45:28 -07:00
|
|
|
public static Detailing getChiselDetailing ()
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
}
|