mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-18 03:25:10 +00:00
run repo through formatter
This commit is contained in:
1 parent
5585d680a3
commit
ffaea7d4b7
140 files changed
+1050
-892
No files matched your search
@@ -15,7 +15,8 @@ import java.util.*;
|
||||
public class PluginController
|
||||
{
|
||||
|
||||
private enum Phase {
|
||||
private enum Phase
|
||||
{
|
||||
PRELAUNCH, PREINIT, INIT, POSTINIT, DONE
|
||||
}
|
||||
|
||||
@@ -24,15 +25,17 @@ public class PluginController
|
||||
private List<ICompatPlugin> plugins = new LinkedList<ICompatPlugin>();
|
||||
private Phase currPhase = Phase.PRELAUNCH;
|
||||
|
||||
private PluginController() {
|
||||
private PluginController()
|
||||
{
|
||||
String path = Loader.instance().getConfigDir().toString() + File.separator + "TDynstruct.cfg";
|
||||
TConstruct.logger.info("[PluginController] Using config path: " + path);
|
||||
conf = new Configuration(new File(path));
|
||||
}
|
||||
|
||||
public static PluginController getController()
|
||||
public static PluginController getController ()
|
||||
{
|
||||
if (instance == null) instance = new PluginController();
|
||||
if (instance == null)
|
||||
instance = new PluginController();
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -44,7 +47,7 @@ public class PluginController
|
||||
*
|
||||
* @param plugin Plugin to register
|
||||
*/
|
||||
public void registerPlugin(ICompatPlugin plugin)
|
||||
public void registerPlugin (ICompatPlugin plugin)
|
||||
{
|
||||
conf.load();
|
||||
boolean shouldLoad = conf.get("Plugins", plugin.getModId(), true).getBoolean(true);
|
||||
@@ -55,53 +58,58 @@ public class PluginController
|
||||
}
|
||||
|
||||
// This does the actual plugin loading if mod is present; needed to allow force-enabling.
|
||||
private void loadPlugin(ICompatPlugin plugin)
|
||||
private void loadPlugin (ICompatPlugin plugin)
|
||||
{
|
||||
if (!Loader.isModLoaded(plugin.getModId())) return;
|
||||
if (!Loader.isModLoaded(plugin.getModId()))
|
||||
return;
|
||||
|
||||
TConstruct.logger.info("[PluginController] Registering compat plugin for " + plugin.getModId());
|
||||
plugins.add(plugin);
|
||||
|
||||
switch (currPhase) // Play catch-up if plugin is registered late
|
||||
switch (currPhase)
|
||||
// Play catch-up if plugin is registered late
|
||||
{
|
||||
case DONE:
|
||||
case POSTINIT:
|
||||
plugin.preInit();
|
||||
plugin.init();
|
||||
plugin.postInit();
|
||||
break;
|
||||
case INIT:
|
||||
plugin.preInit();
|
||||
plugin.init();
|
||||
break;
|
||||
case PREINIT:
|
||||
plugin.preInit();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case DONE:
|
||||
case POSTINIT:
|
||||
plugin.preInit();
|
||||
plugin.init();
|
||||
plugin.postInit();
|
||||
break;
|
||||
case INIT:
|
||||
plugin.preInit();
|
||||
plugin.init();
|
||||
break;
|
||||
case PREINIT:
|
||||
plugin.preInit();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void preInit()
|
||||
public void preInit ()
|
||||
{
|
||||
currPhase = Phase.PREINIT;
|
||||
for (ICompatPlugin pl : plugins) pl.preInit();
|
||||
for (ICompatPlugin pl : plugins)
|
||||
pl.preInit();
|
||||
}
|
||||
|
||||
public void init()
|
||||
public void init ()
|
||||
{
|
||||
currPhase = Phase.INIT;
|
||||
for (ICompatPlugin pl : plugins) pl.init();
|
||||
for (ICompatPlugin pl : plugins)
|
||||
pl.init();
|
||||
}
|
||||
|
||||
public void postInit()
|
||||
public void postInit ()
|
||||
{
|
||||
currPhase = Phase.POSTINIT;
|
||||
for (ICompatPlugin pl : plugins) pl.postInit();
|
||||
for (ICompatPlugin pl : plugins)
|
||||
pl.postInit();
|
||||
currPhase = Phase.DONE;
|
||||
}
|
||||
|
||||
public void registerBuiltins()
|
||||
public void registerBuiltins ()
|
||||
{
|
||||
// Mystcraft is pushed in through the backdoor so it can't be disabled.
|
||||
loadPlugin(new Mystcraft());
|
||||
@@ -110,10 +118,10 @@ public class PluginController
|
||||
registerPlugin(new BuildcraftTransport());
|
||||
//registerPlugin(new ForgeMultiPart());
|
||||
registerPlugin(new IC2());
|
||||
// registerPlugin(new MineFactoryReloaded());
|
||||
// registerPlugin(new MineFactoryReloaded());
|
||||
//registerPlugin(new NotEnoughItems());
|
||||
registerPlugin(new Thaumcraft());
|
||||
// registerPlugin(new Waila());
|
||||
// registerPlugin(new Waila());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user