2013-10-04 00:16:04 +01:00
|
|
|
package tconstruct.preloader;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* TConstructLoaderContainer is derived from code graciously provided by AlgorithmX2 of Applied Energistics.
|
|
|
|
|
* The code was adapted for this loader by Sunstrike. Any queries should be directed to him, not AlgorithmX2.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import com.google.common.eventbus.EventBus;
|
|
|
|
|
import cpw.mods.fml.common.DummyModContainer;
|
|
|
|
|
import cpw.mods.fml.common.FMLLog;
|
|
|
|
|
import cpw.mods.fml.common.LoadController;
|
|
|
|
|
import cpw.mods.fml.common.ModMetadata;
|
|
|
|
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|
|
|
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|
|
|
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
|
|
|
|
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
|
|
|
|
|
import net.minecraftforge.event.ForgeSubscribe;
|
2013-10-06 15:46:23 +01:00
|
|
|
import tconstruct.preloader.helpers.PropertyManager;
|
|
|
|
|
import tconstruct.preloader.helpers.PropertyManager.PropAccessException;
|
2013-10-04 00:16:04 +01:00
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
2013-11-10 13:57:35 -08:00
|
|
|
public class TConstructLoaderContainer extends DummyModContainer implements IFMLLoadingPlugin
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
|
2013-11-27 17:14:47 -05:00
|
|
|
private final String[] asmTransformers = new String[] { "tconstruct.preloader.ASMInterfaceRepair" };
|
2013-10-04 00:16:04 +01:00
|
|
|
private final ModMetadata md = new ModMetadata();
|
|
|
|
|
|
2013-10-06 15:46:23 +01:00
|
|
|
public static Logger logger = Logger.getLogger("TCon-Preloader");
|
2013-10-04 00:16:04 +01:00
|
|
|
|
2013-11-10 13:57:35 -08:00
|
|
|
public TConstructLoaderContainer()
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
logger.setParent(FMLLog.getLogger());
|
|
|
|
|
logger.info("Scalpel. Suction. Lumber axe. CLEAR! *zap*");
|
|
|
|
|
logger.info("Constructing preloader (Modules: " + Arrays.toString(asmTransformers) + ")");
|
2013-11-10 13:57:35 -08:00
|
|
|
try
|
|
|
|
|
{
|
2013-10-06 15:46:23 +01:00
|
|
|
PropertyManager.getOrCreateProps();
|
2013-11-10 13:57:35 -08:00
|
|
|
}
|
|
|
|
|
catch (PropAccessException ex)
|
|
|
|
|
{
|
2013-10-06 15:46:23 +01:00
|
|
|
logger.severe("Could not get or create properties file! Assuming defaults.");
|
|
|
|
|
logger.severe(Arrays.toString(ex.getStackTrace()));
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-10 13:57:35 -08:00
|
|
|
if (PropertyManager.asmInterfaceRepair_verboseLog)
|
|
|
|
|
{
|
2013-10-06 15:46:23 +01:00
|
|
|
logger.warning("ASM Interface Repair is set to be verbose, this is NOT GOOD FOR SERVERS, as it will spam the logs!");
|
|
|
|
|
logger.warning("The debug mode is for debug use only. Turn it off unless instructed otherwise by a TCon developer!");
|
|
|
|
|
logger.warning("To reset advanced settings to default, delete the '" + PropertyManager.propFileName + "' file from the config folder.");
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-04 00:16:04 +01:00
|
|
|
md.autogenerated = true;
|
|
|
|
|
md.credits = "AlgorithmX2 (original) and Sunstrike (porting)";
|
|
|
|
|
md.modId = getModId();
|
|
|
|
|
md.version = getVersion();
|
|
|
|
|
md.name = getName();
|
|
|
|
|
md.authorList = Arrays.asList("AlgorithmX2", "Sunstrike");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ForgeSubscribe
|
2013-11-10 13:57:35 -08:00
|
|
|
public void preInit (FMLPreInitializationEvent evt)
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ForgeSubscribe
|
2013-11-10 13:57:35 -08:00
|
|
|
public void init (FMLInitializationEvent evt)
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ForgeSubscribe
|
2013-11-10 13:57:35 -08:00
|
|
|
public void postInit (FMLPostInitializationEvent evt)
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public String getModId ()
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
return "TConstruct-Preloader";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public String getName ()
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
return "Tinkers Corestruct";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public String getVersion ()
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
return "0.0.1";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public String getDisplayVersion ()
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
return getVersion();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public ModMetadata getMetadata ()
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
return md;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public boolean registerBus (EventBus bus, LoadController controller)
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
bus.register(this);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-22 22:44:02 -05:00
|
|
|
|
2013-11-10 13:57:35 -08:00
|
|
|
public String[] getLibraryRequestClass ()
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public String[] getASMTransformerClass ()
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
return asmTransformers;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public String getModContainerClass ()
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
return "tconstruct.preloader.TConstructLoaderContainer";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public String getSetupClass ()
|
|
|
|
|
{
|
2013-10-04 00:16:04 +01:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2013-11-10 13:57:35 -08:00
|
|
|
public void injectData (Map<String, Object> data)
|
|
|
|
|
{
|
|
|
|
|
}
|
2013-10-04 00:16:04 +01:00
|
|
|
}
|