Skip to content

Commit

Permalink
feat: add config option to disable PAPI warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
titivermeesch committed Apr 20, 2024
1 parent 1325ff8 commit fec9428
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 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.6'
version = '8.5.7'
description = 'CommandTimer'

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

from components.java
}
Expand Down
12 changes: 12 additions & 0 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ Clicking the paper will create a fresh task for you.
| `/cmt deactivate <task>` | Disable the specified task | `commandtimer.deactivate` or `commandtimer.toggle` |
| `/cmt execute <task>` | Instantly execute the specified task | `commandtimer.execute` |
| `/cmt reload` | Reload the plugin. Extensions will not be reloaded. **It is not recommended to use this command** | `commandtimer.manage` |

## Configuration file

The global configuration file allows you to change the global behaviour of CommandTimer:

- `timeonload`: Show the current server time in the console when the plugin loads
- `debug`: Enable debug mode. This will print additional information to the console
- `showUpdateMessage`: Show a message in the chat when a plugin update is available
- `timezoneOverwrite`: Overwrite the timezone of the server (**This feature does not work right now**)
- `timezoneOverwriteValue`: The timezone to overwrite the server timezone with (**This feature does not work right now**)
- `language`: The language to use for the plugin. You can add more languages under the `languages` folder
- `disablePapiPlaceholderWarnings`: Disable the warning message that appears when a PAPI placeholder is not used correctly
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.6'
version = '8.5.7'
description = 'CommandTimer'

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

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 @@ -64,6 +64,10 @@ public String onPlaceholderRequest(Player player, @NotNull String identifier) {
}

if(task == null) {
if(CommandTimerPlugin.getInstance().getConfig().getBoolean("disablePapiPlaceholderWarnings")) {
return fallbackMessage;
}

Messages.sendConsole("Tried to use PAPI placeholder for unknown task:" + placeholder.getTaskName());
return fallbackMessage;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ debug: false
showUpdateMessage: true
timezoneOverwrite: false
timezoneOverwriteValue: 'GMT'
language: 'en'
language: 'en'
disablePapiPlaceholderWarnings: false
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.6"
version: "8.5.7"
description: "Schedule commands like you want"
author: PlayBossWar
api-version: 1.13
Expand Down

0 comments on commit fec9428

Please sign in to comment.