aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java44
1 files changed, 27 insertions, 17 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java b/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java
index e53ba52..7d4be88 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java
@@ -1,45 +1,55 @@
package shcm.shsupercm.fabric.citresewn;
+import io.shcm.shsupercm.fabric.fletchingtable.api.Entrypoint;
import net.fabricmc.api.ClientModInitializer;
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
+import net.fabricmc.loader.api.FabricLoader;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import shcm.shsupercm.fabric.citresewn.config.CITResewnConfig;
+import shcm.shsupercm.fabric.citresewn.cit.CITRegistry;
-@Environment(EnvType.CLIENT)
+/**
+ * Main initializer for CIT Resewn. Contains various internal utilities(just logging for now).
+ */
public class CITResewn implements ClientModInitializer {
public static final Logger LOG = LogManager.getLogger("CITResewn");
- public static CITResewn INSTANCE;
-
- public ActiveCITs activeCITs = null;
-
- public CITResewnConfig config = null;
-
-
- public boolean processingBrokenPaths = false;
+ @Entrypoint(Entrypoint.CLIENT)
+ public static final CITResewn INSTANCE = new CITResewn();
@Override
public void onInitializeClient() {
- INSTANCE = this;
-
- config = CITResewnConfig.read();
+ CITRegistry.registerAll();
- CITResewnCommand.register();
+ if (FabricLoader.getInstance().isModLoaded("fabric-command-api-v1"))
+ CITResewnCommand.register();
}
+ /**
+ * Logs an info line in CIT Resewn's name.
+ * @param message log message
+ */
public static void info(String message) {
LOG.info("[citresewn] " + message);
}
+ /**
+ * Logs a warning line in CIT Resewn's name if enabled in config.
+ * @see CITResewnConfig#mute_warns
+ * @param message warn message
+ */
public static void logWarnLoading(String message) {
- if (CITResewnConfig.INSTANCE().mute_warns)
+ if (CITResewnConfig.INSTANCE.mute_warns)
return;
LOG.error("[citresewn] " + message);
}
+ /**
+ * Logs an error line in CIT Resewn's name if enabled in config.
+ * @see CITResewnConfig#mute_errors
+ * @param message error message
+ */
public static void logErrorLoading(String message) {
- if (CITResewnConfig.INSTANCE().mute_errors)
+ if (CITResewnConfig.INSTANCE.mute_errors)
return;
LOG.error("{citresewn} " + message);
}