Skip to content

Commit

Permalink
[0.4-PRE] Add timeTravels option.
Browse files Browse the repository at this point in the history
I haven't got chance to test this, except fixing a bug from the Bukkit version.
  • Loading branch information
jamierocks committed Dec 14, 2014
1 parent da41278 commit f3b9215
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
21 changes: 20 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<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.3</version>
<version>0.4-PRE</version>
<inceptionYear>2014</inceptionYear>

<repositories>
Expand Down Expand Up @@ -51,6 +51,25 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${mainclass}</mainClass>
</manifest>
<manifestEntries>
<Implementation-Vender>UnoModding</Implementation-Vender>
<Implementation-Version>${project.version}</Implementation-Version>
<Built-By>${user.name}</Built-By>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ public boolean enable() {
getConfig().setInt("secondsBetweenPlayTimeSaving", 600);
getConfig().save();
}

if (!getConfig().containsKey("timeTravels")) {
getConfig().setBoolean("timeTravels", true);
getConfig().save();
}

getLogman()
.info(String.format(
Expand Down Expand Up @@ -143,7 +148,11 @@ public int getTimeAllowedInSeconds() {
// set amount of
// seconds to the time allowed
while (secondsSince >= 0) {
secondsAllowed += getConfig().getInt("timePerDay");
if (getConfig().getBoolean("timeTravels")) {
secondsAllowed += getConfig().getInt("timePerDay");
} else {
secondsAllowed = getConfig().getInt("timePerDay");
}
secondsSince -= 86400;
}

Expand Down

0 comments on commit f3b9215

Please sign in to comment.