Skip to content

Commit

Permalink
[0.45-PRE2] Improve tab-complete support.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamierocks committed Dec 29, 2014
1 parent 875e468 commit 392142e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@
<name>PlayTimeLimiter</name>
<url>https://github.com/UnoModding/Canary-PlayTimeLimiter</url>
<description>PlayTimeLimiter is a CanaryLib plugin for Minecraft servers to only allow players to limit the amount of time players spend on your server.</description>
<version>0.45-PRE</version>
<version>0.45-PRE2</version>
<inceptionYear>2014</inceptionYear>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.jdk.version>1.6</project.jdk.version>
<mainclass>${project.groupId}.${project.artifactId}.${project.name}</mainclass>
</properties>

<repositories>
<repository>
<id>vi-repo</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ public void blacklistRemoveCommand(MessageReceiver caller, String[] args) {
@TabComplete(commands = { "playtime", "pt" })
public List<String> playtimeTabComplete(MessageReceiver caller, String[] parameters) {
if (parameters.length == 1) {
return TabCompleteHelper.matchTo(parameters, new String[] { "start", "stop", "add", "remove", "check",
"blacklist" });
return TabCompleteHelper.matchTo(parameters, new String[] { "start", "stop", "add", "remove", "set",
"check", "blacklist" });
} else if (parameters.length == 2
&& (parameters[1].equals("add") || parameters[1].equals("remove") || parameters[1].equals("check"))) {
&& (parameters[1].equals("add") || parameters[1].equals("remove") || parameters[1].equals("check")
|| parameters[1].equals("set"))) {
return TabCompleteHelper.matchTo(parameters, Canary.getServer().getKnownPlayerNames());
} else if(parameters.length == 2 && parameters[1].equals("blacklist")) {
return TabCompleteHelper.matchTo(parameters, new String[] { "add", "remove" });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ public boolean enable() {
getConfig().setBoolean("timeTravels", true);
getConfig().save();
}
if (!getConfig().containsKey("timeCap")) {
/*if (!getConfig().containsKey("timeCap")) {
getConfig().setBoolean("timeCap", true);
getConfig().save();
}
if (!getConfig().containsKey("timeCapValue")) {
getConfig().setInt("timeCapValue", 18000);
getConfig().save();
}
}*/
if (!getConfig().containsKey("blacklist")) {
getConfig().setBoolean("blacklist", false);
getConfig().save();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/Canary.inf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name=${project.name}
main-class=unomodding.canary.playtimelimiter.PlayTimeLimiter
main-class=$(mainclass}
author=UnoModding
version=${project.version}

0 comments on commit 392142e

Please sign in to comment.