mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-18 19:39:12 +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
@@ -6,18 +6,19 @@ package tconstruct.plugins;
|
||||
* Do not include mod API usage directly in this file except for IMC! This must be constructable even
|
||||
* when the target mod isn't available due to Java not allowing static abstracts.
|
||||
*/
|
||||
public interface ICompatPlugin {
|
||||
public interface ICompatPlugin
|
||||
{
|
||||
|
||||
// Mod ID the plugin handles
|
||||
public abstract String getModId();
|
||||
public abstract String getModId ();
|
||||
|
||||
// Called during TCon PreInit
|
||||
public abstract void preInit();
|
||||
public abstract void preInit ();
|
||||
|
||||
// Called during TCon Init
|
||||
public abstract void init();
|
||||
public abstract void init ();
|
||||
|
||||
// Called during TCon PostInit
|
||||
public abstract void postInit();
|
||||
public abstract void postInit ();
|
||||
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,27 +16,32 @@ import tconstruct.plugins.ICompatPlugin;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class IC2 implements ICompatPlugin {
|
||||
public class IC2 implements ICompatPlugin
|
||||
{
|
||||
|
||||
private static final String IC2_UUM_FLUIDNAME = "uumatter";
|
||||
private Fluid fluidUUM;
|
||||
|
||||
@Override
|
||||
public String getModId() {
|
||||
public String getModId ()
|
||||
{
|
||||
return "IC2";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
public void preInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("[IC2] Preparing for shenanigans.");
|
||||
|
||||
fluidUUM = FluidRegistry.getFluid(IC2_UUM_FLUIDNAME);
|
||||
if (fluidUUM == null) return;
|
||||
if (fluidUUM == null)
|
||||
return;
|
||||
|
||||
// Useful stuff
|
||||
//ItemStack ingotCast = new ItemStack(TRepo.metalPattern, 1, 0);
|
||||
@@ -71,7 +76,8 @@ public class IC2 implements ICompatPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,25 +7,28 @@ import tconstruct.plugins.ICompatPlugin;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class AppEng implements ICompatPlugin {
|
||||
public class AppEng implements ICompatPlugin
|
||||
{
|
||||
|
||||
private static List<String> spatialIOLogics = Arrays.asList("AdaptiveSmelteryLogic", "AqueductLogic", "CastingBasinLogic", "CastingChannelLogic", "CastingTableLogic",
|
||||
"CraftingStationLogic", "DryingRackLogic", "EssenceExtractorLogic", "FaucetLogic", "FrypanLogic", "GolemPedestalLogic", "LavaTankLogic", "PartBuilderLogic",
|
||||
"PatternChestLogic", "SmelteryDrainLogic", "SmelteryLogic", "StencilTableLogic", "TankAirLogic", "TileEntityLandmine", "ToolForgeLogic", "ToolStationLogic",
|
||||
"TowerFurnaceLogic", "MultiServantLogic");
|
||||
private static List<String> spatialIOLogics = Arrays.asList("AdaptiveSmelteryLogic", "AqueductLogic", "CastingBasinLogic", "CastingChannelLogic", "CastingTableLogic", "CraftingStationLogic",
|
||||
"DryingRackLogic", "EssenceExtractorLogic", "FaucetLogic", "FrypanLogic", "GolemPedestalLogic", "LavaTankLogic", "PartBuilderLogic", "PatternChestLogic", "SmelteryDrainLogic",
|
||||
"SmelteryLogic", "StencilTableLogic", "TankAirLogic", "TileEntityLandmine", "ToolForgeLogic", "ToolStationLogic", "TowerFurnaceLogic", "MultiServantLogic");
|
||||
|
||||
@Override
|
||||
public String getModId() {
|
||||
public String getModId ()
|
||||
{
|
||||
return "AppliedEnergistics";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
public void preInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("[AppEng] Registering for Spatial IO.");
|
||||
for (String s : spatialIOLogics)
|
||||
{
|
||||
@@ -34,7 +37,8 @@ public class AppEng implements ICompatPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,20 +6,24 @@ import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.plugins.ICompatPlugin;
|
||||
|
||||
public class BuildcraftTransport implements ICompatPlugin {
|
||||
public class BuildcraftTransport implements ICompatPlugin
|
||||
{
|
||||
|
||||
@Override
|
||||
public String getModId() {
|
||||
public String getModId ()
|
||||
{
|
||||
return "BuildCraft|Transport";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
public void preInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("[BC|Transport] Registering facades.");
|
||||
// Smeltery Blocks
|
||||
addFacade(TRepo.smeltery, 2);
|
||||
@@ -61,7 +65,8 @@ public class BuildcraftTransport implements ICompatPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,29 +5,35 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.plugins.ICompatPlugin;
|
||||
|
||||
public class Mystcraft implements ICompatPlugin {
|
||||
public class Mystcraft implements ICompatPlugin
|
||||
{
|
||||
|
||||
private static String[] fluids = new String[] { "invar.molten", "electrum.molten", "bronze.molten", "aluminumbrass.molten", "manyullyn.molten", "alumite.molten", "cobalt.molten",
|
||||
"moltenArdite", "ender", "steel.molten", "platinum.molten" };
|
||||
private static String[] fluids = new String[] { "invar.molten", "electrum.molten", "bronze.molten", "aluminumbrass.molten", "manyullyn.molten", "alumite.molten", "cobalt.molten", "moltenArdite",
|
||||
"ender", "steel.molten", "platinum.molten" };
|
||||
|
||||
@Override
|
||||
public String getModId() {
|
||||
public String getModId ()
|
||||
{
|
||||
return "Mystcraft";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
public void preInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("[Mystcraft] Blacklisting Mystcraft fluid symbols.");
|
||||
for (String nm : fluids) sendFluidBlacklist(nm);
|
||||
for (String nm : fluids)
|
||||
sendFluidBlacklist(nm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,20 +6,24 @@ import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.plugins.ICompatPlugin;
|
||||
|
||||
public class Thaumcraft implements ICompatPlugin {
|
||||
public class Thaumcraft implements ICompatPlugin
|
||||
{
|
||||
|
||||
@Override
|
||||
public String getModId() {
|
||||
public String getModId ()
|
||||
{
|
||||
return "Thaumcraft";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
public void preInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("[Thaumcraft] Registering harvestables.");
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TRepo.oreBerry, 1, 12));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TRepo.oreBerry, 1, 13));
|
||||
@@ -30,7 +34,8 @@ public class Thaumcraft implements ICompatPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user