mirror of
https://github.com/GTNewHorizons/WirelessCraftingTerminal.git
synced 2026-11-26 06:42:55 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
67757e72c9
commit
d8da552c36
86 files changed
+1026
-943
No files matched your search
+10
-9
@@ -1,10 +1,12 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.integration;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import net.p455w0rd.wirelesscraftingterminal.api.exceptions.ModNotInstalled;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.ModAPIManager;
|
||||
import java.lang.reflect.Field;
|
||||
import net.p455w0rd.wirelesscraftingterminal.api.exceptions.ModNotInstalled;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
|
||||
|
||||
public final class IntegrationNode {
|
||||
|
||||
@@ -22,8 +24,8 @@ public final class IntegrationNode {
|
||||
private Object instance;
|
||||
private IIntegrationModule mod = null;
|
||||
|
||||
public IntegrationNode(
|
||||
final String displayName, final String modID, final IntegrationType shortName, final String name) {
|
||||
public IntegrationNode(final String displayName, final String modID, final IntegrationType shortName,
|
||||
final String name) {
|
||||
this.displayName = displayName;
|
||||
this.shortName = shortName;
|
||||
this.modID = modID;
|
||||
@@ -53,13 +55,12 @@ public final class IntegrationNode {
|
||||
switch (stage) {
|
||||
case PRE_INIT:
|
||||
final ModAPIManager apiManager = ModAPIManager.INSTANCE;
|
||||
boolean enabled =
|
||||
this.modID == null || Loader.isModLoaded(this.modID) || apiManager.hasAPI(this.modID);
|
||||
boolean enabled = this.modID == null || Loader.isModLoaded(this.modID)
|
||||
|| apiManager.hasAPI(this.modID);
|
||||
|
||||
if (enabled) {
|
||||
this.classValue = this.getClass().getClassLoader().loadClass(this.name);
|
||||
this.mod = (IIntegrationModule)
|
||||
this.classValue.getConstructor().newInstance();
|
||||
this.mod = (IIntegrationModule) this.classValue.getConstructor().newInstance();
|
||||
final Field f = this.classValue.getField("instance");
|
||||
f.set(this.classValue, this.setInstance(this.mod));
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user