Skip to content

Commit

Permalink
* Added information appliance for immediate recursion on constructed …
Browse files Browse the repository at this point in the history
…tasks.
  • Loading branch information
Hempfest committed Feb 27, 2021
1 parent 6339198 commit 00602be
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.sanctum.Labyrinth</groupId>
<artifactId>Labyrinth</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<packaging>jar</packaging>

<name>Labyrinth</name>
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/github/sanctum/labyrinth/task/Asynchronous.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ public Asynchronous cancelAfter(Player p) {
return this;
}

/**
* Automatically cancel the task from a specified pre-condition.
*
* <p>This will simply cancel the task of your own will @ pre-condition.</p>
*
* @param condition The condition to fire the cancellation
* @return The same synchronous task builder.
*/
public Asynchronous cancelAfter(boolean condition) {
this.check = condition;
return this;
}

/**
* Automatically cancel the task after a specified amount of executions
*
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/github/sanctum/labyrinth/task/Synchronous.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ public Synchronous cancelAfter(Player p) {
return this;
}

/**
* Automatically cancel the task from a specified pre-condition.
*
* <p>This will simply cancel the task of your own will @ pre-condition.</p>
*
* @param condition The condition to fire the cancellation
* @return The same synchronous task builder.
*/
public Synchronous cancelAfter(boolean condition) {
this.check = condition;
return this;
}

/**
* Automatically cancel the task after a specified amount of executions
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Labyrinth
version: 1.3.0
version: 1.3.1
main: com.github.sanctum.labyrinth.Labyrinth
prefix: Labyrinth
api-version: 1.13
Expand Down

0 comments on commit 00602be

Please sign in to comment.