diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-07-06 22:32:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 22:32:58 -0400 |
commit | 7ed302d086bb7ec229f39dcbcb3c3370253404b4 (patch) | |
tree | 120c662e201c275fb5de5b970a455091e0400d2d /me/Danker/ToggleCommand.java | |
parent | c1d2bca1cf22e2ff048ac6f0eb33b585dc3807d9 (diff) | |
download | SkyblockMod-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/ToggleCommand.java')
-rw-r--r-- | me/Danker/ToggleCommand.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/me/Danker/ToggleCommand.java b/me/Danker/ToggleCommand.java index d24c399..8c27da6 100644 --- a/me/Danker/ToggleCommand.java +++ b/me/Danker/ToggleCommand.java @@ -8,8 +8,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText;
public class ToggleCommand extends CommandBase implements ICommand {
- private static boolean gpartyToggled = true;
- private static boolean coordsToggled = true;
+ public static boolean gpartyToggled;
+ public static boolean coordsToggled;
public boolean getToggle(String type) {
if (type.equals("gparty")) {
@@ -38,6 +38,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override
public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException {
final EntityPlayer player = (EntityPlayer)arg0;
+ final ConfigHandler cf = new ConfigHandler();
if (arg1.length == 0) {
player.addChatMessage(new ChatComponentText("Usage: /toggle [gparty/coords]"));
@@ -46,10 +47,17 @@ public class ToggleCommand extends CommandBase implements ICommand { if (arg1[0].equalsIgnoreCase("gparty")) {
gpartyToggled = !gpartyToggled;
+ cf.writeBooleanConfig("toggles", "GParty", gpartyToggled);
player.addChatMessage(new ChatComponentText("Guild party notifications has been set to " + gpartyToggled + "."));
} else if (arg1[0].equalsIgnoreCase("coords")) {
coordsToggled = !coordsToggled;
+ cf.writeBooleanConfig("toggles", "Coords", coordsToggled);
player.addChatMessage(new ChatComponentText("Coord/Angle display has been set to " + coordsToggled + "."));
+ } else if (arg1[0].equalsIgnoreCase("list")) {
+ player.addChatMessage(new ChatComponentText("Guild party notifications: " + gpartyToggled));
+ player.addChatMessage(new ChatComponentText("Coord/Angle display: " + coordsToggled));
+ } else {
+ player.addChatMessage(new ChatComponentText("Unknown value."));
}
}
}
|