Skip to content

feat: add config option to disable PAPI warnings #260

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

Merged
merged 1 commit into from
Apr 20, 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.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
Loading