mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-17 09:55:02 +00:00
Begin working on the update checker
Also added a config for toggling internet capabilities
This commit is contained in:
5 files changed
+135
No files matched your search
@@ -1,14 +1,20 @@
|
||||
package com.falsepattern.lib.internal;
|
||||
|
||||
import com.falsepattern.lib.config.ConfigException;
|
||||
import com.falsepattern.lib.config.ConfigurationManager;
|
||||
import com.falsepattern.lib.util.ResourceUtil;
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import cpw.mods.fml.common.DummyModContainer;
|
||||
import cpw.mods.fml.common.LoadController;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.MetadataCollection;
|
||||
import cpw.mods.fml.common.event.FMLConstructionEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import lombok.Getter;
|
||||
import lombok.SneakyThrows;
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -17,6 +23,7 @@ import org.apache.logging.log4j.Logger;
|
||||
* Utility class used by FalsePatternLib's internal code. This can change between versions without notice, so do not use
|
||||
* this in your code!
|
||||
*/
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
public class FalsePatternLib extends DummyModContainer {
|
||||
@Getter private static final Logger log = LogManager.getLogger(Tags.MODNAME);
|
||||
|
||||
@@ -33,6 +40,16 @@ public class FalsePatternLib extends DummyModContainer {
|
||||
@Subscribe
|
||||
public void construct(FMLConstructionEvent e) {
|
||||
ConfigurationManager.init();
|
||||
try {
|
||||
ConfigurationManager.registerConfig(LibraryConfig.class);
|
||||
} catch (ConfigException ex) {
|
||||
getLog().error("Failed to register " + Tags.MODNAME + " config!", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void postInit(FMLPostInitializationEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.falsepattern.lib.internal;
|
||||
|
||||
import com.falsepattern.lib.config.Config;
|
||||
|
||||
@Config(modid = Tags.MODID)
|
||||
public class LibraryConfig {
|
||||
@Config.Comment({"Used to control whether FalsePatternLib should check for outdated mods.",
|
||||
"If you're building a public modpack, you should turn this off so that your users don't " +
|
||||
"get nagged about outdated mods."})
|
||||
@Config.LangKey("config.falsepatternlib.updatecheck")
|
||||
public static boolean ENABLE_UPDATE_CHECKER = true;
|
||||
|
||||
@Config.Comment({"Used to control whether FalsePatternLib should be allowed to use the internet.",
|
||||
"If this is enabled, library downloads will be blocked.",
|
||||
"Note that if a mod tries to download a library that is not downloaded yet, the game will crash."})
|
||||
@Config.LangKey("config.falsepatternlib.disableinternet")
|
||||
public static boolean ENABLE_LIBRARY_DOWNLOADS = true;
|
||||
}
|
||||
Reference in new issue
Block a user