aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/eu/olli/cowmoonication/Cowmoonication.java
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2020-03-08 00:12:57 +0100
committerCow <cow@volloeko.de>2020-03-08 00:12:57 +0100
commit0a105c807a3f8040ada76c4e4edac4a79fe32fe6 (patch)
treeb0631894c6547b2fe3daf73539fec6935dd9659d /src/main/java/eu/olli/cowmoonication/Cowmoonication.java
parent508f872ba076f4e767ff2c374656bc47637eb229 (diff)
downloadCowlection-0a105c807a3f8040ada76c4e4edac4a79fe32fe6.tar.gz
Cowlection-0a105c807a3f8040ada76c4e4edac4a79fe32fe6.tar.bz2
Cowlection-0a105c807a3f8040ada76c4e4edac4a79fe32fe6.zip
Added mod update notification (opt-out via /moo config)
Standardized versioning (now includes Minecraft version) Bug fixes: - Reduced greediness of login/logout notification detection
Diffstat (limited to 'src/main/java/eu/olli/cowmoonication/Cowmoonication.java')
-rw-r--r--src/main/java/eu/olli/cowmoonication/Cowmoonication.java26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/main/java/eu/olli/cowmoonication/Cowmoonication.java b/src/main/java/eu/olli/cowmoonication/Cowmoonication.java
index 3a93fe6..78f1905 100644
--- a/src/main/java/eu/olli/cowmoonication/Cowmoonication.java
+++ b/src/main/java/eu/olli/cowmoonication/Cowmoonication.java
@@ -3,24 +3,32 @@ package eu.olli.cowmoonication;
import eu.olli.cowmoonication.command.MooCommand;
import eu.olli.cowmoonication.config.MooConfig;
import eu.olli.cowmoonication.listener.ChatListener;
+import eu.olli.cowmoonication.listener.PlayerListener;
import eu.olli.cowmoonication.util.Utils;
+import eu.olli.cowmoonication.util.VersionChecker;
import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
+import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import org.apache.logging.log4j.Logger;
import java.io.File;
-@Mod(modid = Cowmoonication.MODID, version = Cowmoonication.VERSION, clientSideOnly = true, guiFactory = "eu.olli." + Cowmoonication.MODID + ".config.MooGuiFactory")
+@Mod(modid = Cowmoonication.MODID, name = Cowmoonication.MODNAME, version = Cowmoonication.VERSION,
+ clientSideOnly = true,
+ guiFactory = "eu.olli." + Cowmoonication.MODID + ".config.MooGuiFactory",
+ updateJSON = "https://raw.githubusercontent.com/cow-mc/Cowmoonication/master/update.json")
public class Cowmoonication {
public static final String MODID = "cowmoonication";
- public static final String VERSION = "1.0";
+ public static final String VERSION = "1.8.9-0.2.0";
+ public static final String MODNAME = "Cowmoonication";
private MooConfig config;
private Friends friends;
+ private VersionChecker versionChecker;
private Utils utils;
private Logger logger;
@@ -35,16 +43,23 @@ public class Cowmoonication {
friends = new Friends(this);
config = new MooConfig(new Configuration(new File(modDir, MODID + ".cfg")), this);
+
+ utils = new Utils(this, e.getSourceFile());
}
@EventHandler
public void init(FMLInitializationEvent e) {
- utils = new Utils(this);
MinecraftForge.EVENT_BUS.register(new ChatListener(this));
+ MinecraftForge.EVENT_BUS.register(new PlayerListener(this));
ClientCommandHandler.instance.registerCommand(new MooCommand(this));
}
+ @EventHandler
+ public void postInit(FMLPostInitializationEvent e) {
+ versionChecker = new VersionChecker(this);
+ }
+
public MooConfig getConfig() {
return config;
}
@@ -53,6 +68,10 @@ public class Cowmoonication {
return friends;
}
+ public VersionChecker getVersionChecker() {
+ return versionChecker;
+ }
+
public Utils getUtils() {
return utils;
}
@@ -60,5 +79,4 @@ public class Cowmoonication {
public Logger getLogger() {
return logger;
}
-
}