Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/next task placeholder #266

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: me.playbosswar.com.CommandTimerPlugin
name: "CommandTimer"
version: "8.5.7"
version: "8.6.0"
description: "Schedule commands like you want"
author: PlayBossWar
api-version: 1.13
Expand Down
Loading