aboutsummaryrefslogtreecommitdiff
path: root/me/Danker/ToggleCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'me/Danker/ToggleCommand.java')
-rw-r--r--me/Danker/ToggleCommand.java12
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."));
}
}
}