aboutsummaryrefslogtreecommitdiff
path: root/me/Danker/TheMod.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-07-06 22:32:58 -0400
committerGitHub <noreply@github.com>2020-07-06 22:32:58 -0400
commit7ed302d086bb7ec229f39dcbcb3c3370253404b4 (patch)
tree120c662e201c275fb5de5b970a455091e0400d2d /me/Danker/TheMod.java
parentc1d2bca1cf22e2ff048ac6f0eb33b585dc3807d9 (diff)
downloadSkyblockMod-7ed302d086bb7ec229f39dcbcb3c3370253404b4.tar.gz
SkyblockMod-7ed302d086bb7ec229f39dcbcb3c3370253404b4.tar.bz2
SkyblockMod-7ed302d086bb7ec229f39dcbcb3c3370253404b4.zip
Add API key and config
Added /setkey [key] and /getkey commands. Created config to store API key and toggled features.
Diffstat (limited to 'me/Danker/TheMod.java')
-rw-r--r--me/Danker/TheMod.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/me/Danker/TheMod.java b/me/Danker/TheMod.java
index 3e9aa3f..5f98066 100644
--- a/me/Danker/TheMod.java
+++ b/me/Danker/TheMod.java
@@ -22,18 +22,30 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class TheMod
{
public static final String MODID = "Danker's Skyblock Mod";
- public static final String VERSION = "1.1";
+ public static final String VERSION = "1.2";
@EventHandler
public void init(FMLInitializationEvent event)
{
FMLCommonHandler.instance().bus().register(this);
MinecraftForge.EVENT_BUS.register(this);
+
+ // Config init
+ final ConfigHandler cf = new ConfigHandler();
+ if (!cf.hasKey("toggles", "GParty")) cf.writeBooleanConfig("toggles", "GParty", true);
+ if (!cf.hasKey("toggles", "Coords")) cf.writeBooleanConfig("toggles", "Coords", true);
+ if (!cf.hasKey("api", "APIKey")) cf.writeStringConfig("api", "APIKey", "");
+
+ final ToggleCommand tf = new ToggleCommand();
+ tf.gpartyToggled = cf.getBoolean("toggles", "GParty");
+ tf.coordsToggled = cf.getBoolean("toggles", "Coords");
}
@EventHandler
public void preInit(final FMLPreInitializationEvent event) {
ClientCommandHandler.instance.registerCommand(new ToggleCommand());
+ ClientCommandHandler.instance.registerCommand(new SetkeyCommand());
+ ClientCommandHandler.instance.registerCommand(new GetkeyCommand());
}
@SubscribeEvent