Skip to content

Commit

Permalink
amend already opened/closed message
Browse files Browse the repository at this point in the history
  • Loading branch information
kory33 committed Apr 10, 2017
1 parent 77d4473 commit 786eab2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean onCommand(CommandSender sender, Command command, ArrayList<String
}

if (!targetVoteSession.isOpen()) {
sender.sendMessage(this.messageConfiguration.getString(MessageConfigurationNodes.SESSION_ALREADY_CLOSED));
sender.sendMessage(this.messageConfiguration.getFormatted(MessageConfigurationNodes.F_SESSION_ALREADY_CLOSED, closeTargetSessionName));
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ public boolean onCommand(CommandSender sender, Command command, ArrayList<String
return false;
}

String closeTargetSessionName = args.remove(0);
VoteSession targetVoteSession = this.voteSessionManager.getVoteSession(closeTargetSessionName);
String openTargetSessionName = args.remove(0);
VoteSession targetVoteSession = this.voteSessionManager.getVoteSession(openTargetSessionName);

if (targetVoteSession == null) {
sender.sendMessage(this.messageConfiguration.getString(MessageConfigurationNodes.SESSION_DOES_NOT_EXIST));
return true;
}

if (targetVoteSession.isOpen()) {
sender.sendMessage(this.messageConfiguration.getString(MessageConfigurationNodes.SESSION_ALREADY_OPENED));
sender.sendMessage(this.messageConfiguration.getFormatted(MessageConfigurationNodes.F_SESSION_ALREADY_OPENED, openTargetSessionName));
return true;
}

targetVoteSession.setOpen(true);
String completionMessage = this.messageConfiguration.getFormatted(MessageConfigurationNodes.F_SESSION_OPENED, closeTargetSessionName);
String completionMessage = this.messageConfiguration.getFormatted(MessageConfigurationNodes.F_SESSION_OPENED, openTargetSessionName);
sender.sendMessage(completionMessage);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public class MessageConfigurationNodes {

public static final String OPEN_COMMAND_HELP = COMMAND_ROOT + ".open.help";
public static final String F_SESSION_OPENED = COMMAND_ROOT + ".open.opened";
public static final String SESSION_ALREADY_OPENED = COMMAND_ROOT + ".open.error.alreadyopened";
public static final String F_SESSION_ALREADY_OPENED = COMMAND_ROOT + ".open.error.alreadyopened";

public static final String CLOSE_COMMAND_HELP = COMMAND_ROOT + ".close.help";
public static final String F_SESSION_CLOSED = COMMAND_ROOT + ".close.closed";
public static final String SESSION_ALREADY_CLOSED = COMMAND_ROOT + ".close.error.alreadyclosed";
public static final String F_SESSION_ALREADY_CLOSED = COMMAND_ROOT + ".close.error.alreadyclosed";

public static final String VOTE_COMMAND_HELP = COMMAND_ROOT + ".vote.help";
public static final String VOTED = COMMAND_ROOT + ".vote.voteaccepted";
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"help": "/signvote open <session name> - re-open a closed session",
"opened": "§aSession §6{0} §ais set to be §6OPENED",
"error": {
"alreadyopened": "§cThe provided session is already open!"
"alreadyopened": "§aSession §6{0} §ais already §6OPENED"
}
},
"close": {
"help": "/signvote close <session name> - close an opened session",
"closed": "§aSession §6{0} §ais set to be §6CLOSED",
"error": {
"alreadyclosed": "§cThe provided session is already closed!"
"alreadycloseed": "§aSession §6{0} §ais already §6CLOSED"
}
},
"vote": {
Expand Down

0 comments on commit 786eab2

Please sign in to comment.