2013-07-26 21:18:53 -07:00
|
|
|
package tconstruct;
|
|
|
|
|
|
2014-11-11 17:01:15 -05:00
|
|
|
import cpw.mods.fml.common.FMLCommonHandler;
|
|
|
|
|
import cpw.mods.fml.common.Loader;
|
|
|
|
|
import cpw.mods.fml.common.Mod;
|
|
|
|
|
import cpw.mods.fml.common.Mod.EventHandler;
|
|
|
|
|
import cpw.mods.fml.common.Mod.Instance;
|
|
|
|
|
import cpw.mods.fml.common.SidedProxy;
|
2014-09-22 16:02:16 +02:00
|
|
|
import cpw.mods.fml.common.event.*;
|
2014-11-11 17:01:15 -05:00
|
|
|
import cpw.mods.fml.common.network.NetworkCheckHandler;
|
|
|
|
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
|
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
|
|
|
|
import cpw.mods.fml.common.registry.VillagerRegistry;
|
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
2014-08-05 22:09:57 -04:00
|
|
|
import mantle.pulsar.config.ForgeCFG;
|
|
|
|
|
import mantle.pulsar.control.PulseManager;
|
2014-09-09 18:30:15 +10:00
|
|
|
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
|
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2014-09-19 13:58:12 +02:00
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
|
import org.apache.logging.log4j.Logger;
|
|
|
|
|
import tconstruct.achievements.AchievementEvents;
|
|
|
|
|
import tconstruct.achievements.TAchievements;
|
2014-08-20 14:53:02 -05:00
|
|
|
import tconstruct.api.TConstructAPI;
|
2014-06-30 14:57:06 -08:00
|
|
|
import tconstruct.armor.TinkerArmor;
|
2014-09-19 13:58:12 +02:00
|
|
|
import tconstruct.armor.player.TPlayerHandler;
|
|
|
|
|
import tconstruct.armor.player.TPlayerStats;
|
2014-02-05 10:28:54 -05:00
|
|
|
import tconstruct.common.TProxyCommon;
|
2014-09-19 13:58:12 +02:00
|
|
|
import tconstruct.library.TConstructCreativeTab;
|
|
|
|
|
import tconstruct.library.TConstructRegistry;
|
|
|
|
|
import tconstruct.library.crafting.Detailing;
|
|
|
|
|
import tconstruct.library.crafting.LiquidCasting;
|
2014-06-30 14:57:06 -08:00
|
|
|
import tconstruct.mechworks.TinkerMechworks;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.mechworks.landmine.behavior.Behavior;
|
|
|
|
|
import tconstruct.mechworks.landmine.behavior.stackCombo.SpecialStackHandler;
|
2014-12-02 21:34:09 +01:00
|
|
|
import tconstruct.plugins.fmp.TinkerFMP;
|
2014-08-05 22:09:57 -04:00
|
|
|
import tconstruct.plugins.ic2.TinkerIC2;
|
2014-09-19 13:58:12 +02:00
|
|
|
import tconstruct.plugins.imc.TinkerAE2;
|
|
|
|
|
import tconstruct.plugins.imc.TinkerBuildCraft;
|
|
|
|
|
import tconstruct.plugins.imc.TinkerMystcraft;
|
2014-11-26 20:57:08 +01:00
|
|
|
import tconstruct.plugins.TinkerThaumcraft;
|
2014-08-05 22:09:57 -04:00
|
|
|
import tconstruct.plugins.mfr.TinkerMFR;
|
|
|
|
|
import tconstruct.plugins.te4.TinkerTE4;
|
|
|
|
|
import tconstruct.plugins.waila.TinkerWaila;
|
2014-06-30 14:57:06 -08:00
|
|
|
import tconstruct.smeltery.TinkerSmeltery;
|
|
|
|
|
import tconstruct.tools.TinkerTools;
|
2014-02-05 10:28:54 -05:00
|
|
|
import tconstruct.util.EnvironmentChecks;
|
2014-09-22 16:02:16 +02:00
|
|
|
import tconstruct.util.IMCHandler;
|
2014-09-19 13:58:12 +02:00
|
|
|
import tconstruct.util.config.DimensionBlacklist;
|
|
|
|
|
import tconstruct.util.config.PHConstruct;
|
2014-07-21 12:52:39 -08:00
|
|
|
import tconstruct.util.network.PacketPipeline;
|
2014-10-05 20:14:56 +02:00
|
|
|
import tconstruct.weaponry.TinkerWeaponry;
|
2014-06-04 21:44:48 -08:00
|
|
|
import tconstruct.world.TinkerWorld;
|
|
|
|
|
import tconstruct.world.gen.SlimeIslandGen;
|
2014-11-11 17:01:15 -05:00
|
|
|
import tconstruct.world.village.*;
|
|
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Random;
|
2013-07-26 21:18:53 -07:00
|
|
|
|
2014-02-16 14:23:50 -05:00
|
|
|
/**
|
|
|
|
|
* TConstruct, the tool mod. Craft your tools with style, then modify until the
|
|
|
|
|
* original is gone!
|
|
|
|
|
*
|
2013-10-22 16:49:14 +01:00
|
|
|
* @author mDiyo
|
2013-07-26 21:18:53 -07:00
|
|
|
*/
|
|
|
|
|
|
2014-09-19 13:58:12 +02:00
|
|
|
@Mod(modid = "TConstruct", name = "TConstruct", version = "${version}",
|
2014-12-18 17:19:41 +01:00
|
|
|
dependencies = "required-after:Forge@[10.13.1.1217,);required-after:Mantle@[1.7.10-0.3.2,);after:MineFactoryReloaded;after:NotEnoughItems;after:Waila;after:ThermalExpansion;after:ThermalFoundation")
|
2013-07-26 21:18:53 -07:00
|
|
|
public class TConstruct
|
|
|
|
|
{
|
2014-08-16 02:17:52 -08:00
|
|
|
public static final String modVersion = "${version}";
|
2013-07-26 21:18:53 -07:00
|
|
|
/** The value of one ingot in millibuckets */
|
|
|
|
|
public static final int ingotLiquidValue = 144;
|
2013-11-04 00:33:39 +01:00
|
|
|
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;
|
2014-10-21 18:13:59 +02:00
|
|
|
public static final int stoneLiquidValue = ingotLiquidValue/8;
|
2013-11-04 00:33:39 +01:00
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
public static final int liquidUpdateAmount = 6;
|
2014-06-08 14:37:02 -04:00
|
|
|
public static final String modID = "TConstruct";
|
|
|
|
|
public static final Logger logger = LogManager.getLogger(modID);
|
2014-06-30 14:57:06 -08:00
|
|
|
public static final PacketPipeline packetPipeline = new PacketPipeline();
|
|
|
|
|
public static Random random = new Random();
|
2014-10-23 14:53:14 +10:30
|
|
|
|
|
|
|
|
|
2013-10-12 23:46:35 +01:00
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
/* Instance of this mod, used for grabbing prototype fields */
|
2014-06-08 14:37:02 -04:00
|
|
|
@Instance(modID)
|
2013-07-26 21:18:53 -07:00
|
|
|
public static TConstruct instance;
|
2014-06-30 14:57:06 -08:00
|
|
|
/* Proxies for sides, used for graphics processing and client controls */
|
2013-07-26 21:18:53 -07:00
|
|
|
@SidedProxy(clientSide = "tconstruct.client.TProxyClient", serverSide = "tconstruct.common.TProxyCommon")
|
|
|
|
|
public static TProxyCommon proxy;
|
|
|
|
|
|
2014-06-30 14:57:06 -08:00
|
|
|
/* Loads modules in a way that doesn't clutter the @Mod list */
|
2014-08-06 20:17:47 +02:00
|
|
|
public static PulseManager pulsar = new PulseManager(modID, new ForgeCFG("TinkersModules", "Modules: Disabling these will disable a chunk of the mod"));
|
2014-02-05 09:11:06 -05:00
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
public TConstruct()
|
|
|
|
|
{
|
|
|
|
|
if (Loader.isModLoaded("Natura"))
|
|
|
|
|
{
|
2014-01-10 17:03:06 -05:00
|
|
|
logger.info("Natura, what are we going to do tomorrow night?");
|
|
|
|
|
LogManager.getLogger("Natura").info("TConstruct, we're going to take over the world!");
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-01-10 17:03:06 -05:00
|
|
|
logger.info("Preparing to take over the world");
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
2013-12-13 16:07:26 -05:00
|
|
|
|
2013-10-22 20:09:21 +01:00
|
|
|
EnvironmentChecks.verifyEnvironmentSanity();
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
|
2014-08-02 15:50:39 -08:00
|
|
|
//Force the client and server to have or not have this mod
|
|
|
|
|
@NetworkCheckHandler()
|
|
|
|
|
public boolean matchModVersions (Map<String, String> remoteVersions, Side side)
|
|
|
|
|
{
|
|
|
|
|
return remoteVersions.containsKey("TConstruct") && modVersion.equals(remoteVersions.get("TConstruct"));
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
{
|
2014-06-30 14:57:06 -08:00
|
|
|
PHConstruct.initProps(event.getModConfigurationDirectory());
|
|
|
|
|
|
2014-07-02 20:27:32 -08:00
|
|
|
pulsar.registerPulse(new TinkerWorld());
|
|
|
|
|
pulsar.registerPulse(new TinkerTools());
|
|
|
|
|
pulsar.registerPulse(new TinkerSmeltery());
|
|
|
|
|
pulsar.registerPulse(new TinkerMechworks());
|
|
|
|
|
pulsar.registerPulse(new TinkerArmor());
|
2014-10-05 20:14:56 +02:00
|
|
|
pulsar.registerPulse(new TinkerWeaponry());
|
2014-08-01 22:48:20 -04:00
|
|
|
pulsar.registerPulse(new TinkerThaumcraft());
|
2014-08-05 22:09:57 -04:00
|
|
|
pulsar.registerPulse(new TinkerWaila());
|
|
|
|
|
pulsar.registerPulse(new TinkerBuildCraft());
|
|
|
|
|
pulsar.registerPulse(new TinkerAE2());
|
|
|
|
|
pulsar.registerPulse(new TinkerIC2());
|
|
|
|
|
pulsar.registerPulse(new TinkerMystcraft());
|
|
|
|
|
pulsar.registerPulse(new TinkerMFR());
|
|
|
|
|
pulsar.registerPulse(new TinkerTE4());
|
2014-12-02 21:34:09 +01:00
|
|
|
pulsar.registerPulse(new TinkerFMP());
|
2014-07-02 20:27:32 -08:00
|
|
|
/*pulsar.registerPulse(new TinkerPrayers());
|
|
|
|
|
pulsar.registerPulse(new TinkerCropify());*/
|
2014-02-05 09:11:06 -05:00
|
|
|
|
2014-07-05 22:06:38 -08:00
|
|
|
TConstructRegistry.materialTab = new TConstructCreativeTab("TConstructMaterials");
|
|
|
|
|
TConstructRegistry.toolTab = new TConstructCreativeTab("TConstructTools");
|
|
|
|
|
TConstructRegistry.partTab = new TConstructCreativeTab("TConstructParts");
|
|
|
|
|
TConstructRegistry.blockTab = new TConstructCreativeTab("TConstructBlocks");
|
|
|
|
|
TConstructRegistry.equipableTab = new TConstructCreativeTab("TConstructEquipables");
|
2014-10-05 22:19:04 +02:00
|
|
|
TConstructRegistry.weaponryTab = new TConstructCreativeTab("TConstructWeaponry");
|
2013-07-26 21:18:53 -07:00
|
|
|
|
|
|
|
|
tableCasting = new LiquidCasting();
|
|
|
|
|
basinCasting = new LiquidCasting();
|
|
|
|
|
chiselDetailing = new Detailing();
|
|
|
|
|
|
2014-06-04 21:44:48 -08:00
|
|
|
//GameRegistry.registerFuelHandler(content);
|
2013-07-26 21:18:53 -07:00
|
|
|
|
|
|
|
|
playerTracker = new TPlayerHandler();
|
2014-02-16 14:23:50 -05:00
|
|
|
// GameRegistry.registerPlayerTracker(playerTracker);
|
2014-02-04 18:00:13 -05:00
|
|
|
FMLCommonHandler.instance().bus().register(playerTracker);
|
2014-03-06 21:55:46 +11:00
|
|
|
MinecraftForge.EVENT_BUS.register(playerTracker);
|
2014-06-30 14:57:06 -08:00
|
|
|
NetworkRegistry.INSTANCE.registerGuiHandler(TConstruct.instance, proxy);
|
2014-02-05 09:11:06 -05:00
|
|
|
|
2014-06-30 14:57:06 -08:00
|
|
|
pulsar.preInit(event);
|
2014-07-13 13:58:04 +03:00
|
|
|
|
2014-09-09 18:30:15 +10:00
|
|
|
if (PHConstruct.achievementsEnabled)
|
|
|
|
|
{
|
|
|
|
|
TAchievements.addDefaultAchievements();
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-13 13:58:04 +03:00
|
|
|
if (PHConstruct.addToVillages)
|
|
|
|
|
{
|
|
|
|
|
// adds to the villager spawner egg
|
|
|
|
|
VillagerRegistry.instance().registerVillagerId(78943);
|
|
|
|
|
// moved down, not needed if 'addToVillages' is false
|
2015-01-02 21:04:03 +01:00
|
|
|
if(PHConstruct.allowVillagerTrading)
|
|
|
|
|
VillagerRegistry.instance().registerVillageTradeHandler(78943, new TVillageTrades());
|
|
|
|
|
|
2014-07-13 13:58:04 +03:00
|
|
|
VillagerRegistry.instance().registerVillageCreationHandler(new VillageToolStationHandler());
|
|
|
|
|
VillagerRegistry.instance().registerVillageCreationHandler(new VillageSmelteryHandler());
|
|
|
|
|
MapGenStructureIO.func_143031_a(ComponentToolWorkshop.class, "TConstruct:ToolWorkshopStructure");
|
|
|
|
|
MapGenStructureIO.func_143031_a(ComponentSmeltery.class, "TConstruct:SmelteryStructure");
|
|
|
|
|
}
|
2014-09-09 18:30:15 +10:00
|
|
|
|
|
|
|
|
TConstructAPI.PROP_NAME = TPlayerStats.PROP_NAME;
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@EventHandler
|
2013-09-28 08:45:28 -07:00
|
|
|
public void init (FMLInitializationEvent event)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2014-02-05 09:11:06 -05:00
|
|
|
packetPipeline.initalise();
|
2013-08-31 05:13:31 -07:00
|
|
|
if (event.getSide() == Side.CLIENT)
|
|
|
|
|
{
|
2014-06-25 21:01:20 -04:00
|
|
|
//MinecraftForge.EVENT_BUS.register(new EventCloakRender());
|
2013-08-31 05:13:31 -07:00
|
|
|
}
|
|
|
|
|
|
2013-11-30 17:06:50 +00:00
|
|
|
DimensionBlacklist.getBadBimensions();
|
2014-06-04 21:44:48 -08:00
|
|
|
GameRegistry.registerWorldGenerator(new SlimeIslandGen(TinkerWorld.slimePool, 2), 2);
|
2013-11-16 16:34:38 +00:00
|
|
|
|
2014-06-30 14:57:06 -08:00
|
|
|
pulsar.init(event);
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@EventHandler
|
2014-06-30 14:57:06 -08:00
|
|
|
public void postInit (FMLPostInitializationEvent event)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2014-01-28 20:50:29 +11:00
|
|
|
packetPipeline.postInitialise();
|
2013-08-31 05:13:31 -07:00
|
|
|
Behavior.registerBuiltInBehaviors();
|
|
|
|
|
SpecialStackHandler.registerBuiltInStackHandlers();
|
2013-11-16 16:34:38 +00:00
|
|
|
|
2014-06-30 14:57:06 -08:00
|
|
|
proxy.initialize();
|
|
|
|
|
pulsar.postInit(event);
|
2014-09-09 18:30:15 +10:00
|
|
|
|
|
|
|
|
if (PHConstruct.achievementsEnabled)
|
|
|
|
|
{
|
|
|
|
|
TAchievements.registerAchievementPane();
|
|
|
|
|
MinecraftForge.EVENT_BUS.register(new AchievementEvents());
|
|
|
|
|
}
|
2013-09-28 08:45:28 -07:00
|
|
|
}
|
2013-07-26 21:18:53 -07:00
|
|
|
|
2014-09-22 16:02:16 +02:00
|
|
|
/* IMC Mod Support */
|
|
|
|
|
@EventHandler
|
|
|
|
|
public void handleIMC(FMLInterModComms.IMCEvent e)
|
|
|
|
|
{
|
|
|
|
|
IMCHandler.processIMC(e.getMessages());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
|
public void loadComplete(FMLLoadCompleteEvent evt)
|
|
|
|
|
{
|
|
|
|
|
IMCHandler.processIMC(FMLInterModComms.fetchRuntimeMessages(this));
|
|
|
|
|
}
|
|
|
|
|
|
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 TPlayerHandler playerTracker;
|
|
|
|
|
public static LiquidCasting tableCasting;
|
|
|
|
|
public static LiquidCasting basinCasting;
|
|
|
|
|
public static Detailing chiselDetailing;
|
|
|
|
|
}
|