Skip to content

Commit

Permalink
feat: add nextTaskName placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
titivermeesch committed May 10, 2024
1 parent 813fa36 commit 2e0c348
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ java {
}

group = 'me.playbosswar.com'
version = '8.5.7'
version = '8.6.0'
description = 'CommandTimer'

repositories {
Expand Down Expand Up @@ -61,7 +61,7 @@ publishing {
maven(MavenPublication) {
groupId = 'me.playbosswar.com'
artifactId = 'commandtimer'
version = '8.5.7'
version = '8.6.0'

from components.java
}
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/placeholders.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ to replace `task` with your actual task name.

- `%commandtimer_task_seconds%`: Get the configured [interval](configuration/schedules#intervals) in seconds
- `%commandtimer_task_secondsFormat%`: Same as previous placeholder, but formated as `HH:mm:ss`
- `%commandtimer_ALLTASKS_nextTaskName%`: Show the name of the next task that will be executed
- `%commandtimer_task_nextExecution%`: Get the next execution time in seconds
- `%commandtimer_task_nextExecutionFormat%`: Same as previous placeholder, but formatted in `HH:mm:ss`
- `%commandtimer_task_timeFormat%`: Same as previous placeholder, but you can replace `timeFormat` with a format of your
Expand All @@ -24,7 +25,7 @@ to take into account all active tasks

## Fallback values

`nextExecution`, `nextExecutionFormat` and `timeFormat` can be suffixed with a fallback value in
`nextExecution`, `nextExecutionFormat`, `timeFormat` and `nextTaskName` can be suffixed with a fallback value in
case there is no next execution anymore. For example- `%commandtimer_task_nextExecutionFormat_No next execution%`

## PAPI Placeholders
Expand Down
4 changes: 2 additions & 2 deletions java8-build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ java {
}

group = 'me.playbosswar.com'
version = '8.5.7'
version = '8.6.0'
description = 'CommandTimer'

repositories {
Expand Down Expand Up @@ -69,7 +69,7 @@ publishing {
maven(MavenPublication) {
groupId = 'me.playbosswar.com'
artifactId = 'commandtimer'
version = '8.5.7'
version = '8.6.0'

from components.java
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/me/playbosswar/com/hooks/PAPIPlaceholders.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public String onPlaceholderRequest(Player player, @NotNull String identifier) {
return fallbackMessage;
}

if(placeholder.getPlaceholderType().equals("nextTaskName")) {
return task.getName();
}


if(placeholder.getPlaceholderType().equalsIgnoreCase("seconds")) {
return getSecondsText(task, fallbackMessage, false);
Expand Down

0 comments on commit 2e0c348

Please sign in to comment.