Compare commits

...
791 Commits
Author SHA1 Message Date
Andre601 0892f5cd1d Use <_ for contains instead of <- 2024-02-03 17:21:54 +01:00
Andre601 452a7e6dcf Merge pull request 'Update dependency mkdocs-material to v9.5.7' (#218) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/218
2024-02-03 12:02:21 +00:00
Andre601's Renovate Bot 162dd10a73 Update dependency mkdocs-material to v9.5.7 2024-02-03 12:01:15 +00:00
Andre601 35120c5364 Bump version to 7.0.0 2024-01-31 21:42:24 +01:00
Andre601 6c828171d2 Add new operands to use 2024-01-31 21:41:22 +01:00
Andre601 dcc51f8458 [Docs] Improve profiles page 2024-01-30 17:32:10 +01:00
Andre601 1287ca62fe Fix platform for ${server host} 2024-01-29 23:24:18 +00:00
Andre601 1ff439fa95 Use Java's HttpClient for update checks 2024-01-29 16:37:49 +01:00
Andre601 ed0f832b2f Merge pull request 'Update dependency mkdocs-material to v9.5.6' (#217) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/217
2024-01-28 12:02:57 +00:00
Andre601's Renovate Bot b8e6b2acc6 Update dependency mkdocs-material to v9.5.6 2024-01-28 12:01:18 +00:00
Andre601 fba32c91c5 Add page about expressions 2024-01-28 00:20:52 +01:00
Andre601 6505ded12b Use assertEquals(...) for testing 2024-01-27 23:25:17 +01:00
Andre601 53088affcb docs/profiles/index.md aktualisiert 2024-01-27 22:23:00 +00:00
Andre601 9c030764fa Merge pull request 'Update dependency mkdocs-glightbox to v0.3.7' (#215) from renovate/mkdocs-glightbox-0.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/215
2024-01-25 12:06:08 +00:00
Andre601 d5d58f1eea Merge branch 'master' into renovate/mkdocs-glightbox-0.x 2024-01-25 12:05:53 +00:00
Andre601 7181092821 Merge pull request 'Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.3.1' (#216) from renovate/org.apache.httpcomponents.client5-httpclient5-5.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/216
2024-01-25 12:05:37 +00:00
Andre601's Renovate Bot fc5ee4f242 Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.3.1 2024-01-25 12:01:04 +00:00
Andre601's Renovate Bot 6e74c4fb14 Update dependency mkdocs-glightbox to v0.3.7 2024-01-25 12:00:59 +00:00
Andre601 f6a27342e6 Merge pull request 'Update dependency mkdocs-material to v9.5.5' (#214) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/214
2024-01-24 12:17:57 +00:00
Andre601's Renovate Bot 38b50df2c9 Update dependency mkdocs-material to v9.5.5 2024-01-24 12:00:49 +00:00
Andre601 db93816e55 Remove configurate relocation in Velocity 2024-01-23 15:40:49 +01:00
Andre601 244c2440fc Add migration for pre 3.7.0 files 2024-01-20 22:27:43 +01:00
Andre601 8e2c644669 Merge pull request 'Update dependency org.junit.jupiter:junit-jupiter-engine to v5.10.1' (#213) from renovate/org.junit.jupiter-junit-jupiter-engine-5.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/213
2024-01-20 12:04:27 +00:00
Andre601 a68809ab31 Merge pull request 'Update dependency net.md-5:bungeecord-api to v1.20-R0.2' (#212) from renovate/net.md-5-bungeecord-api-1.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/212
2024-01-20 12:03:07 +00:00
Andre601's Renovate Bot 4b4fd80abe Update dependency org.junit.jupiter:junit-jupiter-engine to v5.10.1 2024-01-20 12:01:07 +00:00
Andre601's Renovate Bot 48ea128267 Update dependency net.md-5:bungeecord-api to v1.20-R0.2 2024-01-20 12:01:00 +00:00
Andre601 68e5795618 Link to new condition option 2024-01-19 15:37:27 +00:00
Andre601 1aa20e4196 Bump version to 3.7.0-b1 2024-01-19 16:10:56 +01:00
Andre601 6db25c8f9c Merge pull request 'Use BungeeTabListPlus inspired Condition system' (#209) from feature/use-btlp-condition-system into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/209
2024-01-19 15:06:30 +00:00
Andre601 0ef3db752d Improve docs 2024-01-19 16:05:54 +01:00
Andre601 1a26f5ad34 Merge branch 'master' into feature/use-btlp-condition-system 2024-01-19 14:51:10 +00:00
Andre601 17a5574be7 Fix placeholder issue (I hope) 2024-01-18 22:33:36 +01:00
Andre601 c7bfb8a736 Update examples and bump version 2024-01-18 14:29:54 +01:00
Andre601 7a756c3b98 Merge pull request 'Update actions/cache action to v4' (#211) from renovate/actions-cache-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/211
2024-01-18 12:09:07 +00:00
Andre601's Renovate Bot 1539e1c3c0 Update actions/cache action to v4 2024-01-18 12:01:20 +00:00
Andre601 a86872c021 Remove unused applyStringToStringFunction 2024-01-17 16:53:07 +01:00
Andre601 7d12499f39 Update docs and add basic tests 2024-01-17 16:48:35 +01:00
Andre601 455434b5f3 Merge pull request 'Update dependency net.william278:papiproxybridge to v1.5' (#210) from renovate/net.william278-papiproxybridge-1.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/210
2024-01-17 12:02:54 +00:00
Andre601's Renovate Bot b66251ab20 Update dependency net.william278:papiproxybridge to v1.5 2024-01-17 12:01:18 +00:00
Andre601 4a1dfa5cb4 Use dedicated Template class for errors. 2024-01-16 22:58:06 +01:00
Andre601 1efd65e16c Merge branch 'master' into feature/use-btlp-condition-system 2024-01-16 21:48:26 +00:00
Andre601 908da9cd32 Add some logging messages 2024-01-16 22:47:53 +01:00
Andre601 e8a30c6ef7 Use BungeeTabListPlus inspired Condition system 2024-01-16 22:23:24 +01:00
Andre601 df164c104f Merge pull request 'Update dependency mkdocs-material to v9.5.4' (#208) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/208
2024-01-15 12:02:23 +00:00
Andre601's Renovate Bot acdf6f6e9a Update dependency mkdocs-material to v9.5.4 2024-01-15 12:01:07 +00:00
Andre601 f52a63a8f1 Merge pull request 'Update dependency mkdocs-glightbox to v0.3.6' (#207) from renovate/mkdocs-glightbox-0.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/207
2023-12-31 14:14:03 +00:00
Andre601's Renovate Bot 6a92cb3a16 Update dependency mkdocs-glightbox to v0.3.6 2023-12-31 12:01:29 +00:00
Andre601 1175451753 Merge pull request 'Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.12.1' (#206) from renovate/org.apache.maven.plugins-maven-compiler-plugin-3.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/206
2023-12-25 13:39:01 +00:00
Andre601's Renovate Bot 5c4130411b Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.12.1 2023-12-25 12:02:04 +00:00
Andre601 05727eeec5 Merge pull request 'Update dependency mkdocs-material to v9.5.3' (#205) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/205
2023-12-24 13:02:23 +00:00
Andre601's Renovate Bot 10af949abc Update dependency mkdocs-material to v9.5.3 2023-12-24 12:01:33 +00:00
Andre601 9851347e74 Merge pull request 'Update dependency net.kyori:adventure-platform-bungeecord to v4.3.2' (#204) from renovate/net.kyori-adventure-platform-bungeecord-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/204
2023-12-22 12:06:31 +00:00
Andre601's Renovate Bot c3e01c8b9c Update dependency net.kyori:adventure-platform-bungeecord to v4.3.2 2023-12-22 12:01:07 +00:00
Andre601 a646d9e998 Merge pull request 'Update dependency com.google.guava:guava to v33' (#203) from renovate/com.google.guava-guava-33.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/203
2023-12-21 12:06:31 +00:00
Andre601's Renovate Bot 3c50a30d4a Update dependency com.google.guava:guava to v33 2023-12-21 12:01:11 +00:00
Andre601 4328ad6b44 Merge pull request 'Update actions/upload-pages-artifact action to v3' (#202) from renovate/actions-upload-pages-artifact-3.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/202
2023-12-20 12:18:17 +00:00
Andre601 34b0555508 Merge pull request 'Update actions/deploy-pages action to v4' (#201) from renovate/actions-deploy-pages-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/201
2023-12-20 12:18:04 +00:00
Andre601's Renovate Bot c92cd0058b Update actions/upload-pages-artifact action to v3 2023-12-20 12:01:05 +00:00
Andre601's Renovate Bot 2cfe8b8a27 Update actions/deploy-pages action to v4 2023-12-20 12:01:01 +00:00
Andre601 6530fed704 Merge pull request 'Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.12.0' (#200) from renovate/org.apache.maven.plugins-maven-compiler-plugin-3.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/200
2023-12-19 12:05:46 +00:00
Andre601 7efb203e7b Merge branch 'master' into renovate/org.apache.maven.plugins-maven-compiler-plugin-3.x 2023-12-19 12:05:24 +00:00
Andre601 1a34376100 Merge pull request 'Update dependency net.kyori:adventure-text-serializer-legacy to v4.15.0' (#199) from renovate/net.kyori-adventure-text-serializer-legacy-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/199
2023-12-19 12:05:00 +00:00
Andre601's Renovate Bot ec1aa5b393 Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.12.0 2023-12-19 12:01:42 +00:00
Andre601's Renovate Bot 9683d3c001 Update dependency net.kyori:adventure-text-serializer-legacy to v4.15.0 2023-12-19 12:01:30 +00:00
Andre601 db60545fcc Add 1.20.4 in ModrinthVersionUploader 2023-12-18 20:19:44 +01:00
Andre601 392495ef63 Merge pull request 'Update dependency net.kyori:adventure-text-minimessage to v4.15.0' (#198) from renovate/net.kyori-adventure-text-minimessage-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/198
2023-12-18 12:53:37 +00:00
Andre601 903764b234 Merge branch 'master' into renovate/net.kyori-adventure-text-minimessage-4.x 2023-12-18 12:53:18 +00:00
Andre601 72329ed1e4 Merge pull request 'Update dependency net.kyori:adventure-api to v4.15.0' (#197) from renovate/net.kyori-adventure-api-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/197
2023-12-18 12:53:04 +00:00
Andre601's Renovate Bot c516b56053 Update dependency net.kyori:adventure-text-minimessage to v4.15.0 2023-12-18 12:44:29 +00:00
Andre601's Renovate Bot 5e4295fbfb Update dependency net.kyori:adventure-api to v4.15.0 2023-12-18 12:44:20 +00:00
Andre601 b140c0aa32 Merge pull request 'Add debug option for log messages' (#194) from feature/add-debug into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/194
2023-12-15 19:55:08 +00:00
Andre601 8f7b293541 Merge branch 'master' into feature/add-debug 2023-12-15 19:50:01 +00:00
Andre601 6f878164c5 Add debug option to getting started guide. 2023-12-13 18:27:17 +00:00
Andre601 a16801ff56 Remove mention of spigot being tested 2023-12-13 18:25:41 +00:00
Andre601 65a89cf762 Merge branch 'master' into feature/add-debug 2023-12-12 22:01:57 +00:00
Andre601 27d4ada179 Merge pull request 'Update maven Docker tag to v3.9.6' (#196) from renovate/maven-3.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/196
2023-12-12 12:03:23 +00:00
Andre601 574edfb246 Merge branch 'master' into renovate/maven-3.x 2023-12-12 12:03:04 +00:00
Andre601 7b7aad9d4e Merge pull request 'Update dependency mkdocs-material to v9.5.2' (#195) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/195
2023-12-12 12:02:38 +00:00
Andre601's Renovate Bot c5c9ed8109 Update maven Docker tag to v3.9.6 2023-12-12 12:01:19 +00:00
Andre601's Renovate Bot 58fea4090d Update dependency mkdocs-material to v9.5.2 2023-12-12 12:01:11 +00:00
Andre601 cd0aad6ec1 Add debug option for log messages 2023-12-09 20:26:54 +01:00
Andre601 fa45844434 Merge pull request 'Update dependency mkdocs-material to v9.5.1' (#192) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/192
2023-12-08 12:28:41 +00:00
Andre601 c4e2a144b5 Merge pull request 'Update actions/setup-python action to v5' (#193) from renovate/actions-setup-python-5.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/193
2023-12-08 12:28:31 +00:00
Andre601's Renovate Bot 7fe93c7021 Update actions/setup-python action to v5 2023-12-08 12:01:09 +00:00
Andre601's Renovate Bot 1d413a5c2a Update dependency mkdocs-material to v9.5.1 2023-12-08 12:01:00 +00:00
Andre601 51db52dbdd Merge pull request 'Update dependency com.viaversion:viaversion-api to v4.9.2' (#190) from renovate/com.viaversion-viaversion-api-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/190
2023-12-07 12:07:24 +00:00
Andre601 4ade528188 Merge pull request 'Update dependency mkdocs-material to v9.5.0' (#191) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/191
2023-12-07 12:07:12 +00:00
Andre601's Renovate Bot 64ba48a7c7 Update dependency mkdocs-material to v9.5.0 2023-12-07 12:02:54 +00:00
Andre601's Renovate Bot ac4edb2b97 Update dependency com.viaversion:viaversion-api to v4.9.2 2023-12-07 12:02:49 +00:00
Andre601 3ea000c98b Merge pull request 'Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.3' (#189) from renovate/org.apache.httpcomponents.client5-httpclient5-5.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/189
2023-12-06 13:06:15 +00:00
Andre601 746bef13e1 Merge pull request 'Update dependency com.viaversion:viaversion-api to v4.9.1' (#188) from renovate/com.viaversion-viaversion-api-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/188
2023-12-06 13:06:01 +00:00
Andre601's Renovate Bot 355ab73546 Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.3 2023-12-06 12:01:10 +00:00
Andre601's Renovate Bot 67170c70e0 Update dependency com.viaversion:viaversion-api to v4.9.1 2023-12-06 12:01:07 +00:00
Andre601 f99c2df4e8 Merge pull request 'Update actions/configure-pages action to v4' (#186) from renovate/actions-configure-pages-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/186
2023-12-05 12:12:05 +00:00
Andre601 212ec04fb8 Merge pull request 'Update actions/deploy-pages action to v3' (#187) from renovate/actions-deploy-pages-3.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/187
2023-12-05 12:11:49 +00:00
Andre601's Renovate Bot 89c6089101 Update actions/deploy-pages action to v3 2023-12-05 12:01:17 +00:00
Andre601's Renovate Bot 87bce39d9a Update actions/configure-pages action to v4 2023-12-05 12:01:12 +00:00
Andre601 18900547a0 Remove leading and trailing whitespaces from server names 2023-12-05 01:46:45 +01:00
Andre601 5df2e05a14 Fix wrong file paths for paper 2023-12-02 14:27:45 +01:00
Andre601 d4e4173cc3 Improve placeholders with world/server args 2023-12-02 13:59:56 +01:00
Andre601 562ad481c5 Bump version to 3.6.0 2023-12-02 12:43:11 +00:00
Andre601 a0ee2a4322 Merge pull request 'Remove Spigot support' (#183) from feature/remove-spigot-support into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/183
2023-12-02 12:42:30 +00:00
Andre601 2c92efdb43 Merge branch 'master' into feature/remove-spigot-support 2023-12-02 12:39:37 +00:00
Andre601 555dc9d6a5 Merge pull request 'Improve docs workflow setup' (#179) from feature/improve-docs-workflow into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/179
2023-12-02 12:39:28 +00:00
Andre601 27742c5e1b .woodpecker/publish_docs.yml aktualisiert 2023-12-02 12:39:16 +00:00
Andre601 280aeb8d2e Merge branch 'master' into feature/improve-docs-workflow 2023-12-02 12:38:49 +00:00
Andre601 92a868f0fa Merge pull request 'Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.2.3' (#185) from renovate/org.apache.httpcomponents.client5-httpclient5-5.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/185
2023-12-02 12:03:33 +00:00
Andre601 189ac5e09b Merge pull request 'Update dependency ch.qos.logback:logback-classic to v1.4.14' (#184) from renovate/ch.qos.logback-logback-classic-1.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/184
2023-12-02 12:03:13 +00:00
Andre601's Renovate Bot 833cb81d65 Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.2.3 2023-12-02 12:01:18 +00:00
Andre601's Renovate Bot ab09422da5 Update dependency ch.qos.logback:logback-classic to v1.4.14 2023-12-02 12:01:14 +00:00
Andre601 64cad6dc26 Remove Spigot from readme and docs 2023-12-01 17:00:14 +01:00
Andre601 ce78b493f4 Remove spigot from supported platforms in PlatformInfo 2023-12-01 16:58:43 +01:00
Andre601 c43048ea3f Remove Spigot support 2023-12-01 16:51:33 +01:00
Andre601 6d4d1600ab Add Getting Started page 2023-11-29 15:09:32 +01:00
Andre601 f114e99b9b Merge pull request 'Update dependency ch.qos.logback:logback-classic to v1.4.13' (#182) from renovate/ch.qos.logback-logback-classic-1.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/182
2023-11-29 12:06:26 +00:00
Andre601's Renovate Bot 3d587bc86d Update dependency ch.qos.logback:logback-classic to v1.4.13 2023-11-29 12:01:18 +00:00
Andre601 bd8c6be7c6 Merge pull request 'Update dependency ch.qos.logback:logback-classic to v1.4.12' (#181) from renovate/ch.qos.logback-logback-classic-1.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/181
2023-11-28 12:02:35 +00:00
Andre601's Renovate Bot b5d5d508e2 Update dependency ch.qos.logback:logback-classic to v1.4.12 2023-11-28 12:01:02 +00:00
Andre601 3001b65fe8 Merge pull request 'Update dependency mkdocs-material to v9.4.14' (#180) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/180
2023-11-27 12:08:29 +00:00
Andre601's Renovate Bot c82771db59 Update dependency mkdocs-material to v9.4.14 2023-11-27 12:01:59 +00:00
Andre601 9880836c25 Improve docs workflow setup 2023-11-25 00:32:57 +00:00
Andre601 f12ae28722 Add Source redirect for API 2023-11-25 00:19:59 +00:00
Andre601 42b0f0e94f Merge pull request 'Update dependency mkdocs-material to v9.4.12' (#178) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/178
2023-11-24 12:04:02 +00:00
Andre601's Renovate Bot 0a4b872051 Update dependency mkdocs-material to v9.4.12 2023-11-24 12:00:59 +00:00
Andre601 b1322105ed Merge pull request 'Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.2.2' (#177) from renovate/org.apache.httpcomponents.client5-httpclient5-5.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/177
2023-11-23 12:02:45 +00:00
Andre601 831ca57fbb Merge branch 'master' into renovate/org.apache.httpcomponents.client5-httpclient5-5.x 2023-11-23 12:02:17 +00:00
Andre601 6502639cd3 Merge pull request 'Update dependency mkdocs-material to v9.4.11' (#176) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/176
2023-11-23 12:01:54 +00:00
Andre601's Renovate Bot 5059b80db2 Update dependency org.apache.httpcomponents.client5:httpclient5 to v5.2.2 2023-11-23 12:01:07 +00:00
Andre601's Renovate Bot ecdaf72963 Update dependency mkdocs-material to v9.4.11 2023-11-23 12:00:58 +00:00
Andre601 28e2ca69ed Merge pull request 'Update dependency mkdocs-material to v9.4.10' (#175) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/175
2023-11-19 20:40:20 +00:00
Andre601 9cad78b6e4 Merge branch 'master' into renovate/mkdocs-material-9.x 2023-11-19 21:39:40 +01:00
Andre601 af8654666b Merge pull request 'Update dependency mkdocs-glightbox to v0.3.5' (#174) from renovate/mkdocs-glightbox-0.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/174
2023-11-19 12:20:05 +00:00
Andre601's Renovate Bot 6cd474b35d Update dependency mkdocs-material to v9.4.10 2023-11-19 12:01:07 +00:00
Andre601's Renovate Bot 3802ab556c Update dependency mkdocs-glightbox to v0.3.5 2023-11-19 12:01:02 +00:00
Andre601 3a520eeaf0 Merge pull request 'Update dependency mkdocs-material to v9.4.9' (#173) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/173
2023-11-17 12:15:02 +00:00
Andre601's Renovate Bot 204f43c112 Update dependency mkdocs-material to v9.4.9 2023-11-17 12:00:45 +00:00
Andre601 fc8ed8e49e Merge pull request 'Update dependency mkdocs-material to v9.4.8' (#172) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/172
2023-11-06 12:02:13 +00:00
Andre601's Renovate Bot 56082c308b Update dependency mkdocs-material to v9.4.8 2023-11-06 12:01:06 +00:00
Andre601 205e563095 Fix wrong placeholder names. 2023-11-05 13:59:46 +00:00
Andre601 5b01940c60 Merge pull request 'Update dependency me.clip:placeholderapi to v2.11.5' (#171) from renovate/me.clip-placeholderapi-2.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/171
2023-10-29 12:05:36 +00:00
Andre601's Renovate Bot cbb087e3d1 Update dependency me.clip:placeholderapi to v2.11.5 2023-10-29 12:01:15 +00:00
Andre601 524b926244 Merge pull request 'Update dependency mkdocs-material to v9.4.7' (#170) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/170
2023-10-28 12:01:09 +00:00
Andre601's Renovate Bot 4059bbfe93 Update dependency mkdocs-material to v9.4.7 2023-10-28 12:00:43 +00:00
Andre601 9b0b69a4f4 Merge pull request 'Update maven Docker tag to v3.9.5' (#169) from renovate/maven-3.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/169
2023-10-20 12:02:12 +00:00
Andre601's Renovate Bot 10a82eb951 Update maven Docker tag to v3.9.5 2023-10-20 12:01:07 +00:00
Andre601 690f7dfaf0 Merge pull request 'Update dependency com.squareup.okhttp3:okhttp to v4.12.0' (#168) from renovate/com.squareup.okhttp3-okhttp-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/168
2023-10-17 12:03:39 +00:00
Andre601's Renovate Bot 6a22d20b3a Update dependency com.squareup.okhttp3:okhttp to v4.12.0 2023-10-17 12:00:59 +00:00
Andre601 b1072bb1fa Update HangarVersionUploader for latest API changes 2023-10-16 12:01:12 +02:00
Andre601 d20da91bab Remove Hangar for now 2023-10-16 11:43:54 +02:00
Andre601 17e9692028 Remove unused import 2023-10-16 11:22:37 +02:00
Andre601 45dc8a5fe6 Don't use closeable http client 2023-10-16 11:22:09 +02:00
Andre601 a237ac1ce4 Merge pull request 'Update dependency mkdocs-material to v9.4.6' (#167) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/167
2023-10-15 17:27:18 +00:00
Andre601's Renovate Bot 27e66a16b9 Update dependency mkdocs-material to v9.4.6 2023-10-15 17:01:04 +00:00
Andre601 8f98846bc3 Ignore deprecation state of getUnsafe() 2023-10-15 00:00:57 +02:00
Andre601 bbcab59845 Final change I hope 2023-10-14 23:59:49 +02:00
Andre601 3130e07070 More consistent names 2023-10-14 23:57:05 +02:00
Andre601 7bc61ddf4d Use more matching placeholder names 2023-10-14 23:54:32 +02:00
Andre601 53d15a9011 Bump version 2023-10-14 23:42:16 +02:00
Andre601 8718e4a0ae update PAPI placeholders info 2023-10-11 12:10:04 +00:00
Andre601 06a49956af Merge pull request 'Update dependency com.google.guava:guava to v32.1.3-jre' (#166) from renovate/com.google.guava-guava-32.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/166
2023-10-11 12:04:37 +00:00
Andre601's Renovate Bot 38ec131b69 Update dependency com.google.guava:guava to v32.1.3-jre 2023-10-11 12:00:57 +00:00
Andre601 1bdaa61dd9 Merge pull request 'Update dependency mkdocs-material to v9.4.5' (#165) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/165
2023-10-10 12:02:55 +00:00
Andre601's Renovate Bot 080d5055c4 Update dependency mkdocs-material to v9.4.5 2023-10-10 12:01:23 +00:00
Andre601 423b363964 Use maxPlayers value 2023-10-09 01:33:40 +02:00
Andre601 6b9abfccfc Update PlaceholderAPI placeholders 2023-10-07 12:53:46 +02:00
Andre601 f589a8da35 Update Docs 2023-10-06 23:54:51 +02:00
Andre601 465581306f docs/api/javadocs.md aktualisiert 2023-10-06 20:54:27 +00:00
Andre601 6b2919961b Merge pull request 'Add Javadoc redirect' (#164) from docs/javadoc-link into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/164
2023-10-06 20:52:04 +00:00
Andre601 adb6e797b2 Add Javadoc redirect 2023-10-06 20:51:35 +00:00
Andre601 b410b9438f Merge pull request 'Update dependency mkdocs-material to v9.4.4' (#163) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/163
2023-10-06 12:22:17 +00:00
Andre601's Renovate Bot c1d5b4efa9 Update dependency mkdocs-material to v9.4.4 2023-10-06 12:01:00 +00:00
Andre601 4785dd127e Only allow workflow_dispatch from now on 2023-10-04 14:19:16 +00:00
Andre601 9e8e2f7e74 Add missing id property 2023-10-03 21:49:01 +00:00
Andre601 c14dfe0f3a Merge pull request 'Update dependency com.viaversion:viaversion-api to v4.8.1' (#162) from renovate/com.viaversion-viaversion-api-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/162
2023-10-03 12:40:03 +00:00
Andre601's Renovate Bot ed92e7002c Update dependency com.viaversion:viaversion-api to v4.8.1 2023-10-03 12:01:05 +00:00
Andre601 8f93d9732c Merge pull request 'Update dependency mkdocs-material to v9.4.3' (#161) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/161
2023-10-02 12:03:50 +00:00
Andre601's Renovate Bot 96f8fa5860 Update dependency mkdocs-material to v9.4.3 2023-10-02 12:00:57 +00:00
Andre601 bfb857bd5c Merge pull request 'Update dependency net.william278:papiproxybridge to v1.4.2' (#160) from renovate/net.william278-papiproxybridge-1.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/160
2023-09-30 12:04:14 +00:00
Andre601 5fe3b5811c Merge pull request 'Update dependency net.kyori:adventure-platform-bungeecord to v4.3.1' (#159) from renovate/net.kyori-adventure-platform-bungeecord-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/159
2023-09-30 12:03:54 +00:00
Andre601's Renovate Bot 2a7eff0092 Update dependency net.william278:papiproxybridge to v1.4.2 2023-09-30 12:01:23 +00:00
Andre601 1907f5d47e Merge pull request 'Update dependency net.kyori:adventure-platform-bukkit to v4.3.1' (#158) from renovate/net.kyori-adventure-platform-bukkit-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/158
2023-09-29 12:03:12 +00:00
Andre601's Renovate Bot aa92350b52 Update dependency net.kyori:adventure-platform-bungeecord to v4.3.1 2023-09-29 12:01:05 +00:00
Andre601's Renovate Bot 869b9bd3b7 Update dependency net.kyori:adventure-platform-bukkit to v4.3.1 2023-09-29 12:00:56 +00:00
Andre601 fe31dcf0a4 Merge pull request 'Update dependency net.william278:papiproxybridge to v1.4.1' (#156) from renovate/net.william278-papiproxybridge-1.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/156
2023-09-26 18:39:12 +00:00
Andre601 6b44438f52 Use custom compact admonition boxes 2023-09-26 20:38:22 +02:00
Andre601's Renovate Bot 6b0c654f41 Update dependency net.william278:papiproxybridge to v1.4.1 2023-09-26 12:00:57 +00:00
Andre601 c28ff3a891 Use some JS to insert API version 2023-09-26 13:56:48 +02:00
Andre601 f424b41c3b Header consistency 2023-09-25 15:14:10 +02:00
Andre601 b5f901d8f5 Use Hangar version of PAPI as dependency 2023-09-25 15:04:10 +02:00
Andre601 29d52492fc Merge pull request 'Update dependency mkdocs-material to v9.4.2' (#155) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/155
2023-09-25 12:03:05 +00:00
Andre601's Renovate Bot 2d6af20bdc Update dependency mkdocs-material to v9.4.2 2023-09-25 12:01:00 +00:00
Andre601 59c913ecf8 Merge pull request 'Update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.1' (#154) from renovate/org.apache.maven.plugins-maven-shade-plugin-3.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/154
2023-09-24 22:18:35 +00:00
Andre601's Renovate Bot 4a50beb4e0 Update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.1 2023-09-24 22:16:36 +00:00
Andre601 c099127272 delete renovate.yml 2023-09-24 21:48:23 +00:00
Andre601 15974b5c54 Merge pull request 'Update dependency me.clip:placeholderapi to v2.11.4' (#153) from renovate/me.clip-placeholderapi-2.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/153
2023-09-24 13:03:36 +00:00
Andre601's Renovate Bot 483afe63c4 Update dependency me.clip:placeholderapi to v2.11.4 2023-09-24 12:00:56 +00:00
Andre601 f0cb458a34 Use snippets for API version display 2023-09-24 03:19:41 +02:00
Andre601 2c547cd6d0 Add changelog newline sanitization to HangarVersionUploader too 2023-09-23 22:35:45 +02:00
Andre601 e7282b4a97 Support all MC 1.19 versions. 2023-09-23 22:27:48 +02:00
Andre601 4fc0ad97fc Revert to normal publish setup 2023-09-23 21:59:12 +02:00
Andre601 3ae02167b9 Lowercase loaders 2023-09-23 21:55:49 +02:00
Andre601 e407b38565 Use proper plugin release to test. 2023-09-23 21:42:06 +02:00
Andre601 c98d52ed46 Make a dryrun-test for VersionUploader 2023-09-23 21:29:06 +02:00
Andre601 266913e4b4 Use response directly from client's execute method 2023-09-23 16:42:21 +02:00
Andre601 a3d4a009a5 Use unique ID for modrinth dependencies 2023-09-23 16:27:17 +02:00
Andre601 18e00d082e Use addLabels and not labels 2023-09-23 12:09:04 +00:00
Andre601 6a3979743b Merge pull request 'Update dependency mkdocs-material to v9.4.1' (#152) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/152
2023-09-23 12:05:45 +00:00
Andre601's Renovate Bot 3a29ad54ca Update dependency mkdocs-material to v9.4.1 2023-09-23 12:01:03 +00:00
Andre601 987c520160 Merge pull request 'Update dependency com.viaversion:viaversion-api to v4.8.0' (#151) from renovate/com.viaversion-viaversion-api-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/151
2023-09-22 12:06:48 +00:00
Andre601's Renovate Bot 4b6197f6e0 Update dependency com.viaversion:viaversion-api to v4.8.0 2023-09-22 12:00:55 +00:00
Andre601 01611d4130 Add 1.20.2 for ModrinthVersionUploader 2023-09-21 20:59:35 +02:00
Andre601 531aa65fcc Merge pull request 'Bump mkdocs-material to 9.4.0' (#150) from feature/update-mkdocs into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/150
2023-09-21 17:39:22 +00:00
Andre601 fb101c4a14 Use new emoji extension 2023-09-21 17:39:11 +00:00
Andre601 7bd97f5f5a Bump mkdocs-material to 9.4.0 2023-09-21 17:37:28 +00:00
Andre601 52c3edd0ea Use debug log level 2023-09-21 12:15:49 +00:00
Andre601 368e544051 Don't include core-module in codeberg release 2023-09-21 00:52:20 +02:00
Andre601 12b2f5a208 Give non-successful response codes on fails 2023-09-21 00:50:26 +02:00
Andre601 adc88a8640 Increase timeout delay for Release data fetching 2023-09-21 00:43:08 +02:00
Andre601 817db44492 Add null check for codeberg release 2023-09-21 00:40:57 +02:00
Andre601 f74f7dfa6b Use CompletableFuture.join() for VersionUploader 2023-09-21 00:37:12 +02:00
Andre601 e9c8730090 Merge pull request 'Fix docs' (#149) from fix/docs into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/149
2023-09-20 22:32:41 +00:00
Andre601 861ada0396 docs/examples/index.md aktualisiert 2023-09-20 22:32:29 +00:00
Andre601 a2fb9c3d81 Fix docs 2023-09-20 22:31:52 +00:00
Andre601 f747461018 Use the right Env variable... 2023-09-20 23:37:03 +02:00
Andre601 f408146d57 Fix wrong API URL. 2023-09-20 23:34:27 +02:00
Andre601 c684001fcf mkdocs.yml aktualisiert 2023-09-20 21:19:39 +00:00
Andre601 6dc53c8c4f define source and target for modrinth and hangar token 2023-09-20 21:17:24 +00:00
Andre601 64ab958c67 docs/examples/index.md aktualisiert 2023-09-20 20:20:26 +00:00
Andre601 7a66c9a0c9 Merge pull request 'Add maxPlayers options' (#145) from feature/maxplayers-option into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/145
2023-09-20 20:05:44 +00:00
Andre601 0ff658632a Merge branch 'master' into feature/maxplayers-option 2023-09-20 17:41:50 +00:00
Andre601 ee32347bd0 Merge pull request 'Re-make Modrinth and Hangar uploader' (#144) from feature/modrinth-and-hangar-uploader into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/144
2023-09-20 17:41:23 +00:00
Andre601 9e11038e98 Merge branch 'master' into feature/modrinth-and-hangar-uploader 2023-09-20 17:39:15 +00:00
Andre601 008ddbb98a .github/dependabot.yml gelöscht 2023-09-20 17:34:13 +00:00
Andre601 f084c17d76 Merge pull request 'Update api.version to v3.1.0' (#148) from renovate/api.version into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/148
2023-09-20 15:55:20 +00:00
Andre601's Renovate Bot 9dd73aec9d Update api.version to v3.1.0 2023-09-20 15:51:15 +00:00
Andre601 3ebf151f3a Improve renovate configuration 2023-09-20 11:50:28 +00:00
Andre601 872c194a62 Add 'folia-supported: true' to paper-plugin.yml 2023-09-20 11:03:19 +00:00
Andre601 d122603c70 Merge pull request 'Update dependency mkdocs-material to v9.3.2' (#146) from renovate/mkdocs-material-9.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/146
2023-09-20 00:20:40 +00:00
Andre601's Renovate Bot 489fce2031 Update dependency mkdocs-material to v9.3.2 2023-09-20 00:06:48 +00:00
Andre601 1651151f26 Test without RENOVATE_ADD_LABELS for now 2023-09-19 23:49:21 +00:00
Andre601 aa61ea826f renovate.json aktualisiert 2023-09-19 23:48:42 +00:00
Andre601 0877eb4187 Add github token for release notes and gh actions dependencies 2023-09-19 23:43:49 +00:00
Andre601 6e89cdb3cc .woodpecker/test.yml gelöscht 2023-09-19 23:24:07 +00:00
Andre601 1eb0b30356 Improve source facts fetcher 2023-09-19 22:53:51 +02:00
Andre601 417f5dc5d0 Also include image 2023-09-19 21:02:42 +02:00
Andre601 01a73b9ea3 Bump plugin and API version 2023-09-19 20:54:02 +02:00
Andre601 c06788a55c Update API changelog 2023-09-19 20:45:09 +02:00
Andre601 fd924107bc Add maxPlayers option for server list profile 2023-09-19 20:32:05 +02:00
Andre601 dce90b91f0 .woodpecker/publish_assets.yml aktualisiert 2023-09-18 18:22:30 +00:00
Andre601 aa968b7d25 Add gitea release plugin 2023-09-18 16:01:47 +02:00
Andre601 137d089e4a Merge branch 'master' into feature/modrinth-and-hangar-uploader 2023-09-18 13:11:27 +00:00
Andre601 bfa27f92e1 Re-make Modrinth and Hangar uploader 2023-09-18 15:10:24 +02:00
Andre601 b405706b50 Merge pull request 'Update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.0' (#143) from renovate/org.apache.maven.plugins-maven-shade-plugin-3.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/143
2023-09-18 00:06:48 +00:00
Andre601's Renovate Bot 89f44d7bec Update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.0 2023-09-18 00:04:39 +00:00
Andre601 28e9b6ed96 .woodpecker/test.yml aktualisiert 2023-09-17 20:29:19 +00:00
Andre601 19b3eec401 .woodpecker/test.yml aktualisiert 2023-09-17 20:11:37 +00:00
Andre601 c712b3b715 .woodpecker/test.yml aktualisiert 2023-09-17 20:10:22 +00:00
Andre601 5c379c3b13 .woodpecker/test.yml aktualisiert 2023-09-17 20:09:29 +00:00
Andre601 f6f48708d9 .woodpecker/test.yml aktualisiert 2023-09-17 20:08:51 +00:00
Andre601 83890fa5cb .woodpecker/test.yml aktualisiert 2023-09-17 20:07:55 +00:00
Andre601 d7653a6a6f .woodpecker/test.yml aktualisiert 2023-09-17 20:02:43 +00:00
Andre601 676c4c8f1f .woodpecker/test.yml aktualisiert 2023-09-17 20:00:49 +00:00
Andre601 b66870c942 .woodpecker/test.yml aktualisiert 2023-09-17 19:56:23 +00:00
Andre601 af97a0dac2 Test out JSON creation 2023-09-17 19:56:01 +00:00
Andre601 d43ef090ef Use double quotes 2023-09-17 19:42:36 +00:00
Andre601 e7451ae567 .woodpecker/test.yml aktualisiert 2023-09-17 19:32:57 +00:00
Andre601 cf4f095624 Test user auth 2023-09-17 19:28:12 +00:00
Andre601 9280809ab0 .woodpecker/publish_assets.yml aktualisiert 2023-09-17 19:25:04 +00:00
Andre601 875ae4d43d .woodpecker/test.yml aktualisiert 2023-09-17 19:19:27 +00:00
Andre601 dbd45ac65e .woodpecker/test.yml aktualisiert 2023-09-17 19:14:57 +00:00
Andre601 7c15778ebc test without token 2023-09-17 19:12:24 +00:00
Andre601 2699856a75 .woodpecker/test.yml aktualisiert 2023-09-17 19:11:30 +00:00
Andre601 b49c105620 .woodpecker/test.yml aktualisiert 2023-09-17 18:57:19 +00:00
Andre601 2ffbfeec48 .woodpecker/test.yml aktualisiert 2023-09-17 18:56:50 +00:00
Andre601 bd885e25e2 .woodpecker/test.yml aktualisiert 2023-09-17 18:56:11 +00:00
Andre601 e2c6eb142c Merge pull request 'Update dependency org.apache.maven.plugins:maven-jar-plugin to v3.3.0' (#142) from renovate/org.apache.maven.plugins-maven-jar-plugin-3.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/142
2023-09-17 00:12:53 +00:00
Andre601 db11e42c6d Merge pull request 'Update dependency net.md-5:bungeecord-api to v1.20-R0.1' (#141) from renovate/net.md-5-bungeecord-api-1.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/141
2023-09-17 00:12:11 +00:00
Andre601's Renovate Bot 36e5829943 Update dependency org.apache.maven.plugins:maven-jar-plugin to v3.3.0 2023-09-17 00:11:49 +00:00
Andre601's Renovate Bot 7bbb2bbfa7 Update dependency net.md-5:bungeecord-api to v1.20-R0.1 2023-09-17 00:11:46 +00:00
Andre601 6acd536f43 Merge pull request 'Update dependency net.kyori:adventure-text-minimessage to v4.14.0' (#140) from renovate/net.kyori-adventure-text-minimessage-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/140
2023-09-16 00:10:40 +00:00
Andre601 64d1440ad2 Merge pull request 'Update dependency net.kyori:adventure-platform-bungeecord to v4.3.0' (#139) from renovate/net.kyori-adventure-platform-bungeecord-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/139
2023-09-16 00:10:08 +00:00
Andre601's Renovate Bot 6f1dd78aa7 Update dependency net.kyori:adventure-text-minimessage to v4.14.0 2023-09-16 00:04:39 +00:00
Andre601's Renovate Bot 4330978816 Update dependency net.kyori:adventure-platform-bungeecord to v4.3.0 2023-09-16 00:04:22 +00:00
Andre601 935603b852 Use VersionUploader for hangar only again 2023-09-15 21:42:35 +02:00
Andre601 9671938a66 .woodpecker/test.yml aktualisiert 2023-09-15 19:16:23 +00:00
Andre601 5cc974eb9c Return of the | . 2023-09-15 19:15:44 +00:00
Andre601 e526cc6750 .woodpecker/test.yml aktualisiert 2023-09-15 19:09:20 +00:00
Andre601 34fea78b01 Check if tag actually is set. 2023-09-15 19:02:26 +00:00
Andre601 072547005c .woodpecker/test.yml aktualisiert 2023-09-15 19:01:39 +00:00
Andre601 cdb5852e8b .woodpecker/test.yml aktualisiert 2023-09-15 18:59:06 +00:00
Andre601 050477c19f .woodpecker/test.yml aktualisiert 2023-09-15 18:58:22 +00:00
Andre601 52b24bb3e9 .woodpecker/test.yml aktualisiert 2023-09-15 18:55:28 +00:00
Andre601 df8a063369 .woodpecker/test.yml aktualisiert 2023-09-15 18:48:48 +00:00
Andre601 3fc4a788b8 Add missing \ 2023-09-15 18:36:28 +00:00
Andre601 15e5108ec7 Try without {} again 2023-09-15 18:35:33 +00:00
Andre601 b8fa694e26 .woodpecker/test.yml aktualisiert 2023-09-15 18:32:19 +00:00
Andre601 f1b55cba79 try without auth 2023-09-15 18:30:11 +00:00
Andre601 e76dd78cd5 Try "${token}" format again 2023-09-15 18:28:42 +00:00
Andre601 09a668493b try this 2023-09-15 18:27:50 +00:00
Andre601 1ef466d2a4 Try single quotes 2023-09-15 18:19:51 +00:00
Andre601 e15ddbf2d4 Try this format? 2023-09-15 18:16:24 +00:00
Andre601 1c0ce073e5 Try "| ." again 2023-09-15 18:14:24 +00:00
Andre601 5964be18ed .woodpecker/test.yml aktualisiert 2023-09-15 18:13:11 +00:00
Andre601 06ad4f106b Try former select syntax 2023-09-15 18:12:05 +00:00
Andre601 adf343468f try --anyauth 2023-09-15 18:10:06 +00:00
Andre601 5a0bb3ce03 Try this structure 2023-09-15 16:14:23 +00:00
Andre601 b3edb2833e Create test for curl setu 2023-09-15 16:12:04 +00:00
Andre601 83c2017544 .woodpecker/publish_assets.yml aktualisiert 2023-09-15 11:46:45 +00:00
Andre601 42ecf8ec2a Create github release creation step 2023-09-15 11:41:28 +00:00
Andre601 fe53c28f77 Re-add release workflow 2023-09-15 11:33:36 +00:00
Andre601 44e8b395f5 .woodpecker/renovate.yml aktualisiert 2023-09-15 00:12:47 +00:00
Andre601 13828897a2 Merge pull request 'Update dependency net.kyori:adventure-api to v4.14.0' (#138) from renovate/net.kyori-adventure-api-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/138
2023-09-15 00:08:18 +00:00
Andre601 965a9898ca Merge pull request 'Update dependency dev.masecla:Modrinth4J to v2.2.0' (#137) from renovate/dev.masecla-modrinth4j-2.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/137
2023-09-15 00:07:49 +00:00
Andre601's Renovate Bot d3c9d1e7e2 Update dependency net.kyori:adventure-api to v4.14.0 2023-09-15 00:03:11 +00:00
Andre601's Renovate Bot ff3df14a90 Update dependency dev.masecla:Modrinth4J to v2.2.0 2023-09-15 00:03:08 +00:00
Andre601 374f477645 Merge pull request 'Update dependency com.squareup.okhttp3:okhttp to v4.11.0' (#136) from renovate/com.squareup.okhttp3-okhttp-4.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/136
2023-09-14 00:04:07 +00:00
Andre601 11bcbc7918 Merge branch 'master' into renovate/com.squareup.okhttp3-okhttp-4.x 2023-09-14 00:03:55 +00:00
Andre601 f91f77dba0 Merge pull request 'Update dependency com.comphenix.protocol:ProtocolLib to v5.1.0' (#135) from renovate/com.comphenix.protocol-protocollib-5.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/135
2023-09-14 00:03:36 +00:00
Andre601's Renovate Bot ac36bc7c6c Update dependency com.squareup.okhttp3:okhttp to v4.11.0 2023-09-14 00:03:14 +00:00
Andre601's Renovate Bot 184aa7cd83 Update dependency com.comphenix.protocol:ProtocolLib to v5.1.0 2023-09-14 00:02:08 +00:00
Andre601 e20a80b410 Merge pull request 'Update dependency org.bstats:bstats-bungeecord to v3.0.2' (#134) from renovate/org.bstats-bstats-bungeecord-3.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/134
2023-09-13 19:44:52 +00:00
Andre601 43f5cbdcf1 Merge branch 'master' into renovate/org.bstats-bstats-bungeecord-3.x 2023-09-13 19:44:43 +00:00
Andre601 7c8d6067f5 Merge pull request 'Update dependency ch.qos.logback:logback-classic to v1.4.11' (#133) from renovate/ch.qos.logback-logback-classic-1.x into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/133
2023-09-13 19:41:51 +00:00
Andre601 5500239146 Merge branch 'master' into renovate/ch.qos.logback-logback-classic-1.x 2023-09-13 19:38:23 +00:00
Andre601 62844f3111 renovate.json aktualisiert 2023-09-13 19:37:24 +00:00
Andre601 37df1c6376 .woodpecker/renovate.yml aktualisiert 2023-09-13 19:25:08 +00:00
Andre601 abe1dea027 Disable dryrun for now 2023-09-13 19:24:47 +00:00
Andre601 66500050fe .woodpecker/renovate.yml aktualisiert 2023-09-13 19:24:06 +00:00
Andre601's Renovate Bot 2bc2f11fb1 Update dependency org.bstats:bstats-bungeecord to v3.0.2 2023-09-13 19:22:01 +00:00
Andre601's Renovate Bot 4b88c78036 Update dependency ch.qos.logback:logback-classic to v1.4.11 2023-09-13 19:21:57 +00:00
Andre601 5a98301b7d Merge pull request 'Configure Renovate' (#132) from renovate/configure into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/132
2023-09-13 19:19:37 +00:00
Andre601's Renovate Bot 2cf7fd4ffc Add renovate.json 2023-09-13 19:16:06 +00:00
Andre601 83349e1c37 Include git author 2023-09-13 19:13:33 +00:00
Andre601 d928991ca5 Add chmod 2023-09-13 18:32:01 +00:00
Andre601 8b3cd0fcee Setup git configuration 2023-09-13 18:31:11 +00:00
Andre601 2afd7483df steps, not pipeline 2023-09-13 18:25:09 +00:00
Andre601 ae108d1bed indent fix 2023-09-13 18:24:40 +00:00
Andre601 37e343e92e Create renovate.yml 2023-09-13 18:24:02 +00:00
Andre601 8b01a12ef9 Add admonition box to inform of moved wiki 2023-09-13 00:29:24 +02:00
Andre601 91ea80fbde Update docs 2023-09-12 22:04:49 +02:00
Andre601 deec676180 Fix wrong platforms for papiproxybridge 2023-09-12 19:57:49 +00:00
Andre601 5fb22a505f typo 2023-09-12 19:07:04 +00:00
Andre601 539a1300d2 Don't use gh-pages branch 2023-09-12 19:00:48 +00:00
Andre601 915fe7b134 .github/workflows/release.yml gelöscht 2023-09-12 18:46:21 +00:00
Andre601 da393a66c1 .github/workflows/pr-comment.yml gelöscht 2023-09-12 18:46:17 +00:00
Andre601 6563b93721 .github/workflows/create-pr-artifact.yml gelöscht 2023-09-12 18:46:11 +00:00
Andre601 c8e51ab82e .woodpecker/push_to_github.yml gelöscht 2023-09-12 18:45:51 +00:00
Andre601 435fbe721d typo 2023-09-12 18:35:05 +00:00
Andre601 3677e90ad1 Try this aproach 2023-09-12 18:33:01 +00:00
Andre601 cd96a87028 Bump mkdocs-material to 9.3.1 2023-09-12 18:29:46 +00:00
Andre601 3b1e5244e4 Try this syntax for jq 2023-09-12 13:57:44 +00:00
Andre601 07a1baff36 Merge pull request 'Create setup for GitHub hosted docs' (#131) from feature/improve-github-hosted-docs into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/131
2023-09-12 12:49:07 +00:00
Andre601 c87f6d5a0d Merge branch 'master' into feature/improve-github-hosted-docs 2023-09-12 12:48:31 +00:00
Andre601 36f6c41059 Fix workflow not having any upstream 2023-09-12 12:48:17 +00:00
Andre601 fa0170fa16 Add env variable to github workflow 2023-09-12 12:47:02 +00:00
Andre601 c66936861f Wrap entire announce block in if check 2023-09-12 12:43:38 +00:00
Andre601 8933c39ce0 Create option for env 2023-09-12 12:42:44 +00:00
Andre601 34865b5bb8 Create setup for GitHub hosted docs 2023-09-12 12:38:31 +00:00
Andre601 271ebed7b6 Setup basic github -> Codeberg mirror 2023-09-12 12:31:56 +00:00
Andre601 08e7eca34f Remove the System.exit at end of Modrinth upload 2023-09-12 00:10:02 +02:00
Andre601 0162bcdaaf Change dependency declaration for Modrinth 2023-09-11 23:47:46 +02:00
Andre601 39e76862d5 Add log message for ModrinthVersionUploader 2023-09-11 23:37:09 +02:00
Andre601 a7aeffa52a Go back to using placeholders 2023-09-11 23:31:20 +02:00
Andre601 9f847ca1db Change okhttp scope to compile 2023-09-11 23:26:14 +02:00
Andre601 6f4a429123 Disable uploadFile for now 2023-09-11 21:23:14 +00:00
Andre601 60db6eb445 Use badouralix/curl-jq 2023-09-11 21:20:20 +00:00
Andre601 5c06fec00a Try this setup... 2023-09-11 21:16:30 +00:00
Andre601 12eb80d4d7 Fetch release info from Codeberg through VersionUploader 2023-09-11 23:14:05 +02:00
Andre601 c371bf323c .woodpecker/publish_assets.yml aktualisiert 2023-09-11 20:23:45 +00:00
Andre601 8dca20c73d Use maven:3.9.4-eclipse-temurin-17 for building the jars 2023-09-11 20:05:10 +00:00
Andre601 aabfb5273e Merge pull request 'Add support for Maintenance plugin' (#130) from feature/add-maintenance-plugin-support into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/130
2023-09-11 19:44:08 +00:00
Andre601 a282382402 Bump version 2023-09-11 21:42:28 +02:00
Andre601 e86733052b Remove commit from file name 2023-09-11 21:41:57 +02:00
Andre601 a112036c2e Add dependency for Maintenance 2023-09-11 21:39:36 +02:00
Andre601 6c07bfb5a3 Move API reference a bit 2023-09-11 17:08:34 +02:00
Andre601 7668a3e881 Merge branch 'master' into feature/add-maintenance-plugin-support 2023-09-11 16:13:39 +02:00
Andre601 f53f2c724d Update dependency list and also use resource filtering for file paths 2023-09-11 15:35:17 +02:00
Andre601 5ea6f9307c Override title to remove record prefix from ProfileEntry 2023-09-11 09:53:57 +00:00
Andre601 8bdaa232ca Use Promis.all([...]) 2023-09-11 00:12:27 +02:00
Andre601 1ad945a1a9 Use a proxy to fetch codeberg stats 2023-09-10 23:23:52 +02:00
Andre601 85d11e7896 Add support for Maintenance plugin 2023-09-10 22:47:07 +02:00
Andre601 bcd940d808 Add stats fetching to docs 2023-09-10 21:47:42 +02:00
Andre601 dd837b96e8 Smaller changes to VersionUploader 2023-09-08 23:04:26 +02:00
Andre601 57295756fc Update URLs 2023-09-07 21:57:58 +00:00
Andre601 9f1307f559 Only trigger on master branch 2023-09-07 21:52:42 +00:00
Andre601 c489764b06 Only trigger on specific paths 2023-09-07 21:52:04 +00:00
Andre601 845b1b2022 Fix list for ProfileEntry.Builder#setFavicon(String) 2023-09-07 21:38:09 +00:00
Andre601 3662a66ec9 Try this x3 2023-09-07 21:15:50 +00:00
Andre601 e1e0083633 Try this x2 2023-09-07 21:13:27 +00:00
Andre601 58e4624cf5 Try this 2023-09-07 21:12:09 +00:00
Andre601 df069ebcdc Create publish_docs.yml 2023-09-07 21:03:53 +00:00
Andre601 82f2c476d8 Add domains file 2023-09-07 20:42:54 +00:00
Andre601 3545cac908 Update main class path 2023-09-07 20:28:36 +00:00
Andre601 cb95b833e6 Some smaller changes 2023-09-07 21:59:13 +02:00
Andre601 e2c1c44537 Merge pull request 'feature/move-to-codeberg' (#129) from feature/move-to-codeberg into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/129
2023-09-07 19:51:57 +00:00
Andre601 aeb0587263 Merge branch 'master' into feature/move-to-codeberg 2023-09-07 19:51:35 +00:00
Andre601 3471876687 Fix up release name and missing PlatformInfo data 2023-09-07 21:50:49 +02:00
Andre601 82d58564ee Change HangarUploader to VersionUploader 2023-09-07 21:45:56 +02:00
Andre601 d3918a487a Don't set var for CI_COMMIT_TAG 2023-09-06 19:46:36 +00:00
Andre601 a25232be6a Use echo 2023-09-06 19:43:21 +00:00
Andre601 bfa05f943a .woodpecker/sync_mirror.yml gelöscht 2023-09-06 19:07:39 +00:00
Andre601 dc40a54999 .woodpecker/create_gh_release.yml gelöscht 2023-09-06 19:07:34 +00:00
Andre601 682621e196 Handle Modrinth and Hangar on Codeberg alone. 2023-09-06 19:05:30 +00:00
Andre601 41fa678591 .woodpecker/publish_assets.yml aktualisiert 2023-09-06 11:09:15 +00:00
Andre601 e7557da944 Bump mkdocs-material to 9.2.8 2023-09-04 22:16:40 +02:00
Andre601 c7c9885e18 Also run sync_mirror on tag event 2023-09-04 18:54:00 +00:00
Andre_601 62c665a598 Merge pull request #131 from Andre601/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-09-04 18:18:55 +02:00
dependabot[bot] 6d687d391d Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 15:50:49 +00:00
Andre_601 2ac6b89368 Merge pull request #130 from Andre601/dependabot/pip/mkdocs-material-9.2.7
Bump mkdocs-material from 9.2.6 to 9.2.7
2023-09-04 17:14:24 +02:00
dependabot[bot] b8d4829e02 Bump mkdocs-material from 9.2.6 to 9.2.7
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.2.6 to 9.2.7.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.2.6...9.2.7)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 15:08:51 +00:00
Andre601 a9b4355ebf Update wiki link in issue selector 2023-09-04 00:01:58 +02:00
Andre601 b7f3ecdc5d Use macros for reference docs + update issue templates 2023-09-03 23:58:26 +02:00
Andre601 0428280480 Further changes to API docs generation 2023-09-02 19:15:30 +02:00
Andre_601 31e7fb9a22 Merge pull request #129 from Andre601/dependabot/pip/mkdocs-material-9.2.6
Bump mkdocs-material from 9.2.5 to 9.2.6
2023-08-31 18:01:34 +02:00
dependabot[bot] b3fc768ea7 Bump mkdocs-material from 9.2.5 to 9.2.6
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.2.5 to 9.2.6.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.2.5...9.2.6)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-31 16:00:30 +00:00
Andre601 7b990e798d Add missing abstract attribute to parsePlaceholder 2023-08-31 14:16:13 +02:00
Andre601 7e1e00d246 Move and update .schema.md 2023-08-30 20:08:02 +02:00
Andre601 15677e948d Create templates for semi-automatic doc generation 2023-08-30 19:48:53 +02:00
Andre601 457f85d697 Make sure publish_assets runs after sync_mirror on a release 2023-08-29 14:04:21 +00:00
Andre601 f3a3df648f Create mirror action for hopefully better cb->gh mirror 2023-08-29 14:00:09 +00:00
Andre601 000f3dd680 Update copyright footer 2023-08-29 15:45:01 +02:00
Andre601 db3b0e39b5 Add inheritance notes 2023-08-29 15:30:38 +02:00
Andre601 e5a5cf9f7e [Docs] Add missing abstract label to parsePlaceholder 2023-08-29 14:40:51 +02:00
Andre601 0c3853de2b Fix outdated link in footer 2023-08-29 14:27:12 +02:00
Andre601 0146e594de Fix wrong link in PlaceholderProvider 2023-08-29 03:04:56 +02:00
Andre601 1a790bca41 Add API reference pages 2023-08-29 02:54:53 +02:00
Andre601 fc039ebe93 Bump mkdocs-material to 9.2.5 and add page icons 2023-08-28 15:47:18 +02:00
Andre601 22561f6848 Merge pull request 'Improve docs' (#128) from docs/improvements into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/128
2023-08-28 01:25:39 +00:00
Andre601 8a7ccc07ae Add diff view 2023-08-28 01:25:30 +00:00
Andre601 b43f7b9f31 Add diff view 2023-08-28 01:23:50 +00:00
Andre601 69b3086c65 Improve docs 2023-08-28 01:18:27 +00:00
Andre601 e5b05b5859 Add commands page 2023-08-28 01:14:43 +00:00
Andre601 a07994adb1 Typo 2023-08-28 01:13:15 +00:00
Andre601 8d83b45657 Add pages to nav 2023-08-28 01:11:35 +00:00
Andre601 22371715c5 Merge pull request 'Add migration guides' (#127) from docs/add-migration-guides into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/127
2023-08-28 01:09:35 +00:00
Andre601 8a7d042476 docs/migration/v1_9_0-to-v1_10_0.md hinzugefügt 2023-08-28 01:09:11 +00:00
Andre601 26205cdd67 Add v1.5.3 to v1.6.0 guide 2023-08-28 01:01:24 +00:00
Andre601 ccb9cd5522 Add migration guides 2023-08-28 00:46:20 +00:00
Andre601 2383214b7e Bump mkdocs-material to 9.2.3 2023-08-23 00:18:58 +00:00
Andre601 a82b6bf0e9 Merge pull request 'fix/docs' (#126) from fix/docs into master
Reviewed-on: https://codeberg.org/Andre601/AdvancedServerList/pulls/126
2023-08-23 00:10:35 +00:00
Andre601 3e541e65ed docs/profiles/formatting.md aktualisiert 2023-08-23 00:10:10 +00:00
Andre601 314becdc45 docs/examples.md aktualisiert 2023-08-22 23:59:24 +00:00
Andre601 8f662ced5c Use {} format for matrix variables. 2023-08-22 12:47:00 +00:00
Andre601 3ff782e128 Rename step 2023-08-22 12:13:24 +00:00
Andre601 6a6a708ee7 Obtain release changelog from codeberg. 2023-08-22 12:12:47 +00:00
Andre601 1751a77e6f Add depends_on 2023-08-11 14:25:38 +00:00
Andre601 3069244f21 „.woodpecker/create_gh_release.yml“ ändern 2023-08-04 16:56:10 +00:00
Andre601 99d4232304 Create file for gh release creation 2023-08-04 16:44:57 +00:00
Andre601 ec408316bd Don't use GitHub setup here 2023-08-04 16:39:35 +00:00
Andre601 eee5271966 Add token auth header to avoid rate limits(?) 2023-08-04 16:33:30 +00:00
Andre601 34e4816517 First step towards Codeberg migration 2023-08-04 16:30:15 +00:00
Andre601 7bde6dedb5 Improve HangarUploader 2023-08-02 00:45:37 +02:00
Andre_601 6864f57917 Remove Spigot badge 2023-08-01 18:30:14 +02:00
Andre_601 0b705ca897 Merge pull request #125 from Andre601/dependabot/maven/core/com.google.guava-guava-32.1.2-jre
Bump com.google.guava:guava from 32.1.1-jre to 32.1.2-jre in /core
2023-08-01 17:18:45 +02:00
dependabot[bot] 4661d72f8c Bump com.google.guava:guava from 32.1.1-jre to 32.1.2-jre in /core
Bumps [com.google.guava:guava](https://github.com/google/guava) from 32.1.1-jre to 32.1.2-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-01 15:11:06 +00:00
Andre601 2b7053c724 Don't clear caches on reload 2023-07-30 19:26:45 +02:00
Andre_601 8d81367354 Update docs URLs 2023-07-29 22:32:52 +02:00
Andre_601 facb358404 Update docs URLs 2023-07-29 22:32:02 +02:00
Andre601 fd49e101ca Update HangarUploader 2023-07-28 19:37:47 +02:00
Andre_601 a55e19bb4a Add dependencies 2023-07-28 19:10:16 +02:00
Andre_601 07c1893895 Merge pull request #115 from Andre601/feature/papiproxybridge-support
PAPIProxyBridge support
2023-07-28 18:53:22 +02:00
Andre_601 eed3c37bcb Merge branch 'master' into feature/papiproxybridge-support 2023-07-28 18:50:05 +02:00
Andre601 42d9a54668 Add PAPIProxyBridge as soft-depend 2023-07-28 18:46:26 +02:00
Andre601 51811452fd Use PAPIProxyBridge v1.3 2023-07-28 18:38:50 +02:00
Andre_601 0b21958826 Merge pull request #124 from Andre601/dependabot/pip/mkdocs-material-9.1.21
Bump mkdocs-material from 9.1.20 to 9.1.21
2023-07-28 18:05:41 +02:00
dependabot[bot] f3fdc68dce Bump mkdocs-material from 9.1.20 to 9.1.21
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.20 to 9.1.21.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.20...9.1.21)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-28 16:03:00 +00:00
Andre_601 3b76a2abdd Merge pull request #123 from Andre601/dependabot/pip/mkdocs-material-9.1.20
Bump mkdocs-material from 9.1.19 to 9.1.20
2023-07-27 17:51:30 +02:00
dependabot[bot] 87964d42a7 Bump mkdocs-material from 9.1.19 to 9.1.20
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.19 to 9.1.20.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.19...9.1.20)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-27 15:48:19 +00:00
Andre_601 2529195097 Merge pull request #122 from Andre601/dependabot/maven/core/com.unascribed-flexver-java-1.1.1
Bump com.unascribed:flexver-java from 1.1.0 to 1.1.1 in /core
2023-07-24 17:33:22 +02:00
dependabot[bot] 62e54fe9ea Bump com.unascribed:flexver-java from 1.1.0 to 1.1.1 in /core
Bumps com.unascribed:flexver-java from 1.1.0 to 1.1.1.

---
updated-dependencies:
- dependency-name: com.unascribed:flexver-java
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 15:30:05 +00:00
Andre_601 ad49a0659e Add Folia to supported loaders$ 2023-07-24 01:09:33 +02:00
Andre_601 a703fba542 [Docs] More indent fixes 2023-07-22 17:17:54 +02:00
Andre_601 bc57b549d5 [API] Fix wrong indent in changelog 2023-07-22 17:15:19 +02:00
Andre_601 eed64e0f60 Fix wrong artifactId 2023-07-22 17:10:31 +02:00
Andre_601 a673050489 Merge pull request #121 from Andre601/dependabot/pip/mkdocs-material-9.1.19
Bump mkdocs-material from 9.1.18 to 9.1.19
2023-07-18 17:23:24 +02:00
dependabot[bot] d07890112d Bump mkdocs-material from 9.1.18 to 9.1.19
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.18 to 9.1.19.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.18...9.1.19)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 15:20:59 +00:00
Andre601 9cbd7fb6b7 Fix rare NPE for gson.fromJson in PlayerHandler 2023-07-15 23:47:09 +02:00
Andre601 5055c89cde Implement cache for last used server. 2023-07-15 23:22:53 +02:00
Andre601 eb04cab549 Remove unused getStringList method 2023-07-10 19:44:02 +02:00
Andre601 db2e56a382 Move PAPI stuff to dedicated class. 2023-07-10 14:49:14 +02:00
Andre_601 71313afb01 Merge pull request #119 from Andre601/dependabot/maven/core/com.google.guava-guava-32.1.1-jre
Bump guava from 32.0.1-jre to 32.1.1-jre in /core
2023-07-03 17:36:42 +02:00
Andre_601 039f2f7b8a Merge pull request #118 from Andre601/dependabot/pip/mkdocs-material-9.1.18
Bump mkdocs-material from 9.1.17 to 9.1.18
2023-07-03 17:36:10 +02:00
dependabot[bot] b34c7b3cec Bump guava from 32.0.1-jre to 32.1.1-jre in /core
Bumps [guava](https://github.com/google/guava) from 32.0.1-jre to 32.1.1-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-03 15:33:34 +00:00
dependabot[bot] 40e1fb1f02 Bump mkdocs-material from 9.1.17 to 9.1.18
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.17 to 9.1.18.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.17...9.1.18)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-03 15:18:43 +00:00
Andre_601 9292a46a86 Merge pull request #116 from Andre601/dependabot/pip/mkdocs-material-9.1.17
Bump mkdocs-material from 9.1.16 to 9.1.17
2023-06-26 19:13:18 +02:00
dependabot[bot] fbb7e0f103 Bump mkdocs-material from 9.1.16 to 9.1.17
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.16 to 9.1.17.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.16...9.1.17)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 16:04:25 +00:00
Andre_601 c6b6187fe8 Create labeler.yml 2023-06-24 13:29:48 +02:00
Andre601 937929c3c5 PAPIProxyBridge support 2023-06-23 20:34:15 +02:00
Andre601 04534e18c3 Make sure api-version is a string 2023-06-23 17:35:48 +02:00
Andre_601 6a3adee315 Merge pull request #114 from Andre601/dependabot/maven/bukkit/org.apache.maven.plugins-maven-shade-plugin-3.5.0
Bump maven-shade-plugin from 3.4.1 to 3.5.0 in /bukkit
2023-06-19 18:28:07 +02:00
Andre_601 dddea9c022 Merge pull request #113 from Andre601/dependabot/maven/velocity/org.apache.maven.plugins-maven-shade-plugin-3.5.0
Bump maven-shade-plugin from 3.4.1 to 3.5.0 in /velocity
2023-06-19 18:27:53 +02:00
dependabot[bot] a5029f22ad Bump maven-shade-plugin from 3.4.1 to 3.5.0 in /bukkit
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.4.1...maven-shade-plugin-3.5.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-shade-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 16:08:13 +00:00
dependabot[bot] e425ae4ce3 Bump maven-shade-plugin from 3.4.1 to 3.5.0 in /velocity
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.4.1...maven-shade-plugin-3.5.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-shade-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 16:01:30 +00:00
Andre_601 48163610a4 Make note about priority and conditions more clear 2023-06-19 15:24:47 +02:00
Andre_601 78fc37c2d7 Add missing whitelistEnabled placeholder 2023-06-18 16:18:36 +02:00
Andre_601 61aceb3fe8 Merge pull request #112 from Andre601/feature/new-placeholder-features
Allow multiple servers/worlds for playersOnline, add whitelistEnabled for spigot/paper and config backup on migration.
2023-06-18 15:52:04 +02:00
Andre601 2ccb2a470f Use the right method for whitelistEnabled
+ config migrator backup
2023-06-18 15:44:37 +02:00
Andre601 849ea169a2 Make backups during config migrations. 2023-06-18 15:34:06 +02:00
Andre601 da7ae22535 Allow multiple worlds/Servers for playersOnline 2023-06-18 15:12:47 +02:00
Andre_601 fbd8d9fffa Merge pull request #110 from Andre601/dependabot/maven/bungeecord/org.apache.maven.plugins-maven-shade-plugin-3.5.0
Bump maven-shade-plugin from 3.4.1 to 3.5.0 in /bungeecord
2023-06-16 18:05:14 +02:00
Andre_601 df10bdcc65 Merge pull request #109 from Andre601/dependabot/maven/core/org.apache.maven.plugins-maven-shade-plugin-3.5.0
Bump maven-shade-plugin from 3.4.1 to 3.5.0 in /core
2023-06-16 18:05:00 +02:00
dependabot[bot] da1ada5a10 Bump maven-shade-plugin from 3.4.1 to 3.5.0 in /bungeecord
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.4.1...maven-shade-plugin-3.5.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-shade-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-16 15:59:58 +00:00
dependabot[bot] 21f083dda1 Bump maven-shade-plugin from 3.4.1 to 3.5.0 in /core
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.4.1...maven-shade-plugin-3.5.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-shade-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-16 15:59:44 +00:00
Andre_601 e7882d1be8 Include GitHub Actions account in git 2023-06-15 22:39:59 +02:00
Andre_601 81ed3a441f Merge pull request #108 from Andre601/dependabot/pip/mkdocs-material-9.1.16
Bump mkdocs-material from 9.1.15 to 9.1.16
2023-06-15 18:16:41 +02:00
dependabot[bot] 41381f498e Bump mkdocs-material from 9.1.15 to 9.1.16
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.15 to 9.1.16.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.15...9.1.16)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-15 16:02:48 +00:00
Andre601 e669a995a7 Include 1.20 in HangarUploader 2023-06-12 17:21:17 +02:00
Andre601 aad10a1146 Fix broken version check for config 2023-06-11 21:38:29 +02:00
Andre601 eb4455797a Force a block-style for sections 2023-06-11 21:35:02 +02:00
Andre601 02f1e68522 Fix some ConfigMigrator stuff 2023-06-11 21:30:31 +02:00
Andre_601 933d5f1e48 Merge pull request #96 from Andre601/feature/more-placeholders
Add Server placeholder options
2023-06-11 20:56:59 +02:00
Andre601 50e2fa95bf Bump API version 2023-06-11 20:52:00 +02:00
Andre_601 c908e6dc21 Merge pull request #105 from Andre601/feature/paper-plugin-changes
Use new Paper plugin dependency structure
2023-06-11 20:51:26 +02:00
Andre601 ccbe2afffb Add small comment 2023-06-11 20:42:02 +02:00
Andre_601 3d94259160 Merge pull request #107 from Andre601/dependabot/maven/core/com.google.guava-guava-32.0.1-jre
Bump guava from 32.0.0-jre to 32.0.1-jre in /core
2023-06-09 21:26:56 +02:00
Andre_601 ee6d596493 Fix wrong URL 2023-06-09 21:26:29 +02:00
dependabot[bot] 8c608b60bd Bump guava from 32.0.0-jre to 32.0.1-jre in /core
Bumps [guava](https://github.com/google/guava) from 32.0.0-jre to 32.0.1-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-09 16:00:07 +00:00
Andre_601 2b5e7d98c8 Update success.md 2023-06-08 22:43:20 +02:00
Andre_601 ee6e879c08 Use nightly.link 2023-06-08 22:42:56 +02:00
Andre_601 639084806a Update MODRINTH.md 2023-06-08 17:48:56 +02:00
Andre_601 74a929d0ad Add note about adventure online tool 2023-06-08 17:44:38 +02:00
Andre_601 5caffcb49a Merge pull request #106 from Andre601/dependabot/maven/bukkit/com.viaversion-viaversion-api-4.7.0
Bump viaversion-api from 4.6.2 to 4.7.0 in /bukkit
2023-06-07 20:09:56 +02:00
dependabot[bot] ce73d3c0e7 Bump viaversion-api from 4.6.2 to 4.7.0 in /bukkit
Bumps viaversion-api from 4.6.2 to 4.7.0.

---
updated-dependencies:
- dependency-name: com.viaversion:viaversion-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 18:00:25 +00:00
Andre_601 a0b59aecc8 Merge pull request #104 from Andre601/dependabot/maven/core/net.kyori-adventure-text-serializer-legacy-4.14.0
Bump adventure-text-serializer-legacy from 4.13.1 to 4.14.0 in /core
2023-06-07 19:43:37 +02:00
Andre_601 3758a99ae2 Update checked modules 2023-06-07 19:42:21 +02:00
Andre_601 1f45f5c3e5 Merge pull request #103 from Andre601/dependabot/maven/core/net.kyori-adventure-text-minimessage-4.14.0
Bump adventure-text-minimessage from 4.13.1 to 4.14.0 in /core
2023-06-07 19:41:05 +02:00
Andre_601 937dc93366 Merge pull request #102 from Andre601/dependabot/maven/core/net.kyori-adventure-api-4.14.0
Bump adventure-api from 4.13.1 to 4.14.0 in /core
2023-06-07 19:38:35 +02:00
Andre601 b4dffedd09 Use new Paper plugin dependency structure 2023-06-07 19:24:46 +02:00
dependabot[bot] ae1e16ca8b Bump adventure-text-serializer-legacy from 4.13.1 to 4.14.0 in /core
Bumps [adventure-text-serializer-legacy](https://github.com/KyoriPowered/adventure) from 4.13.1 to 4.14.0.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.13.1...v4.14.0)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-text-serializer-legacy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 16:00:18 +00:00
dependabot[bot] 775482ea0f Bump adventure-text-minimessage from 4.13.1 to 4.14.0 in /core
Bumps [adventure-text-minimessage](https://github.com/KyoriPowered/adventure) from 4.13.1 to 4.14.0.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.13.1...v4.14.0)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-text-minimessage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 16:00:15 +00:00
dependabot[bot] 6fa848f730 Bump adventure-api from 4.13.1 to 4.14.0 in /core
Bumps [adventure-api](https://github.com/KyoriPowered/adventure) from 4.13.1 to 4.14.0.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.13.1...v4.14.0)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 16:00:10 +00:00
Andre_601 6a1d720f08 Merge branch 'master' into feature/more-placeholders 2023-05-30 00:07:05 +02:00
Andre_601 7d72af0e44 Fix protocollib version 2023-05-29 18:06:27 +02:00
Andre_601 ef1a34bdec Merge pull request #100 from Andre601/dependabot/maven/core/com.google.guava-guava-32.0.0-jre
Bump guava from 31.1-jre to 32.0.0-jre in /core
2023-05-29 18:05:42 +02:00
Andre_601 c30334d2af Merge pull request #101 from Andre601/dependabot/pip/mkdocs-material-9.1.15
Bump mkdocs-material from 9.1.14 to 9.1.15
2023-05-29 18:05:34 +02:00
dependabot[bot] da71fc0af9 Bump mkdocs-material from 9.1.14 to 9.1.15
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.14 to 9.1.15.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.14...9.1.15)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 16:04:35 +00:00
dependabot[bot] f5ff4702e5 Bump guava from 31.1-jre to 32.0.0-jre in /core
Bumps [guava](https://github.com/google/guava) from 31.1-jre to 32.0.0-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 16:02:52 +00:00
Andre601 257031827d Try 5.0.0 of ProtocolLib 2023-05-29 00:37:59 +02:00
Andre601 5e9c6f43fe Merge branch 'master' into feature/more-placeholders 2023-05-29 00:31:27 +02:00
Andre601 bfc76290a7 Populate map on Server Load 2023-05-27 21:58:24 +02:00
Andre_601 4d8139bb3e Merge pull request #99 from Andre601/dependabot/pip/mkdocs-material-9.1.14
Bump mkdocs-material from 9.1.13 to 9.1.14
2023-05-22 18:42:54 +02:00
dependabot[bot] 77cc783855 Bump mkdocs-material from 9.1.13 to 9.1.14
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.13 to 9.1.14.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.13...9.1.14)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-22 16:07:36 +00:00
Andre601 d01605ee47 Update API changelog 2023-05-22 01:27:52 +02:00
Andre601 8128f3e4af Use asl-api v3 2023-05-22 01:11:21 +02:00
Andre_601 10436a55bb Update to mc-publish 3.3 2023-05-20 12:23:26 +02:00
Andre601 740bf63afa remove broken import 2023-05-18 00:09:23 +02:00
Andre601 9508f34cc2 Cache worlds for Spigot and Paper 2023-05-17 23:59:40 +02:00
Andre_601 10de3a42f4 Merge pull request #98 from Andre601/dependabot/pip/mkdocs-material-9.1.13
Bump mkdocs-material from 9.1.12 to 9.1.13
2023-05-17 19:25:13 +02:00
dependabot[bot] 407008284b Bump mkdocs-material from 9.1.12 to 9.1.13
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.12 to 9.1.13.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.12...9.1.13)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-17 16:03:15 +00:00
Andre601 e2fd877e91 Add glightbox mkdocs plugin 2023-05-16 15:40:17 +02:00
Andre601 ca16f618d8 Add config migration + case-insensitive equals 2023-05-16 15:37:58 +02:00
Andre_601 80731117a3 Merge pull request #97 from Andre601/dependabot/pip/mkdocs-material-9.1.12
Bump mkdocs-material from 9.1.11 to 9.1.12
2023-05-12 18:19:29 +02:00
dependabot[bot] dc62ef0989 Bump mkdocs-material from 9.1.11 to 9.1.12
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.11 to 9.1.12.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.11...9.1.12)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-12 16:12:52 +00:00
Andre_601 13209e7a79 Add timezone indicator 2023-05-12 00:31:58 +02:00
Andre_601 8edb7b194a Add timezone 2023-05-12 00:30:35 +02:00
Andre_601 354b5f83b2 Update to latest template action 2023-05-12 00:22:35 +02:00
Andre_601 5e568c68c4 Update to latest template action 2023-05-12 00:22:16 +02:00
Andre601 5cc9678b5a Update docs 2023-05-10 11:31:20 +02:00
Andre601 ae5a5973aa Trigger Workflow 2023-05-10 11:03:59 +02:00
Andre_601 5a589b2297 Fix JSON paths 2023-05-10 11:03:56 +02:00
Andre601 e6bc14fca5 Trigger Workflow 2023-05-10 10:59:43 +02:00
Andre_601 95d67a270b Use different date 2023-05-10 10:59:35 +02:00
Andre601 559d5a2d9b Trigger Workflow 2023-05-10 10:55:54 +02:00
Andre_601 a60bffa04d Update template action 2023-05-10 10:37:44 +02:00
Andre_601 1a5dd75157 Update template action 2023-05-10 10:37:24 +02:00
Andre601 f5113d3d45 Trigger Workflow 2023-05-09 20:01:12 +02:00
Andre_601 cddd2dbeb7 Remove :funcs 2023-05-09 20:01:10 +02:00
Andre601 10da7c9eeb Trigger Workflow 2023-05-09 19:59:21 +02:00
Andre_601 e50bbf4620 Try newer commit SHA 2023-05-09 19:59:19 +02:00
Andre_601 fe1b6dc0e5 Try newer commit SHA 2023-05-09 19:59:05 +02:00
Andre601 a20acf5378 Trigger Workflow 2023-05-09 19:52:52 +02:00
Andre_601 1d74640d67 Update success.md 2023-05-09 19:52:39 +02:00
Andre_601 20e3f908f9 Use :funcs 2023-05-09 19:51:48 +02:00
Andre_601 8b2a499d20 use :funcs 2023-05-09 19:51:27 +02:00
Andre601 d8ba5ffaea Trigger Workflow 2023-05-09 18:35:19 +02:00
Andre_601 608c617b17 Remove - from placeholder 2023-05-09 18:34:41 +02:00
Andre_601 50d47a0c65 Don't use - I guess? 2023-05-09 18:33:37 +02:00
Andre601 1d41072767 Trigger Workflow 2023-05-09 18:30:42 +02:00
Andre_601 2ffd7f479b Checkout repo 2023-05-09 18:30:39 +02:00
Andre_601 38f1e4f21d Checkout repo 2023-05-09 18:30:03 +02:00
Andre601 33f29b5694 Trigger Workflow 2023-05-09 18:25:52 +02:00
Andre_601 4b6901467f Revert artifact info getting 2023-05-09 18:23:55 +02:00
Andre_601 62dc420d55 Prefix path with ./ 2023-05-09 18:20:02 +02:00
Andre_601 d7cb52d785 Try with ./ prefixed path 2023-05-09 18:19:11 +02:00
Andre_601 67bdd98a5b Merge pull request #86 from Andre601/feature/improve-pr-comment-action
Update pr-comment.yml
2023-05-09 18:10:21 +02:00
Andre_601 ffa0da8f1c Update building.md 2023-05-09 18:07:24 +02:00
Andre_601 abb2378bf2 Wrong location for the options 2023-05-09 18:06:02 +02:00
Andre_601 d10c6ffb78 Merge pull request #95 from Andre601/dependabot/pip/mkdocs-material-9.1.11
Bump mkdocs-material from 9.1.9 to 9.1.11
2023-05-09 18:05:36 +02:00
dependabot[bot] e2b4fdf72f Bump mkdocs-material from 9.1.9 to 9.1.11
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.9 to 9.1.11.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.9...9.1.11)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-09 16:03:25 +00:00
Andre_601 993c665445 Update failed.md 2023-05-09 18:00:52 +02:00
Andre_601 607b95b723 Update success.md 2023-05-09 18:00:18 +02:00
Andre_601 8476e72e9a Update failed.md 2023-05-09 17:54:35 +02:00
Andre_601 57b782d7d7 Update create-pr-artifact.yml 2023-05-09 17:53:31 +02:00
Andre_601 2dd3b04dbe Use experimental template action ver 2023-05-09 17:51:59 +02:00
Andre_601 38d6ac3972 Merge pull request #94 from Andre601/fix/81-noclassdeffoundexception-issue
Fix ProtocolLib component issue
2023-05-08 17:38:06 +02:00
Andre601 360b961221 Bump version 2023-05-08 17:34:57 +02:00
Andre601 ef22ede56d Fix ProtocolLib component issue 2023-05-08 17:03:09 +02:00
Andre601 afa18b81fe Add Server placeholder options 2023-05-08 17:00:35 +02:00
Andre_601 ec9ea799cf Merge pull request #93 from Andre601/dependabot/pip/mkdocs-material-9.1.9
Bump mkdocs-material from 9.1.8 to 9.1.9
2023-05-02 18:12:08 +02:00
dependabot[bot] 99f762ff18 Bump mkdocs-material from 9.1.8 to 9.1.9
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.8 to 9.1.9.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.8...9.1.9)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-02 16:04:19 +00:00
Andre601 2bd59ff554 Load JoinEvent properly on Paper 2023-04-26 23:21:07 +02:00
Andre601 53157a7c06 Bump version 2023-04-26 23:11:20 +02:00
Andre_601 bfc39ab172 Merge pull request #91 from Andre601/feature/plugin-improvements
Plugin improvements
2023-04-26 23:08:39 +02:00
Andre_601 fa44192bd3 Ignore non-code files 2023-04-26 18:30:58 +02:00
Andre_601 53fc434bdd Merge pull request #92 from Andre601/dependabot/pip/mkdocs-material-9.1.8
Bump mkdocs-material from 9.1.7 to 9.1.8
2023-04-26 18:28:42 +02:00
dependabot[bot] b6152372a8 Bump mkdocs-material from 9.1.7 to 9.1.8
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.7 to 9.1.8.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.7...9.1.8)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-26 16:03:16 +00:00
Andre_601 5441d2bd96 Merge pull request #88 from Andre601/dependabot/maven/velocity/com.squareup.okhttp3-okhttp-4.11.0
Bump okhttp from 4.10.0 to 4.11.0 in /velocity
2023-04-24 18:35:57 +02:00
Andre_601 2d358f76c0 Merge pull request #89 from Andre601/dependabot/maven/core/com.squareup.okhttp3-okhttp-4.11.0
Bump okhttp from 4.10.0 to 4.11.0 in /core
2023-04-24 18:34:34 +02:00
Andre_601 d1cbaa3ef6 Merge pull request #90 from Andre601/dependabot/pip/mkdocs-material-9.1.7
Bump mkdocs-material from 9.1.6 to 9.1.7
2023-04-24 18:34:05 +02:00
dependabot[bot] 29513d953d Bump mkdocs-material from 9.1.6 to 9.1.7
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.6 to 9.1.7.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.6...9.1.7)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-24 16:06:42 +00:00
dependabot[bot] 365ec3d6f5 Bump okhttp from 4.10.0 to 4.11.0 in /core
Bumps [okhttp](https://github.com/square/okhttp) from 4.10.0 to 4.11.0.
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-4.10.0...parent-4.11.0)

---
updated-dependencies:
- dependency-name: com.squareup.okhttp3:okhttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-24 16:02:45 +00:00
dependabot[bot] d4babddc31 Bump okhttp from 4.10.0 to 4.11.0 in /velocity
Bumps [okhttp](https://github.com/square/okhttp) from 4.10.0 to 4.11.0.
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-4.10.0...parent-4.11.0)

---
updated-dependencies:
- dependency-name: com.squareup.okhttp3:okhttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-24 16:02:17 +00:00
Andre601 648b656dd4 Reduce duplicate code. 2023-04-22 00:04:21 +02:00
Andre601 b2b71144d9 Improve plugin code... I guess? 2023-04-21 23:34:22 +02:00
Andre601 17357345ab Use old badge system + add template render 2023-04-17 00:09:30 +02:00
Andre601 f696fc2160 Add missing perms and command info 2023-04-16 23:35:39 +02:00
Andre_601 b9885c1249 Update building.md 2023-04-16 23:29:58 +02:00
Andre_601 e357f370e0 Update failed.md 2023-04-16 23:29:08 +02:00
Andre_601 d777ac84f0 Create success.md 2023-04-16 23:28:52 +02:00
Andre_601 5da627b1b6 Create failed.md 2023-04-16 23:24:10 +02:00
Andre_601 8ee063daec Merge pull request #87 from Andre601/feature/pr-comment-files
Create building.md
2023-04-16 23:19:47 +02:00
Andre_601 ad46149bb6 Create building.md 2023-04-16 23:18:50 +02:00
Andre_601 528226401f Update pr-comment.yml 2023-04-14 23:38:30 +02:00
Andre_601 97a71958e1 Add permission 2023-04-14 23:32:19 +02:00
Andre_601 b15d5f0633 Add permissions 2023-04-14 23:32:03 +02:00
Andre601 b4e39ca985 Add examples to profiles page 2023-04-13 16:24:56 +02:00
Andre_601 5aae2cccdc Add comment info output 2023-04-11 21:48:11 +02:00
Andre_601 c7ccd48037 Add some info lines 2023-04-11 21:47:31 +02:00
Andre_601 2b6c904fbf Update pr-comment.yml 2023-04-11 21:36:16 +02:00
Andre_601 eeefea3f6a Make finding comment more precise 2023-04-11 21:33:45 +02:00
Andre_601 2840c29a90 Merge pull request #85 from Andre601/dependabot/pip/mkdocs-material-9.1.6
Bump mkdocs-material from 9.1.5 to 9.1.6
2023-04-10 18:07:20 +02:00
Andre_601 862e631405 Merge pull request #84 from Andre601/dependabot/maven/core/net.kyori-adventure-text-serializer-legacy-4.13.1
Bump adventure-text-serializer-legacy from 4.13.0 to 4.13.1 in /core
2023-04-10 18:06:45 +02:00
dependabot[bot] f00737b0f0 Bump mkdocs-material from 9.1.5 to 9.1.6
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.5 to 9.1.6.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.5...9.1.6)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 16:06:42 +00:00
Andre_601 2d4d1d3136 Merge pull request #83 from Andre601/dependabot/maven/core/net.kyori-adventure-api-4.13.1
Bump adventure-api from 4.13.0 to 4.13.1 in /core
2023-04-10 18:06:38 +02:00
Andre_601 04d255bb54 Merge pull request #82 from Andre601/dependabot/maven/core/net.kyori-adventure-text-minimessage-4.13.1
Bump adventure-text-minimessage from 4.13.0 to 4.13.1 in /core
2023-04-10 18:06:30 +02:00
dependabot[bot] f77db9c760 Bump adventure-text-serializer-legacy from 4.13.0 to 4.13.1 in /core
Bumps [adventure-text-serializer-legacy](https://github.com/KyoriPowered/adventure) from 4.13.0 to 4.13.1.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.13.0...v4.13.1)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-text-serializer-legacy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 16:03:03 +00:00
dependabot[bot] 9cde35aa2f Bump adventure-api from 4.13.0 to 4.13.1 in /core
Bumps [adventure-api](https://github.com/KyoriPowered/adventure) from 4.13.0 to 4.13.1.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.13.0...v4.13.1)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 16:02:53 +00:00
dependabot[bot] 13ca53140c Bump adventure-text-minimessage from 4.13.0 to 4.13.1 in /core
Bumps [adventure-text-minimessage](https://github.com/KyoriPowered/adventure) from 4.13.0 to 4.13.1.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.13.0...v4.13.1)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-text-minimessage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 16:02:46 +00:00
Andre_601 bc1d0722fa Merge pull request #80 from Andre601/feature/gh-actions-include-commit
Include Commit SHA in PR builds
2023-04-08 02:12:09 +02:00
Andre601 6201342ca7 Trigger new workflow 2023-04-08 02:06:42 +02:00
Andre_601 801e0a2749 Use PR SHA 2023-04-08 02:04:22 +02:00
Andre601 10718e6d03 Include Commit SHA in PR builds 2023-04-08 01:52:31 +02:00
Andre601 03203345c0 Include commit SHA for PR builds 2023-04-08 01:49:23 +02:00
Andre601 3ade0952e2 Folia support 2023-04-06 21:22:33 +02:00
Andre_601 f0e30d47dc typo fixes 2023-04-05 19:37:11 +02:00
Andre_601 bb94510858 Update URL and add expire date 2023-04-05 19:33:03 +02:00
Andre_601 c9d94619dd Merge pull request #77 from Andre601/dependabot/github_actions/peter-evans/create-or-update-comment-3
Bump peter-evans/create-or-update-comment from 2 to 3
2023-04-05 18:59:21 +02:00
dependabot[bot] 7ab8749421 Bump peter-evans/create-or-update-comment from 2 to 3
Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 2 to 3.
- [Release notes](https://github.com/peter-evans/create-or-update-comment/releases)
- [Commits](https://github.com/peter-evans/create-or-update-comment/compare/v2...v3)

---
updated-dependencies:
- dependency-name: peter-evans/create-or-update-comment
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-05 16:00:47 +00:00
Andre_601 a9216cc82c Improve badges 2023-04-05 17:13:28 +02:00
Andre_601 f14ef643b8 Improve badge 2023-04-05 17:10:47 +02:00
Andre_601 cc876d2f21 Fix Java version 2023-04-05 16:57:20 +02:00
Andre_601 0f8693add2 typo fixes 2023-04-05 16:50:55 +02:00
Andre_601 dcc9d18dbe typo fixes 2023-04-05 16:50:29 +02:00
Andre_601 f579aa0088 Fix broken ref 2023-04-05 16:48:19 +02:00
Andre601 579b945fbd Update workflow 2023-04-04 15:55:28 +02:00
Andre601 664bea8109 Create actions for PR previews. 2023-04-04 15:53:13 +02:00
Andre601 73d94e99e4 Fix length check 2023-04-03 21:26:09 +02:00
Andre601 389ed1df53 Improve HangarUploader 2023-04-03 21:22:01 +02:00
Andre601 5f4a07cb71 Remove cache 2023-04-03 20:59:23 +02:00
Andre601 b16f5e193c fix wrong path (hopefully) 2023-04-03 20:56:58 +02:00
Andre601 1c423e6cfa Add debug workflow 2023-04-03 20:52:10 +02:00
Andre601 a27dcd5248 Fix workflow file 2023-04-03 20:42:08 +02:00
Andre601 17bd1782fb Remove Paper module 2023-04-03 20:33:52 +02:00
Andre_601 96c44dafe2 Merge pull request #75 from Andre601/feature/hangar-automation
Automate Hangar publishing
2023-04-03 20:30:24 +02:00
Andre601 d4d9a7e3c5 Temporarely disable pr-build action 2023-04-03 20:29:32 +02:00
Andre601 9f0f7297f0 Final touches 2023-04-03 20:20:16 +02:00
Andre601 691cb14c63 Merge actions 2023-04-03 18:37:44 +02:00
Andre601 8670ea026e Pretty-print date (Also temp remove ViaVersion) 2023-04-03 17:40:09 +02:00
Andre601 27c019c00d Remove posting of the JSON Body 2023-04-03 17:25:33 +02:00
Andre601 d34ea9c2ad Further reduce dependency sizes 2023-04-03 17:21:47 +02:00
Andre601 74a61f2e09 Don't include ViaVersion dependency. 2023-04-03 16:33:36 +02:00
Andre601 5e550d5a7f Add JSON body for debugging 2023-04-03 15:13:11 +02:00
Andre601 b1180c0a8e Make plugin run on Folia 2023-04-03 01:38:40 +02:00
Andre601 fc4253acce Include body in error logging 2023-04-03 01:37:48 +02:00
Andre601 a4e2cc29d5 Add more logging messages 2023-04-03 01:24:19 +02:00
Andre601 95097a581a Fix jar names and add logback.xml 2023-04-03 01:10:33 +02:00
Andre601 aff3aefb72 Add mainClass attribute 2023-04-03 01:04:22 +02:00
Andre_601 089e56be70 Set working-directory 2023-04-03 00:58:05 +02:00
Andre601 e7b8f1a0dc First attempt at hangar automation... 2023-04-03 00:54:17 +02:00
Andre_601 a2252f55c4 Update hangar.yml 2023-04-03 00:53:24 +02:00
Andre_601 dcd6a1e867 try with just one file 2023-04-02 23:04:46 +02:00
Andre_601 24bf5193ff fix file names 2023-04-02 22:50:14 +02:00
Andre_601 2e0068115d Create hangar.yml 2023-04-02 22:43:29 +02:00
Andre_601 1accbfb5f0 Merge pull request #73 from Andre601/dependabot/pip/mkdocs-material-9.1.5
Bump mkdocs-material from 9.1.4 to 9.1.5
2023-03-31 18:10:44 +02:00
dependabot[bot] f0f520d12b Bump mkdocs-material from 9.1.4 to 9.1.5
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.4 to 9.1.5.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.4...9.1.5)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-31 16:03:53 +00:00
Andre601 3edef1c2e4 Bump API and plugin version for release 2023-03-29 18:41:31 +02:00
Andre_601 0c835da51a Merge pull request #72 from Andre601/dependabot/maven/velocity/org.bstats-bstats-velocity-3.0.2
Bump bstats-velocity from 3.0.1 to 3.0.2 in /velocity
2023-03-29 18:31:46 +02:00
dependabot[bot] 1dc937e7b6 Bump bstats-velocity from 3.0.1 to 3.0.2 in /velocity
Bumps [bstats-velocity](https://github.com/Bastian/bStats-Metrics) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/Bastian/bStats-Metrics/releases)
- [Commits](https://github.com/Bastian/bStats-Metrics/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: org.bstats:bstats-velocity
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-29 16:10:44 +00:00
Andre_601 8d63d92ab0 Merge pull request #71 from Andre601/dependabot/maven/paper/org.bstats-bstats-bukkit-3.0.2
Bump bstats-bukkit from 3.0.1 to 3.0.2 in /paper
2023-03-29 18:02:40 +02:00
dependabot[bot] 2ade1c2506 Bump bstats-bukkit from 3.0.1 to 3.0.2 in /paper
Bumps [bstats-bukkit](https://github.com/Bastian/bStats-Metrics) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/Bastian/bStats-Metrics/releases)
- [Commits](https://github.com/Bastian/bStats-Metrics/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: org.bstats:bstats-bukkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-29 16:01:29 +00:00
Andre_601 c1b699aab7 Merge pull request #69 from Andre601/dependabot/maven/paper/com.viaversion-viaversion-api-4.6.2
Bump viaversion-api from 4.6.1 to 4.6.2 in /paper
2023-03-27 18:08:25 +02:00
dependabot[bot] 6d5fc7a697 Bump viaversion-api from 4.6.1 to 4.6.2 in /paper
Bumps viaversion-api from 4.6.1 to 4.6.2.

---
updated-dependencies:
- dependency-name: com.viaversion:viaversion-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 16:07:49 +00:00
Andre_601 a5acd73482 Add "Available on SpigotMC" badge 2023-03-24 23:03:16 +01:00
Andre_601 f1afcc0fd8 Merge pull request #68 from Andre601/dependabot/pip/mkdocs-material-9.1.4
Bump mkdocs-material from 9.1.3 to 9.1.4
2023-03-24 17:23:02 +01:00
dependabot[bot] 9922485c34 Bump mkdocs-material from 9.1.3 to 9.1.4
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.3 to 9.1.4.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.3...9.1.4)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-24 16:13:48 +00:00
Andre601 9ee543fe28 Use old Command handling for Spigot 2023-03-23 20:11:30 +01:00
Andre_601 da4eccdfcc remove spigot 2023-03-23 20:00:45 +01:00
Andre_601 89f5a45809 Use own fork for hangar badge 2023-03-23 18:24:25 +01:00
Andre601 29664fde70 Fix wrong artifact name 2023-03-23 16:50:39 +01:00
Andre601 40f362f1de Fix some PAPI placeholder stuff 2023-03-23 16:41:08 +01:00
Andre_601 07cef34a37 Merge pull request #50 from Andre601/feature/paper-plugin-support
First steps towards paper-plugin support
2023-03-23 16:22:43 +01:00
Andre601 afa80581e5 Bump version to 3.0.0-b1 2023-03-23 16:22:15 +01:00
Andre601 db2366e2ce Merge branch 'master' into feature/paper-plugin-support 2023-03-23 16:18:46 +01:00
Andre601 b54151813f Update release action to allow beta-releases 2023-03-23 16:14:59 +01:00
Andre601 2be041a613 Fix wrong path (Also ignore other jobs for now 2023-03-23 16:04:33 +01:00
Andre601 86411571ef Test out pre-release detection 2023-03-23 15:52:32 +01:00
Andre_601 d80236fef8 Remove paper module 2023-03-21 02:59:32 +01:00
Andre601 fe6fae58e3 Add Profiles example and fix badges width 2023-03-21 02:54:36 +01:00
Andre_601 b2e2b18d33 Add Pip (Python) to dependabot checks 2023-03-21 02:20:51 +01:00
Andre_601 d8e54c7ff0 Remove mike from requirements.txt 2023-03-21 02:16:53 +01:00
Andre_601 f0743d691f Merge pull request #66 from Andre601/dependabot/maven/spigot/org.apache.maven.plugins-maven-shade-plugin-3.4.1
Bump maven-shade-plugin from 3.4.0 to 3.4.1 in /spigot
2023-03-20 17:10:25 +01:00
Andre_601 4b68253c7d Merge pull request #65 from Andre601/dependabot/maven/spigot/org.apache.maven.plugins-maven-compiler-plugin-3.11.0
Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /spigot
2023-03-20 17:10:12 +01:00
Andre_601 d1cee68355 Merge pull request #64 from Andre601/dependabot/maven/spigot/me.clip-placeholderapi-2.11.3
Bump placeholderapi from 2.11.2 to 2.11.3 in /spigot
2023-03-20 17:09:38 +01:00
Andre_601 07d3ea088a Merge pull request #63 from Andre601/dependabot/maven/paper/me.clip-placeholderapi-2.11.3
Bump placeholderapi from 2.11.2 to 2.11.3 in /paper
2023-03-20 17:09:23 +01:00
dependabot[bot] 912fb967fb Bump maven-shade-plugin from 3.4.0 to 3.4.1 in /spigot
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.4.0...maven-shade-plugin-3.4.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-shade-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 16:07:52 +00:00
dependabot[bot] d960644cc1 Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /spigot
Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.1 to 3.11.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.1...maven-compiler-plugin-3.11.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 16:07:39 +00:00
dependabot[bot] 34908b4123 Bump placeholderapi from 2.11.2 to 2.11.3 in /spigot
Bumps placeholderapi from 2.11.2 to 2.11.3.

---
updated-dependencies:
- dependency-name: me.clip:placeholderapi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 16:07:31 +00:00
dependabot[bot] 00466f1ffb Bump placeholderapi from 2.11.2 to 2.11.3 in /paper
Bumps placeholderapi from 2.11.2 to 2.11.3.

---
updated-dependencies:
- dependency-name: me.clip:placeholderapi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 16:07:22 +00:00
Andre601 d05527634d Add clearCache subcommand.
Also, add convenience methods for sending prefixed messages.
2023-03-20 15:09:02 +01:00
Andre601 6e017219b4 Add ViaVersion as soft-depend 2023-03-20 14:33:31 +01:00
Andre601 8fa66867bc Load PaperPingEvent and also improve PAPI placeholders 2023-03-18 17:07:28 +01:00
Andre601 1df167b66a Merge branch 'master' into feature/paper-plugin-support 2023-03-18 16:13:51 +01:00
Andre601 ffee02095f Remove unused import 2023-03-18 16:07:48 +01:00
Andre601 0fc7c7f047 Bump ProtocolLib version 2023-03-18 15:58:07 +01:00
Andre_601 c8ae03da16 Merge pull request #62 from Andre601/dependabot/github_actions/actions/cache-3
Bump actions/cache from 2 to 3
2023-03-17 18:06:33 +01:00
dependabot[bot] dc4165465e Bump actions/cache from 2 to 3
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-17 16:01:55 +00:00
Andre601 05c32cd721 [Docs] Update badges to v3 2023-03-17 14:43:36 +01:00
Andre601 ccd326f036 Add ViaVersion to dependencies list 2023-03-17 14:31:03 +01:00
Andre601 e9117c8040 Revert docs to MkDocs only
(Mike kinda sucks, ngl)
2023-03-17 14:24:43 +01:00
Andre601 116714f9a4 Try fixing page deploy. 2023-03-17 01:30:27 +01:00
Andre601 06f025c50e Add missing page to nav 2023-03-17 01:26:57 +01:00
Andre601 25787e8c51 Include 1.19.4 in supported versions 2023-03-17 01:22:40 +01:00
Andre601 741ca73c62 Add PlaceholderAPI placeholders 2023-03-17 01:22:02 +01:00
Andre601 50944717ea Merge docs update into releas action 2023-03-17 01:01:21 +01:00
Andre_601 89d2d04c12 Merge pull request #61 from Andre601/dependabot/maven/spigot/net.kyori-adventure-platform-bukkit-4.3.0
Bump adventure-platform-bukkit from 4.2.0 to 4.3.0 in /spigot
2023-03-16 17:07:19 +01:00
dependabot[bot] 2aa53c556a Bump adventure-platform-bukkit from 4.2.0 to 4.3.0 in /spigot
Bumps [adventure-platform-bukkit](https://github.com/KyoriPowered/adventure-platform) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/KyoriPowered/adventure-platform/releases)
- [Commits](https://github.com/KyoriPowered/adventure-platform/compare/v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-platform-bukkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-16 16:05:18 +00:00
Andre_601 7eb67c1571 Merge pull request #58 from Andre601/dependabot/maven/core/net.kyori-adventure-api-4.13.0
Bump adventure-api from 4.12.0 to 4.13.0 in /core
2023-03-15 17:14:39 +01:00
Andre_601 e6ebf0964b Merge pull request #60 from Andre601/dependabot/maven/core/net.kyori-adventure-text-serializer-legacy-4.13.0
Bump adventure-text-serializer-legacy from 4.12.0 to 4.13.0 in /core
2023-03-15 17:05:33 +01:00
Andre_601 2f7bbe8bae Merge pull request #59 from Andre601/dependabot/maven/core/net.kyori-adventure-text-minimessage-4.13.0
Bump adventure-text-minimessage from 4.12.0 to 4.13.0 in /core
2023-03-15 17:05:15 +01:00
dependabot[bot] cc3e75f41b Bump adventure-text-serializer-legacy from 4.12.0 to 4.13.0 in /core
Bumps [adventure-text-serializer-legacy](https://github.com/KyoriPowered/adventure) from 4.12.0 to 4.13.0.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.12.0...v4.13.0)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-text-serializer-legacy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-15 16:03:13 +00:00
dependabot[bot] 7706dd245f Bump adventure-text-minimessage from 4.12.0 to 4.13.0 in /core
Bumps [adventure-text-minimessage](https://github.com/KyoriPowered/adventure) from 4.12.0 to 4.13.0.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.12.0...v4.13.0)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-text-minimessage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-15 16:03:06 +00:00
dependabot[bot] d4018ff666 Bump adventure-api from 4.12.0 to 4.13.0 in /core
Bumps [adventure-api](https://github.com/KyoriPowered/adventure) from 4.12.0 to 4.13.0.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.12.0...v4.13.0)

---
updated-dependencies:
- dependency-name: net.kyori:adventure-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-15 16:03:01 +00:00
Andre_601 4c7a2ca94d Update wiki links to link to latest 2023-03-13 01:35:17 +01:00
Andre_601 21632711ea Merge pull request #57 from Andre601/dependabot/maven/core/com.github.ben-manes.caffeine-caffeine-3.1.5
Bump caffeine from 3.1.4 to 3.1.5 in /core
2023-03-06 17:15:29 +01:00
dependabot[bot] e82ed84c11 Bump caffeine from 3.1.4 to 3.1.5 in /core
Bumps [caffeine](https://github.com/ben-manes/caffeine) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/ben-manes/caffeine/releases)
- [Commits](https://github.com/ben-manes/caffeine/compare/v3.1.4...v3.1.5)

---
updated-dependencies:
- dependency-name: com.github.ben-manes.caffeine:caffeine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 16:12:19 +00:00
Andre601 1f44b34dd2 Update workflow titles 2023-03-03 21:05:36 +01:00
Andre601 b7b6d8b82b Make dev a default for mkdocs-material 2023-03-03 20:56:50 +01:00
Andre601 53e270b183 Try dev build of Mike from GitHub 2023-03-03 17:28:49 +01:00
Andre601 f633bb393e Revert "Make fetch-depht 1"
This reverts commit 42907c7f74.
2023-03-03 17:27:49 +01:00
Andre601 41ac71e346 Revert "Make fetch-depth 1"
This reverts commit e04b9b4a09.
2023-03-03 17:27:35 +01:00
Andre_601 e04b9b4a09 Make fetch-depth 1 2023-03-02 01:19:56 +01:00
Andre_601 42907c7f74 Make fetch-depht 1 2023-03-02 01:19:33 +01:00
Andre_601 69bf90c20f Make dev the default branch 2023-03-01 13:58:27 +01:00
Andre601 b2f70b605c Update CSS stuff 2023-03-01 03:35:52 +01:00
Andre601 fb5e4b57bc Create versioned docs 2023-03-01 02:33:29 +01:00
Andre601 49c17d941a Fix wrong workflow file names 2023-03-01 00:05:42 +01:00
Andre601 ec6b852497 typo 2023-03-01 00:03:03 +01:00
Andre_601 9bd2c4b8d5 Merge pull request #54 from Andre601/feature/versioned-docs
Set up versioned docs
2023-02-28 23:01:11 +01:00
Andre_601 57bb677578 Merge pull request #56 from Andre601/dependabot/maven/velocity/org.apache.maven.plugins-maven-compiler-plugin-3.11.0
Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /velocity
2023-02-28 17:07:00 +01:00
Andre_601 40c4726fd6 Merge pull request #55 from Andre601/dependabot/maven/paper/org.apache.maven.plugins-maven-compiler-plugin-3.11.0
Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /paper
2023-02-28 17:06:48 +01:00
dependabot[bot] c1eefbe114 Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /velocity
Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.1 to 3.11.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.1...maven-compiler-plugin-3.11.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-28 16:04:25 +00:00
dependabot[bot] 082345fb66 Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /paper
Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.1 to 3.11.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.1...maven-compiler-plugin-3.11.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-28 16:04:19 +00:00
Andre601 1bedc472b3 Extend the theme 2023-02-28 03:06:18 +01:00
Andre601 aa9d6ff7d2 Set up versioned docs 2023-02-28 02:35:47 +01:00
Andre601 5e4fc3d69c Smaller typo fix in api docs 2023-02-28 02:13:10 +01:00
Andre_601 b429e75797 Merge pull request #53 from Andre601/dependabot/maven/bungeecord/org.apache.maven.plugins-maven-compiler-plugin-3.11.0
Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /bungeecord
2023-02-27 17:13:39 +01:00
Andre_601 c2eacf716f Merge pull request #52 from Andre601/dependabot/maven/core/org.apache.maven.plugins-maven-compiler-plugin-3.11.0
Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /core
2023-02-27 17:13:28 +01:00
dependabot[bot] aca52b528d Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /bungeecord
Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.1 to 3.11.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.1...maven-compiler-plugin-3.11.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 16:13:20 +00:00
dependabot[bot] cd1469c554 Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /core
Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.1 to 3.11.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.1...maven-compiler-plugin-3.11.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 16:12:46 +00:00
Andre601 ce4347ca1e Improve CommandHandler 2023-02-23 01:51:04 +01:00
Andre601 acc59e0af7 Prepare docs for next ASL API. 2023-02-23 00:49:14 +01:00
Andre601 099abcda67 Make sure paper-plugin loads after PlaceholderAPI 2023-02-23 00:37:07 +01:00
Andre601 2ced4db199 Small formatting for actions 2023-02-22 22:27:18 +01:00
Andre601 4f7c16ae5a Use PaperMC Maven repo 2023-02-20 23:30:19 +01:00
Andre_601 06739bb68e Merge pull request #51 from Andre601/dependabot/maven/core/com.github.ben-manes.caffeine-caffeine-3.1.4
Bump caffeine from 3.1.3 to 3.1.4 in /core
2023-02-20 17:13:37 +01:00
dependabot[bot] d1c9ab5b82 Bump caffeine from 3.1.3 to 3.1.4 in /core
Bumps [caffeine](https://github.com/ben-manes/caffeine) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/ben-manes/caffeine/releases)
- [Commits](https://github.com/ben-manes/caffeine/compare/v3.1.3...v3.1.4)

---
updated-dependencies:
- dependency-name: com.github.ben-manes.caffeine:caffeine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-20 16:10:36 +00:00
Andre601 d06f767e51 Rename to BukkitPlayerPlaceholders for clarity 2023-02-20 14:10:58 +01:00
Andre601 02e0821bd0 Merge CmdAdvancedServerList instances into one 2023-02-20 14:07:25 +01:00
Andre601 981d4e8146 First steps towards paper-plugin support 2023-02-20 01:53:02 +01:00
Andre_601 05667c0f87 Update MODRINTH.md 2023-02-13 22:44:54 +01:00
Andre_601 54f0f59925 Updated badges to v3 2023-02-13 22:41:49 +01:00
Andre_601 de2c8a7547 Merge pull request #49 from Andre601/dependabot/maven/velocity/org.bstats-bstats-velocity-3.0.1
Bump bstats-velocity from 3.0.0 to 3.0.1 in /velocity
2023-02-13 17:14:04 +01:00
Andre_601 50c31a3348 Merge pull request #48 from Andre601/dependabot/maven/paper/org.bstats-bstats-bukkit-3.0.1
Bump bstats-bukkit from 3.0.0 to 3.0.1 in /paper
2023-02-13 17:13:54 +01:00
Andre_601 93e94aa9d3 Merge pull request #47 from Andre601/dependabot/maven/spigot/org.bstats-bstats-bukkit-3.0.1
Bump bstats-bukkit from 3.0.0 to 3.0.1 in /spigot
2023-02-13 17:13:42 +01:00
dependabot[bot] 1f71aeb7e5 Bump bstats-velocity from 3.0.0 to 3.0.1 in /velocity
Bumps [bstats-velocity](https://github.com/Bastian/bStats-Metrics) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/Bastian/bStats-Metrics/releases)
- [Commits](https://github.com/Bastian/bStats-Metrics/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: org.bstats:bstats-velocity
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 16:13:04 +00:00
dependabot[bot] 5d01adfa49 Bump bstats-bukkit from 3.0.0 to 3.0.1 in /paper
Bumps [bstats-bukkit](https://github.com/Bastian/bStats-Metrics) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/Bastian/bStats-Metrics/releases)
- [Commits](https://github.com/Bastian/bStats-Metrics/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: org.bstats:bstats-bukkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 16:13:02 +00:00
dependabot[bot] da7e3eca09 Bump bstats-bukkit from 3.0.0 to 3.0.1 in /spigot
Bumps [bstats-bukkit](https://github.com/Bastian/bStats-Metrics) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/Bastian/bStats-Metrics/releases)
- [Commits](https://github.com/Bastian/bStats-Metrics/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: org.bstats:bstats-bukkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 16:12:48 +00:00
Andre_601 66b305bbea Merge pull request #46 from Andre601/dependabot/maven/core/com.github.ben-manes.caffeine-caffeine-3.1.3
Bump caffeine from 3.1.2 to 3.1.3 in /core
2023-02-10 17:16:03 +01:00
dependabot[bot] 3c1abf4f3a Bump caffeine from 3.1.2 to 3.1.3 in /core
Bumps [caffeine](https://github.com/ben-manes/caffeine) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/ben-manes/caffeine/releases)
- [Commits](https://github.com/ben-manes/caffeine/compare/v3.1.2...v3.1.3)

---
updated-dependencies:
- dependency-name: com.github.ben-manes.caffeine:caffeine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-10 16:07:29 +00:00
Andre_601 856be1e32e Update index.md 2023-02-03 22:33:28 +01:00
Andre601 5303bb00a0 More docs corrections 2023-02-01 15:55:19 +01:00
228 changed files with 10443 additions and 2193 deletions

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ body:
Please make sure you've checked the following things first:
- You're using the latest release of AdvancedServerList [[Download from Modrinth](https://modrinth.com/plugin/advancedserverlist)] and the right API version.
- You're using a supported Proxy/Server version. As of right now is only 1.19.x supported.
- You're using a supported Proxy/Server version. As of right now is only 1.19+ supported.
- The Feature you suggest hasn't been suggested before.
- type: dropdown
attributes:
+1 -1
View File
@@ -9,7 +9,7 @@ body:
Please make sure you've checked the following things first:
- You're using the latest release of AdvancedServerList [[Download from Modrinth](https://modrinth.com/plugin/advancedserverlist)]
- You're using a supported Proxy/Server version. As of right now is only 1.19.x supported.
- You're using a supported Proxy/Server version. As of right now is only 1.19+ supported.
- The issue happens with just AdvancedServerList installed.
- type: dropdown
attributes:
+1 -1
View File
@@ -5,4 +5,4 @@ contact_links:
url: https://discord.gg/6dazXp6
- name: Wiki
about: Check the Wiki for explanations about the features and examples.
url: https://github.com/Andre601/AdvancedServerList/wiki
url: https://docs.andre601.ch/AdvancedServerList
+1 -1
View File
@@ -9,7 +9,7 @@ body:
Please make sure you've checked the following things first:
- You're using the latest release of AdvancedServerList [[Download from Modrinth](https://modrinth.com/plugin/advancedserverlist)]
- You're using a supported Proxy/Server version. As of right now is only 1.19.x supported.
- You're using a supported Proxy/Server version. As of right now is only 1.19+ supported.
- The Feature you suggest hasn't been suggested before.
- type: dropdown
attributes:
+30 -14
View File
@@ -4,19 +4,19 @@ AdvancedServerList is a plugin that allowys you to customize your server's MOTD,
## Supported Platforms
<a href="https://www.spigotmc.org" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/supported/spigot_vector.svg" width="64" alt="platform-spigot" title="Tested on Spigot">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/spigot_vector.svg&w=64 alt="platform-spigot" title="Tested on Spigot">
</a>
<a href="https://papermc.io" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/supported/paper_vector.svg" width="64" alt="platform-paper" title="Tested on Paper">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/paper_vector.svg&w=64 alt="platform-paper" title="Tested on Paper">
</a>
<a href="https://www.spigotmc.org" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/supported/bungeecord_vector.svg" width="64" alt="platform-bungeecord" title="Tested on BungeeCord">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/bungeecord_vector.svg&w=64 alt="platform-bungeecord" title="Tested on BungeeCord">
</a>
<a href="https://www.papermc.io" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/supported/waterfall_vector.svg" width="64" alt="platform-waterfall" title="Tested on Waterfall">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/waterfall_vector.svg&w=64 alt="platform-waterfall" title="Tested on Waterfall">
</a>
<a href="https://velocitypowered.com" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/supported/velocity_vector.svg" width="64" alt="platform-velocity" title="Tested on Velocity">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/velocity_vector.svg&w=64 alt="platform-velocity" title="Tested on Velocity">
</a>
## What is a Server List Profile?
@@ -24,12 +24,14 @@ A Server List Profile refers to a YAML file located in the plugin's `profiles` d
It allows you to configure specific aspects of the server display in the MC-Client's multiplayer server list, such as the MOTD, player count text, player count hover or Favicon.
> [*Read More*][profiles]
### Conditions
Thanks to conditions can you determine when a profile should be displayed in the player’s server list, to allow displaying specific text (i.e. a warning when they are using an outdated version).
When multiple profiles exist that have valid conditions will the one with the highest priority (Higher number = higher priority) be selected. Having no conditions makes the profile automatically return true.
> [*Read More*][conditions]
### Placeholders
Placeholders can be used within conditions to further customize them. They can also be used in any other text option (motd, playerCount and players) to display their respective values.
The format is `${<target> <identifier>}` which was adopted from BungeeTabListPlus. Depending on what platform you use the plugin on are only specific placeholders available.
@@ -37,17 +39,20 @@ The format is `${<target> <identifier>}` which was adopted from BungeeTabListPlu
When using the SpigotMC/PaperMC version can you also use placeholders from [PlaceholderAPI][placeholderapi] using its `%<identifier>_<values>%` placeholder format. PlaceholderAPI needs to be installed for that.
> [*Read More*][placeholders]
### Formatting
The plugin uses the MiniMessage format for a consistent, easy way of formatting your text.
Only certain options are usable for each option. As an example does motd support HEX colours and gradients, while the other options only support default colour codes.
> [*Read More*][minimessage]
## Dependencies
| Dependency | Platforms | Required? |
| ---------------- | ------------- | --------- |
|------------------|---------------|-----------|
| [ProtocolLib] | Spigot | Yes |
| [PlaceholderAPI] | Spigot, Paper | No |
| [ViaVersion] | Spigot, Paper | No |
## Statistics
@@ -58,31 +63,42 @@ You can disable this in the global bStats config file located in `/plugins/bstat
- [Paper/Spigot][bstats-spigot]
- [Velocity][bstats-velocity]
## Videos
Do you have your own video to share? Contact me and I will add it to this section.
<details><summary>Click to Show/Hide Videos</summary>
Spanish Video by Ajneb97
<iframe width="560" height="auto" src="https://www.youtube.com/embed/rIbljm_4HVI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</details>
## Screenshots
<a href="https://modrinth.com/plugin/advancedserverlist/gallery" target="_blank">
<img src="https://raw.githubusercontent.com/intergrav/devins-badges/v2/assets/cozy/documentation/modrinth-gallery_vector.svg" width="208" alt="gallery" title="Check out the Gallery">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/documentation/modrinth-gallery_vector.svg&w=208" alt="gallery" title="Check out the Gallery">
</a>
## Support
<a href="https://discord.gg/6dazXp6" target="_blank">
<img src="https://raw.githubusercontent.com/intergrav/devins-badges/v2/assets/minimal/social/discord-singular_vector.svg" width="64" alt="discord" title="Join my Discord Server">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/social/discord-singular_vector.svg&w=64" alt="discord" title="Join my Discord Server">
</a>
<a href="https://app.revolt.chat/invite/74TpERXA" target="_blank">
<img src="https://raw.githubusercontent.com/intergrav/devins-badges/v2/assets/minimal/social/revolt-singular_vector.svg" width="64" alt="revolt" title="Join my Revolt Server">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/social/revolt-singular_vector.svg&w=64" alt="revolt" title="Join my Revolt Server">
</a>
<a href="https://blobfox.coffee/@andre_601" target="_blank">
<img src="https://raw.githubusercontent.com/intergrav/devins-badges/v2/assets/minimal/social/mastodon-singular_vector.svg" width="64" alt="revolt" title="Chat with me on Mastodon">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/social/mastodon-singular_vector.svg&w=64" alt="revolt" title="Chat with me on Mastodon">
</a>
<!-- Links -->
[profiles]: https://andre601.ch/AdvancedServerList/profiles
[conditions]: https://andre601.ch/AdvancedServerList/profiles/#conditions
[placeholders]: https://andre601.ch/AdvancedServerList/profiles/placeholders
[minimessage]: https://andre601.ch/AdvancedServerList/profiles/formatting
[profiles]: https://docs.andre601.ch/AdvancedServerList/latest/profiles
[conditions]: https://docs.andre601.ch/AdvancedServerList/latest/profiles/#conditions
[placeholders]: https://docs.andre601.ch/AdvancedServerList/latest/profiles/placeholders
[minimessage]: https://docs.andre601.ch/AdvancedServerList/latest/profiles/formatting
[protocollib]: https://www.spigotmc.org/resources/1997/
[placeholderapi]: https://www.spigotmc.org/resources/6245/
[viaversion]: https://www.spigotmc.org/resources/19254/
[bstats]: https://bstats.org
[bstats-bungee]: https://bstats.org/plugin/bungeecord/AdvancedServerList/15585
+7
View File
@@ -0,0 +1,7 @@
<!-- pr-build comment -->
![badge]
Building jar file from Pull request. Please wait...
[badge]: https://img.shields.io/badge/Building...-0d1117?style=for-the-badge&labelColor=7a8490&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNNC43NSAyaDE0LjVhLjc1Ljc1IDAgMCAxIDAgMS41aC0uNzV2Mi45ODJhNC43NSA0Ljc1IDAgMCAxLTIuMjE1IDQuMDE3bC0yLjA0NCAxLjI5YS4yNS4yNSAwIDAgMCAwIC40MjJsMi4wNDQgMS4yOWE0Ljc1IDQuNzUgMCAwIDEgMi4yMTUgNC4wMTdWMjAuNWguNzVhLjc1Ljc1IDAgMCAxIDAgMS41SDQuNzVhLjc1Ljc1IDAgMCAxIDAtMS41aC43NXYtMi45ODJhNC43NSA0Ljc1IDAgMCAxIDIuMjE1LTQuMDE3bDIuMDQ0LTEuMjlhLjI1LjI1IDAgMCAwIDAtLjQyMmwtMi4wNDQtMS4yOUE0Ljc1IDQuNzUgMCAwIDEgNS41IDYuNDgyVjMuNWgtLjc1YS43NS43NSAwIDAgMSAwLTEuNVpNMTcgMy41SDd2Mi45ODJBMy4yNSAzLjI1IDAgMCAwIDguNTE2IDkuMjNsMi4wNDQgMS4yOWExLjc1IDEuNzUgMCAwIDEgMCAyLjk2bC0yLjA0NCAxLjI5QTMuMjUgMy4yNSAwIDAgMCA3IDE3LjUxOFYyMC41aDEwdi0yLjk4MmEzLjI1IDMuMjUgMCAwIDAtMS41MTYtMi43NDhsLTIuMDQ0LTEuMjlhMS43NSAxLjc1IDAgMCAxIDAtMi45NmwyLjA0NC0xLjI5QTMuMjUgMy4yNSAwIDAgMCAxNyA2LjQ4MloiPjwvcGF0aD48L3N2Zz4=
+12
View File
@@ -0,0 +1,12 @@
<!-- pr-build comment -->
![badge]
**Compiling of jar files failed!**
Please check the logs below for any errors.
| Name | Link |
| ------ | -------------------------------- |
| Commit | {{ .commit }} |
| Logs | {{ .logs | mdlink "View Logs" }} |
[badge]: https://img.shields.io/badge/Build_Failure!-0d1117?style=for-the-badge&labelColor=f85149&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNNS43MiA1LjcyYS43NS43NSAwIDAgMSAxLjA2IDBMMTIgMTAuOTRsNS4yMi01LjIyYS43NDkuNzQ5IDAgMCAxIDEuMjc1LjMyNi43NDkuNzQ5IDAgMCAxLS4yMTUuNzM0TDEzLjA2IDEybDUuMjIgNS4yMmEuNzQ5Ljc0OSAwIDAgMS0uMzI2IDEuMjc1Ljc0OS43NDkgMCAwIDEtLjczNC0uMjE1TDEyIDEzLjA2bC01LjIyIDUuMjJhLjc1MS43NTEgMCAwIDEtMS4wNDItLjAxOC43NTEuNzUxIDAgMCAxLS4wMTgtMS4wNDJMMTAuOTQgMTIgNS43MiA2Ljc4YS43NS43NSAwIDAgMSAwLTEuMDZaIj48L3BhdGg+PC9zdmc+
+15
View File
@@ -0,0 +1,15 @@
<!-- pr-build comment -->
![badge]
The compiling of the jar files was successful!
You can find a direct download for the artifact below.
File expires: `{{ .expire | date "02 Jan 2006 15:04 MST" }}`
| Name | Link |
| -------- | -------------------------------------------- |
| Commit | {{ .commit }} |
| Logs | {{ .logs | mdlink "View Logs" }} |
| Download | {{ .download | mdlink "Download Artifact" }} |
[badge]: https://img.shields.io/badge/Build_Success!-0d1117?style=for-the-badge&labelColor=3fb950&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNMjEuMDMgNS43MmEuNzUuNzUgMCAwIDEgMCAxLjA2bC0xMS41IDExLjVhLjc0Ny43NDcgMCAwIDEtMS4wNzItLjAxMmwtNS41LTUuNzVhLjc1Ljc1IDAgMSAxIDEuMDg0LTEuMDM2bDQuOTcgNS4xOTVMMTkuOTcgNS43MmEuNzUuNzUgMCAwIDEgMS4wNiAwWiI+PC9wYXRoPjwvc3ZnPg==
-50
View File
@@ -1,50 +0,0 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/bungeecord"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- 'Type: Update Dependency'
- 'Target: BungeeCord'
- package-ecosystem: maven
directory: "/core"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- 'Type: Update Dependency'
- 'Target: Core'
- package-ecosystem: maven
directory: "/paper"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- 'Type: Update Dependency'
- 'Target: PaperMC'
- package-ecosystem: maven
directory: "/spigot"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- 'Type: Update Dependency'
- 'Target: Spigot'
- package-ecosystem: maven
directory: "/velocity"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- 'Type: Update Dependency'
- 'Target: Velocity'
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- 'Type: Update Dependency'
- 'Target: GitHub Action'
+14
View File
@@ -0,0 +1,14 @@
"Target: All":
- all: ["bukkit/**", "bungeecord/**", "core/**", "velocity/**"]
"Target: Bukkit":
- all: ["bukkit/**", "!bungeecord/**", "!core/**", "!velocity/**"]
"Target: BungeeCord":
- all: ["!bukkit/**", "bungeecord/**", "!core/**", "!velocity/**"]
"Target: Core":
- all: ["!bukkit/**", "!bungeecord/**", "core/**", "!velocity/**"]
"Target: Velocity":
- all: ["!bukkit/**", "!bungeecord/**", "!core/**", "velocity/**"]
+36 -17
View File
@@ -1,30 +1,49 @@
name: Deploy Site
name: 'Deploy Site (Push)'
on:
push:
paths:
- 'docs/**'
- 'mkdocs.yml'
branches:
- master
tags-ignore:
- '**'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
env:
GITHUB_REPO_INSTANCE: true
jobs:
build:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.x
- name: Create/Get Cache
uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements.txt
- name: Deploy Files
run: |
git config user.name "github-actions[bot]"
git config user.email "actions@github.com"
mkdocs gh-deploy --force
- name: Build docs
run: mkdocs build
- name: Configure GitHub Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'site/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
-105
View File
@@ -1,105 +0,0 @@
#
# Big thank you to @Kir-Antipov for providing this workflow file.
# Check out his mc-publish action here: https://github.com/Kir-Antipov/mc-publish
#
name: Publish Assets
on:
release:
types:
- published
jobs:
buildJars:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.16
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '16'
cache: 'maven'
- name: Build Jar files
run: mvn clean install
- name: Save BungeeCord Jar file
uses: actions/upload-artifact@v3
with:
name: asl-bungeecord
path: bungeecord/target/AdvancedServerList-*.jar
if-no-files-found: error
retention-days: 1
- name: Save Paper Jar file
uses: actions/upload-artifact@v3
with:
name: asl-paper
path: paper/target/AdvancedServerList-*.jar
if-no-files-found: error
retention-days: 1
- name: Save Spigot Jar file
uses: actions/upload-artifact@v3
with:
name: asl-spigot
path: spigot/target/AdvancedServerList-*.jar
if-no-files-found: error
retention-days: 1
- name: Save Velocity Jar file
uses: actions/upload-artifact@v3
with:
name: asl-velocity
path: velocity/target/AdvancedServerList-*.jar
if-no-files-found: error
retention-days: 1
publish:
needs: [buildJars]
strategy:
matrix:
include:
- platforms: BungeeCord, Waterfall
directory: bungeecord
loaders: |
bungeecord
waterfall
- platforms: Paper
directory: paper
loaders: paper
- platforms: Spigot
directory: spigot
loaders: spigot
- platforms: Velocity
directory: velocity
loaders: velocity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Jar files
uses: actions/download-artifact@v3
with:
name: asl-${{ matrix.directory }}
path: ${{ matrix.directory }}/target
- name: Get Version
id: github-release
run: |
version=$(echo ${{ github.event.release.tag_name }} | cut -d'v' -f2)
echo "PLUGIN_RELEASE=$version" >> $GITHUB_OUTPUT
- name: Upload AdvancedServerList (${{ matrix.loaders }}) to GitHub and Modrinth
uses: Kir-Antipov/mc-publish@v3.2
with:
name: ${{ github.event.release.tag_name }} (${{ matrix.platforms }})
version: ${{ steps.github-release.outputs.PLUGIN_RELEASE }}
version-type: release
files: ${{ matrix.directory}}/target/AdvancedServerList-*.jar
files-secondary: ""
loaders: ${{ matrix.loaders }}
version-resolver: releases
game-versions: |
1.19
1.19.1
1.19.2
1.19.3
java: 16
modrinth-id: xss83sOY
modrinth-featured: false
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
+1
View File
@@ -2,3 +2,4 @@
/.idea/
/**/dependency-reduced-pom.xml
/**/target/
/**/__pycache__/
+33
View File
@@ -0,0 +1,33 @@
when:
- event: tag
branch: master
steps:
createFiles:
image: maven:3.9.6-eclipse-temurin-17
secrets:
- source: cb_token
target: codeberg_api_token
- source: modrinth_api_token
target: modrinth_api_token
- source: hangar_api_token
target: hangar_api_token
commands:
# Create the jar files.
- mvn clean install
# Move VersionUploader jar file
- cd version-uploader/target/
- mv VersionUploader.jar ../../
- cd ../../
# Execute Jar file
- java -jar VersionUploader.jar --modrinth
uploadToCodeberg:
image: woodpeckerci/plugin-gitea-release
settings:
base_url: https://codeberg.org
files:
- "bungeecord/target/AdvancedServerList-*.jar"
- "paper/target/AdvancedServerList-*.jar"
- "velocity/target/AdvancedServerList-*.jar"
api_key:
from_secret: CB_TOKEN
+36
View File
@@ -0,0 +1,36 @@
when:
- branch: master
event: push
path:
include: ['requirements.txt', 'mkdocs.yml', 'docs/**']
variables:
setup_git: &setup_git
- apk add git
- git config --global user.email "github@andre601.ch"
- git config --global user.name "ASL Docs Builder"
steps:
cloneTargetRepo:
image: alpine:3.18.4
commands:
- chmod -R a+w .
- <<: *setup_git
- git clone -b pages https://codeberg.org/Andre601/AdvancedServerList.git site
- chmod -R a+w site
buildDocs:
image: woodpeckerci/plugin-mkdocs:latest
settings:
pip_install_file: requirements.txt
commitAndPush:
image: alpine:3.18.4
secrets:
- cb_token
commands:
- <<: *setup_git
- mv domains site/.domains
- cd site
- git remote set-url origin https://$CB_TOKEN@codeberg.org/Andre601/AdvancedServerList.git
- git add --all
- git commit -m "Update AdvancedServerList Docs ($( env TZ=Europe/Zurich date +"%d.%m.%Y %Z" )) [SKIP CI]"
- git push
+39 -26
View File
@@ -1,26 +1,32 @@
# AdvancedServerList
<a href="https://modrinth.com/plugin/advancedserverlist" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/cozy/available/modrinth_vector.svg" height="64" align="right" alt="modrinth" title="Available on Modrinth">
</a>
AdvancedServerList is a plugin that allowys you to customize your server's MOTD, favicon, Player count text and player count hover displayed in a player's multiplayer server list based on conditions and priorities.
## Downloads
<a href="https://modrinth.com/plugin/advancedserverlist" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact/available/modrinth_vector.svg" height="46" alt="modrinth" title="Available on Modrinth">
</a>
<br>
<!--
<a href="https://hangar.papermc.io/Andre_601/AdvancedServerList" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact/available/hangar_vector.svg" height="46" alt="hangar" title="Available on Hangar">
</a>
-->
## Supported Platforms
<a href="https://www.spigotmc.org" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/supported/spigot_vector.svg" height="64" alt="platform-spigot" title="Tested on Spigot">
</a>
<a href="https://papermc.io" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/supported/paper_vector.svg" height="64" alt="platform-paper" title="Tested on Paper">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/paper_vector.svg" height="64" alt="platform-paper" title="Tested on Paper">
</a>
<a href="https://www.spigotmc.org" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/supported/bungeecord_vector.svg" height="64" alt="platform-bungeecord" title="Tested on BungeeCord">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/bungeecord_vector.svg" height="64" alt="platform-bungeecord" title="Tested on BungeeCord">
</a>
<a href="https://www.papermc.io" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/supported/waterfall_vector.svg" height="64" alt="platform-waterfall" title="Tested on Waterfall">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/waterfall_vector.svg" height="64" alt="platform-waterfall" title="Tested on Waterfall">
</a>
<a href="https://velocitypowered.com" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/supported/velocity_vector.svg" height="64" alt="platform-velocity" title="Tested on Velocity">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/velocity_vector.svg" height="64" alt="platform-velocity" title="Tested on Velocity">
</a>
## What is a Server List Profile?
@@ -37,10 +43,10 @@ When multiple profiles exist that have valid conditions will the one with the hi
> [*Read More*][conditions]
### Placeholders
Placeholders can be used within conditions to further customize them. They can also be used in any other text option (motd, playerCount and players) to display their respective values.
Placeholders can be used within conditions to further customize them. They can also be used in any other text option to display their respective values.
The format is `${<target> <identifier>}` which was adopted from BungeeTabListPlus. Depending on what platform you use the plugin on are only specific placeholders available.
When using the SpigotMC/PaperMC version can you also use placeholders from [PlaceholderAPI][placeholderapi] using its `%<identifier>_<values>%` placeholder format. PlaceholderAPI needs to be installed for that.
When using the SpigotMC/PaperMC version, or while PAPIProxyBridge is installed on your proxy, can you also use placeholders from [PlaceholderAPI][placeholderapi] using its `%<identifier>_<values>%` placeholder format. PlaceholderAPI needs to be installed for that.
If you're a plugin dev can you even add your own custom placeholders through AdvancedServerList's own API.
@@ -54,10 +60,14 @@ Only certain options are usable for each option. As an example does motd support
## Dependencies
| Dependency | Platforms | Required? |
| ---------------- | ------------- | --------- |
| [ProtocolLib] | Spigot | Yes |
| [PlaceholderAPI] | Spigot, Paper | No |
All listed dependencies are optional.
| Dependency | Platforms |
|-------------------|----------------------|
| [PlaceholderAPI] | Paper |
| [ViaVersion] | Paper |
| [PAPIProxyBridge] | BungeeCord, Velocity |
| [Maintenance] | All |
## Statistics
@@ -71,30 +81,33 @@ You can disable this in the global bStats config file located in `/plugins/bstat
## Screenshots
<a href="https://modrinth.com/plugin/advancedserverlist/gallery" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/cozy/documentation/modrinth-gallery_vector.svg" height="64" alt="gallery" title="Check out the Gallery">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/documentation/modrinth-gallery_vector.svg" height="64" alt="gallery" title="Check out the Gallery">
</a>
## Support
<a href="https://discord.gg/6dazXp6" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/social/discord-singular_vector.svg" height="64" alt="discord" title="Join my Discord Server">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/social/discord-singular_vector.svg" height="64" alt="discord" title="Join my Discord Server">
</a>
<a href="https://app.revolt.chat/invite/74TpERXA" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/social/revolt-singular_vector.svg" height="64" alt="revolt" title="Join my Revolt Server">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/social/revolt-singular_vector.svg" height="64" alt="revolt" title="Join my Revolt Server">
</a>
<a href="https://blobfox.coffee/@andre_601" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@2/assets/minimal/social/mastodon-singular_vector.svg" height="64" alt="mastodon" title="Chat with me on Mastodon">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/social/mastodon-singular_vector.svg" height="64" alt="mastodon" title="Chat with me on Mastodon">
</a>
<!-- Links -->
[profiles]: https://www.andre601.ch/AdvancedServerList/profiles/
[conditions]: https://www.andre601.ch/AdvancedServerList/profiles/#conditions
[placeholders]: https://www.andre601.ch/AdvancedServerList/profiles/placeholders/
[minimessage]: https://www.andre601.ch/AdvancedServerList/profiles/formatting/
[profiles]: https://asl.andre601.ch/profiles/
[conditions]: https://asl.andre601.ch/profiles/#condition
[placeholders]: https://asl.andre601.ch/profiles/placeholders/
[minimessage]: https://asl.andre601.ch/profiles/formatting/
[modrinth]: https://modrinth.com/plugin/advancedserverlist
[protocollib]: https://www.spigotmc.org/resources/1997/
[placeholderapi]: https://www.spigotmc.org/resources/6245/
[placeholderapi]: https://hangar.papermc.io/HelpChat/PlaceholderAPI
[viaversion]: https://hangar.papermc.io/ViaVersion/ViaVersion
[papiproxybridge]: https://hangar.papermc.io/William278/PAPIProxyBridge
[maintenance]: https://hangar.papermc.io/kennytv/Maintenance
[bstats]: https://bstats.org
[bstats-bungee]: https://bstats.org/plugin/bungeecord/AdvancedServerList/15585
+24 -14
View File
@@ -67,27 +67,45 @@
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.2</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.2</version>
<type>javadoc</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.15.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.15.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bungeecord</artifactId>
<version>4.1.2</version>
<version>4.3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bungeecord</artifactId>
<version>3.0.0</version>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>configurate-yaml</artifactId>
<version>4.1.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
@@ -104,12 +122,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.12.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.1</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
@@ -125,14 +143,6 @@
<pattern>org.bstats</pattern>
<shadedPattern>ch.andre601.advancedserverlist.bungeecord.depends.bstats</shadedPattern>
</relocation>
<relocation>
<pattern>com.github.benmanes.caffeine</pattern>
<shadedPattern>ch.andre601.advancedserverlist.bungeecord.depends.caffeine</shadedPattern>
</relocation>
<relocation>
<pattern>okhttp3</pattern>
<shadedPattern>ch.andre601.advancedserverlist.bungeecord.depends.okhttp3</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
@@ -26,10 +26,11 @@
package ch.andre601.advancedserverlist.bungeecord;
import ch.andre601.advancedserverlist.bungeecord.commands.CmdAdvancedServerList;
import ch.andre601.advancedserverlist.bungeecord.events.JoinEvent;
import ch.andre601.advancedserverlist.bungeecord.events.PingEvent;
import ch.andre601.advancedserverlist.bungeecord.listeners.JoinEvent;
import ch.andre601.advancedserverlist.bungeecord.listeners.PingEvent;
import ch.andre601.advancedserverlist.bungeecord.logging.BungeeLogger;
import ch.andre601.advancedserverlist.bungeecord.objects.BungeePlayerPlaceholders;
import ch.andre601.advancedserverlist.bungeecord.objects.BungeeServerPlaceholders;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
@@ -43,13 +44,13 @@ import java.nio.file.Path;
public class BungeeCordCore extends Plugin implements PluginCore<Favicon>{
private AdvancedServerList core;
private AdvancedServerList<Favicon> core;
private FaviconHandler<Favicon> faviconHandler = null;
private final PluginLogger logger = new BungeeLogger(getLogger());
private final PluginLogger logger = new BungeeLogger(this);
@Override
public void onEnable(){
this.core = new AdvancedServerList(this, new BungeePlayerPlaceholders());
this.core = AdvancedServerList.init(this, BungeePlayerPlaceholders.init(), BungeeServerPlaceholders.init());
}
@Override
@@ -85,7 +86,7 @@ public class BungeeCordCore extends Plugin implements PluginCore<Favicon>{
}
@Override
public AdvancedServerList getCore(){
public AdvancedServerList<Favicon> getCore(){
return core;
}
@@ -25,7 +25,7 @@
package ch.andre601.advancedserverlist.bungeecord.commands;
import ch.andre601.advancedserverlist.core.interfaces.CmdSender;
import ch.andre601.advancedserverlist.core.interfaces.commands.CmdSender;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
import net.md_5.bungee.api.CommandSender;
@@ -23,13 +23,15 @@
*
*/
package ch.andre601.advancedserverlist.bungeecord.events;
package ch.andre601.advancedserverlist.bungeecord.listeners;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore;
import ch.andre601.advancedserverlist.bungeecord.objects.BungeePlayerImpl;
import ch.andre601.advancedserverlist.api.events.GenericServerListEvent;
import ch.andre601.advancedserverlist.bungeecord.objects.BungeeProxyImpl;
import ch.andre601.advancedserverlist.core.events.PingEventHandler;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
import ch.andre601.advancedserverlist.core.interfaces.events.GenericEventWrapper;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
@@ -40,11 +42,14 @@ import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer;
import net.md_5.bungee.api.Favicon;
import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.ProxyPingEvent;
import java.awt.image.BufferedImage;
import java.net.InetSocketAddress;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class BungeeEventWrapper implements GenericEventWrapper<Favicon, BungeePlayerImpl>{
@@ -128,6 +133,14 @@ public class BungeeEventWrapper implements GenericEventWrapper<Favicon, BungeePl
return protocol == null;
}
@Override
public boolean isMaintenanceModeActive(){
if(plugin.getProxy().getPluginManager().getPlugin("Maintenance") == null)
return false;
return PingEventHandler.getMaintenanceUtil().isMaintenanceEnabled();
}
@Override
public int getProtocolVersion(){
return this.protocol.getProtocol();
@@ -150,7 +163,25 @@ public class BungeeEventWrapper implements GenericEventWrapper<Favicon, BungeePl
@Override
public String parsePAPIPlaceholders(String text, BungeePlayerImpl player){
return text;
if(plugin.getProxy().getPluginManager().getPlugin("PAPIProxyBridge") == null)
return text;
if(!PingEventHandler.getPAPIUtil().isCompatible())
return text;
String server = PingEventHandler.getPAPIUtil().getServer();
if(server == null || server.isEmpty())
return text;
ServerInfo serverInfo = plugin.getProxy().getServerInfo(server);
if(serverInfo == null || serverInfo.getPlayers().isEmpty())
return text;
ProxiedPlayer carrier = PingEventHandler.getPAPIUtil().getPlayer(serverInfo.getPlayers());
if(carrier == null)
return text;
return PingEventHandler.getPAPIUtil().parse(text, carrier.getUniqueId(), player.getUUID());
}
@Override
@@ -168,6 +199,13 @@ public class BungeeEventWrapper implements GenericEventWrapper<Favicon, BungeePl
return new BungeePlayerImpl(player, protocol);
}
@Override
public GenericServer createGenericServer(int playersOnline, int playersMax, String host){
Map<String, ServerInfo> servers = plugin.getProxy().getServers();
return new BungeeProxyImpl(servers, playersOnline, playersMax, host);
}
@Override
public Favicon createFavicon(BufferedImage image) throws IllegalArgumentException{
return Favicon.create(image);
@@ -23,7 +23,7 @@
*
*/
package ch.andre601.advancedserverlist.bungeecord.events;
package ch.andre601.advancedserverlist.bungeecord.listeners;
import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore;
import net.md_5.bungee.api.connection.ProxiedPlayer;
@@ -23,7 +23,7 @@
*
*/
package ch.andre601.advancedserverlist.bungeecord.events;
package ch.andre601.advancedserverlist.bungeecord.listeners;
import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore;
import ch.andre601.advancedserverlist.core.events.PingEventHandler;
@@ -23,8 +23,9 @@
*
*/
package ch.andre601.advancedserverlist.spigot.events;
package ch.andre601.advancedserverlist.bungeecord.listeners;
import ch.andre601.advancedserverlist.api.bungeecord.events.PreServerListSetEvent;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
public class PreServerListSetEventImpl extends PreServerListSetEvent{
@@ -25,6 +25,7 @@
package ch.andre601.advancedserverlist.bungeecord.logging;
import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import java.util.logging.Level;
@@ -32,10 +33,24 @@ import java.util.logging.Logger;
public class BungeeLogger implements PluginLogger{
private final BungeeCordCore plugin;
private final Logger logger;
public BungeeLogger(Logger logger){
this.logger = logger;
public BungeeLogger(BungeeCordCore plugin){
this.plugin = plugin;
this.logger = plugin.getLogger();
}
@Override
public void debug(Class<?> clazz, String msg, Object... args){
if(plugin.isDebugEnabled())
info("[DEBUG] [" + clazz.getSimpleName() + "] " + msg, args);
}
@Override
public void debugWarn(Class<?> clazz, String msg, Object... args){
if(plugin.isDebugEnabled())
warn("[DEBUG] [" + clazz.getSimpleName() + "] " + msg, args);
}
@Override
@@ -33,10 +33,14 @@ import java.util.Locale;
public class BungeePlayerPlaceholders extends PlaceholderProvider{
public BungeePlayerPlaceholders(){
private BungeePlayerPlaceholders(){
super("player");
}
public static BungeePlayerPlaceholders init(){
return new BungeePlayerPlaceholders();
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server){
return switch(placeholder.toLowerCase(Locale.ROOT)){
@@ -0,0 +1,53 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bungeecord.objects;
import ch.andre601.advancedserverlist.api.bungeecord.objects.BungeeProxy;
import net.md_5.bungee.api.config.ServerInfo;
import java.util.Map;
public record BungeeProxyImpl(Map<String, ServerInfo> servers, int playersOnline, int playersMax, String host) implements BungeeProxy{
@Override
public Map<String, ServerInfo> getServers(){
return servers;
}
@Override
public int getPlayersOnline(){
return playersOnline;
}
@Override
public int getPlayersMax(){
return playersMax;
}
@Override
public String getHost(){
return host;
}
}
@@ -0,0 +1,99 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bungeecord.objects;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.bungeecord.objects.BungeeProxy;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import net.md_5.bungee.api.config.ServerInfo;
import java.net.InetSocketAddress;
public class BungeeServerPlaceholders extends PlaceholderProvider{
private BungeeServerPlaceholders(){
super("server");
}
public static BungeeServerPlaceholders init(){
return new BungeeServerPlaceholders();
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server){
if(!(server instanceof BungeeProxy proxy))
return null;
String[] args = placeholder.split("\\s", 2);
return switch(args[0]){
case "playersOnline" -> {
if(args.length >= 2){
String[] servers = args[1].split(",");
int players = 0;
for(String serverName : servers){
if(serverName.isEmpty())
continue;
ServerInfo info = proxy.getServers().get(serverName.strip());
if(info == null)
continue;
players += info.getPlayers().size();
}
yield String.valueOf(players);
}
yield String.valueOf(proxy.getPlayersOnline());
}
case "playersMax" -> {
// ServerInfo doesn't provide the max players that could join, so we won't allow an extra argument
if(args.length >= 2)
yield null;
yield String.valueOf(proxy.getPlayersMax());
}
case "host" -> {
if(args.length > 2)
yield null;
if(args.length == 2){
ServerInfo info = proxy.getServers().get(args[1]);
if(info == null)
yield null;
yield String.valueOf(((InetSocketAddress)info.getSocketAddress()).getHostString());
}
yield proxy.getHost();
}
default -> null;
};
}
}
+4
View File
@@ -3,4 +3,8 @@ author: 'Andre_601'
version: '${plugin.version}'
description: '${plugin.description}'
softDepends:
- PAPIProxyBridge
- Maintenance
main: 'ch.andre601.advancedserverlist.bungeecord.BungeeCordCore'
+46 -20
View File
@@ -41,6 +41,7 @@
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<plugin.config.version>3</plugin.config.version>
</properties>
<repositories>
@@ -48,6 +49,14 @@
<id>flexver-repo</id>
<url>https://repo.sleeping.town/</url>
</repository>
<repository>
<id>papiproxybridge-repo</id>
<url>https://repo.william278.net/releases/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
@@ -61,49 +70,66 @@
<groupId>org.spongepowered</groupId>
<artifactId>configurate-yaml</artifactId>
<version>4.1.2</version>
<scope>provided</scope>
</dependency>
<!-- MiniMessage -->
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.12.0</version>
<version>4.15.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.12.0</version>
<version>4.15.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<version>4.12.0</version>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.1.2</version>
<scope>compile</scope>
<version>4.15.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.10.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.unascribed</groupId>
<artifactId>flexver-java</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.0.0-jre</version>
<scope>provided</scope>
</dependency>
<!-- Plugins -->
<dependency>
<groupId>net.william278</groupId>
<artifactId>papiproxybridge</artifactId>
<version>1.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>eu.kennytv.maintenance</groupId>
<artifactId>maintenance-api</artifactId>
<version>4.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -120,12 +146,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.12.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.1</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
@@ -31,39 +31,45 @@ import ch.andre601.advancedserverlist.core.check.UpdateChecker;
import ch.andre601.advancedserverlist.core.commands.CommandHandler;
import ch.andre601.advancedserverlist.core.file.FileHandler;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
import ch.andre601.advancedserverlist.core.objects.ServerPlaceholders;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ExpressionEngine;
import ch.andre601.advancedserverlist.core.profiles.players.PlayerHandler;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
public class AdvancedServerList{
public class AdvancedServerList<F>{
private final PluginCore<?> plugin;
private final PluginCore<F> plugin;
private final FileHandler fileHandler;
private final CommandHandler commandHandler;
private final PlayerHandler playerHandler;
private final AdvancedServerListAPI api = AdvancedServerListAPI.get();
private final ExpressionEngine expressionEngine = new ExpressionEngine();
private UpdateChecker updateChecker;
private String version;
public AdvancedServerList(PluginCore<?> plugin, PlaceholderProvider player){
private AdvancedServerList(PluginCore<F> plugin, List<PlaceholderProvider> placeholders){
this.plugin = plugin;
this.fileHandler = new FileHandler(this);
this.commandHandler = new CommandHandler(this);
this.playerHandler = new PlayerHandler(this);
this.api.addPlaceholderProvider(player);
this.api.addPlaceholderProvider(new ServerPlaceholders());
placeholders.forEach(this.api::addPlaceholderProvider);
load();
}
public PluginCore<?> getPlugin(){
public static <F> AdvancedServerList<F> init(PluginCore<F> plugin, PlaceholderProvider... placeholders){
return new AdvancedServerList<>(plugin, Arrays.asList(placeholders));
}
public PluginCore<F> getPlugin(){
return plugin;
}
@@ -87,6 +93,10 @@ public class AdvancedServerList{
return api;
}
public ExpressionEngine getExpressionEngine(){
return expressionEngine;
}
public void disable(){
getPlugin().getPluginLogger().info("Saving playercache.json file...");
getPlayerHandler().save();
@@ -103,6 +113,10 @@ public class AdvancedServerList{
plugin.clearFaviconCache();
}
public void clearPlayerCache(){
getPlayerHandler().clearCache();
}
private void load(){
printBanner();
resolveVersion();
@@ -117,8 +131,18 @@ public class AdvancedServerList{
return;
}
if(getFileHandler().isOldConfig()){
getPlugin().getPluginLogger().info("Detected old config.yml. Attempting to migrate...");
if(getFileHandler().migrateConfig()){
getPlugin().getPluginLogger().info("Migration completed successfully!");
}else{
getPlugin().getPluginLogger().warn("Couldn't migrate config.yml! Check previous lines for errors.");
return;
}
}
if(getFileHandler().loadProfiles()){
getPlugin().getPluginLogger().info("Successfully loaded " + getFileHandler().getProfiles().size() + " profiles!");
getPlugin().getPluginLogger().info("Successfully loaded %d profile(s)!", getFileHandler().getProfiles().size());
}else{
getPlugin().getPluginLogger().warn("Unable to load profiles! Check previous lines for errors.");
return;
@@ -145,12 +169,11 @@ public class AdvancedServerList{
getPlugin().getPluginLogger().info("AdvancedServerList is ready!");
if(getFileHandler().getBoolean("check_updates"))
if(getFileHandler().getBoolean("checkUpdates"))
this.updateChecker = new UpdateChecker(this);
}
private void printBanner(){
getPlugin().getPluginLogger().info("");
getPlugin().getPluginLogger().info(" _____ _");
getPlugin().getPluginLogger().info(" /\\ / ____| |");
getPlugin().getPluginLogger().info(" / \\ | (___ | |");
@@ -32,6 +32,8 @@ import java.util.concurrent.ThreadFactory;
public class UpdateCheckThread implements ThreadFactory{
@Override
public Thread newThread(@NotNull Runnable r){
return new Thread(r, "AdvancedServerList Update-Thread");
Thread t = new Thread(r, "AdvancedServerList-UpdateThread");
t.setDaemon(true);
return t;
}
}
@@ -30,18 +30,17 @@ import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import com.unascribed.flexver.FlexVerComparator;
import io.leangen.geantyref.TypeToken;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import java.io.IOException;
import java.lang.reflect.Type;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@@ -49,12 +48,10 @@ import java.util.concurrent.TimeUnit;
public class UpdateChecker{
private final String url = "https://api.modrinth.com/v2/project/advancedserverlist/version?loaders=[\"%s\"]";
private final OkHttpClient client = new OkHttpClient();
private final AdvancedServerList core;
private final PluginLogger logger;
private final String loader;
@SuppressWarnings("FieldCanBeLocal")
// 'https://api.modrinth.com/v2/project/advancedserverlist/version?loaders=["%s"]' URL encoded.
private final String url = "https://api.modrinth.com/v2/project/advancedserverlist/version?loaders=%%5B%%22%s%%22%%5D";
private final HttpClient client = HttpClient.newHttpClient();
private final Type listType = new TypeToken<ArrayList<ModrinthVersion>>(){}.getType();
private final Gson gson = new GsonBuilder()
@@ -65,7 +62,11 @@ public class UpdateChecker{
private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(new UpdateCheckThread());
public UpdateChecker(AdvancedServerList core){
private final AdvancedServerList<?> core;
private final PluginLogger logger;
private final String loader;
public UpdateChecker(AdvancedServerList<?> core){
this.core = core;
this.logger = core.getPlugin().getPluginLogger();
this.loader = core.getPlugin().getLoader();
@@ -73,42 +74,13 @@ public class UpdateChecker{
startUpdateChecker();
}
public void startUpdateChecker(){
executor.scheduleAtFixedRate(() -> {
logger.info("Checking for a new update...");
checkUpdate().whenComplete((version, throwable) -> {
if(version == null || throwable != null){
logger.warn("Failed to look for any updates. See previous messages for reasons.");
return;
}
int result = version.compare(core.getVersion());
switch(result){
case -1 -> printUpdateBanner(version.getVersionNumber(), version.getId(), version.isRelease());
case 0 -> logger.info("No new update found. You're running the latest version!");
case 1 -> logger.info(
"Your version (%s) is higher than the latest release (%s). Are you running a dev build?",
core.getVersion(), version.getVersionNumber()
);
}
});
}, 0L, 12L, TimeUnit.HOURS);
}
public void disable(){
executor.shutdown();
client.dispatcher().executorService().shutdown();
try{
if(!executor.awaitTermination(1, TimeUnit.SECONDS)){
executor.shutdownNow();
if(!executor.awaitTermination(1, TimeUnit.SECONDS))
logger.warn("Scheduler didn't terminate in time!");
}
if(!client.dispatcher().executorService().awaitTermination(1, TimeUnit.SECONDS)){
client.dispatcher().executorService().shutdownNow();
if(!client.dispatcher().executorService().awaitTermination(1, TimeUnit.SECONDS))
logger.warn("OkHttp's Scheduler didn't terminate in time!");
logger.warn("Scheduler did not terminate in time!");
}
}catch(InterruptedException ex){
executor.shutdownNow();
@@ -116,108 +88,93 @@ public class UpdateChecker{
}
}
private CompletableFuture<ModrinthVersion> checkUpdate(){
return CompletableFuture.supplyAsync(() -> {
PluginLogger logger = core.getPlugin().getPluginLogger();
if(core.getVersion().equals("UNKNOWN")){
logger.warn("Cannot perform Update check! Plugin version couldn't be parsed.");
return null;
}
private void startUpdateChecker(){
executor.scheduleAtFixedRate(() -> {
logger.info("Looking for an update...");
Request request = new Request.Builder()
.url(String.format(url, loader))
.header("User-Agent", "AdvancedServerList-" + loader + "/" + core.getVersion())
.build();
try(Response response = client.newCall(request).execute()){
if(!response.isSuccessful()){
logger.warn("Encountered a non-successful response from Modrinth! Code: %d", response.code());
return null;
}
ResponseBody body = response.body();
if(body == null){
logger.warn("Received an empty Response body from Modrinth!");
return null;
performUpdateCheck().whenComplete((version, throwable) -> {
if(version == null || throwable != null){
logger.warn("Failed to look for any updates. Check previous messages for causes.");
return;
}
String responseString = body.string();
if(responseString.isEmpty()){
logger.warn("Received an empty Response body from Modrinth!");
return null;
logger.debug(UpdateChecker.class, "Comparing versions...");
int result = version.compare(core.getVersion());
switch(result){
case -1 -> printUpdateBanner(version);
case 0 -> logger.info("You are running the latest version!");
case 1 -> logger.info(
"Your version (%s) seems to be newer than the latest release (%s). Are you running a dev build?",
core.getVersion(), version.versionNumber()
);
}
List<ModrinthVersion> list = gson.fromJson(responseString, listType);
if(list == null || list.isEmpty()){
logger.warn("Couldn't convert JSON Array into a valid list.");
return null;
}
ModrinthVersion version = list.get(0);
if(version.getVersionNumber() == null || version.getVersionNumber().isEmpty()){
logger.warn("Cannot check latest version. Received version number was null/empty.");
return null;
}
return version;
}catch(JsonSyntaxException ex){
logger.warn("Encountered invalid JSON from Response body!", ex);
return null;
}catch(IOException ex){
logger.warn("Encountered Exception while checking for an update!", ex);
return null;
}
});
});
}, 0L, 12L, TimeUnit.HOURS);
}
private void printUpdateBanner(String version, String versionId, boolean isRelease){
private CompletableFuture<ModrinthVersion> performUpdateCheck(){
String finalUrl = String.format(url, loader);
logger.debug(UpdateChecker.class, "Checking '%s' for updates...", finalUrl);
if(core.getVersion().equals("UNKNOWN")){
logger.warn("Cannot perform update check. Plugin version is 'UNKNOWN'!");
return CompletableFuture.completedFuture(null);
}
HttpRequest request;
try{
request = HttpRequest.newBuilder()
.uri(new URI(finalUrl))
.header("User-Agent", "AdvancedServerList-" + loader + "/" + core.getVersion())
.build();
}catch(URISyntaxException ex){
logger.warn("Cannot perform update check. URL '%s' is not a valid URI.", ex, finalUrl);
return CompletableFuture.completedFuture(null);
}
return client.sendAsync(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8))
.thenApply(response -> new ArrayList<ModrinthVersion>(gson.fromJson(response.body(), listType)))
.thenApply(list -> list.get(0))
.exceptionally((throwable) -> {
logger.warn("Encountered exception while performing update check!", throwable);
return null;
});
}
private void printUpdateBanner(ModrinthVersion version){
logger.info("==================================================================");
logger.info("You are running an outdated version of AdvancedServerList!");
logger.info("");
logger.info("Your version: %s", core.getVersion());
logger.info("Modrinth version: %s", version);
logger.info("Modrinth: %s", version.versionNumber());
logger.info("");
if(!isRelease){
logger.info("WARNING: This release is an Alpha/Beta! It may contain");
logger.info(" breaking changes!");
if(!version.isRelease()){
logger.info("WARNING!");
logger.info("This is a %s version and may contain breaking changes and/or bugs!", version.versionType());
logger.info("");
}
logger.info("You can download the latest release from here:");
logger.info("https://modrinth.com/plugin/advancedserverlist/version/%s", versionId);
logger.info("Download the latest version from here:");
logger.info("https://modrinth.com/plugin/advancedserverlist/version/%s", version.id());
logger.info("==================================================================");
}
public static class ModrinthVersion{
@SuppressWarnings("FieldMayBeFinal")
private String id;
@SuppressWarnings("FieldMayBeFinal")
private String versionNumber;
@SuppressWarnings("FieldMayBeFinal")
private String versionType;
public ModrinthVersion(String id, String versionNumber, String versionType){
this.id = id;
this.versionNumber = versionNumber;
this.versionType = versionType;
}
public String getId(){
return id;
}
public String getVersionNumber(){
return versionNumber;
}
public record ModrinthVersion(String id, String versionNumber, String versionType){
public boolean isRelease(){
return versionType.equals("release");
return versionType().equals("release");
}
public int compare(String version){
return FlexVerComparator.compare(version, versionNumber);
return FlexVerComparator.compare(version, versionNumber());
}
@Override
public String toString(){
return String.format("ModrinthVersion{id=%s,versionNumber=%s,versionType=%s}", id, versionNumber, versionType);
}
}
}
@@ -26,56 +26,115 @@
package ch.andre601.advancedserverlist.core.commands;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.interfaces.CmdSender;
import ch.andre601.advancedserverlist.core.interfaces.commands.CmdSender;
import ch.andre601.advancedserverlist.core.interfaces.commands.PluginCommand;
import java.util.ArrayList;
import java.util.List;
public class CommandHandler{
private final AdvancedServerList core;
private final List<PluginCommand> subCommands = new ArrayList<>();
public CommandHandler(AdvancedServerList core){
this.core = core;
public CommandHandler(AdvancedServerList<?> core){
subCommands.add(new Help());
subCommands.add(new Reload(core));
subCommands.add(new ClearCache(core));
}
public void handle(CmdSender sender, String[] args){
String errorPrefix = "<grey>[<gradient:dark_red:red>AdvancedServerList</gradient>]";
String prefix = "<grey>[<gradient:aqua:white>AdvancedServerList</gradient>]";
if(args.length == 0){
sender.sendErrorMsg("<red>Too few arguments! Use <grey>/asl help</grey> for a list of commands.");
return;
}
if(args.length == 0 || args[0].equalsIgnoreCase("help")){
if(sender.hasPermission("advancedserverlist.command.help")){
sender.sendMsg("%s - Commands", prefix);
sender.sendMsg();
sender.sendMsg("<gradient:aqua:white>/asl help</gradient> <grey>- Shows this Help");
sender.sendMsg();
sender.sendMsg("<gradient:aqua:white>/asl reload</gradient> <grey>- Reloads the plugin");
}else{
sender.sendMsg("%s <red>You do not have permissions to execute this command!", errorPrefix);
}
}else
if(args[0].equalsIgnoreCase("reload")){
if(sender.hasPermission("advancedserverlist.command.reload")){
sender.sendMsg("%s Reloading plugin...", prefix);
if(core.getFileHandler().reloadConfig()){
sender.sendMsg("%s <green>Reloaded <grey>config.yml</grey>!", prefix);
}else{
sender.sendMsg("%s <red>Error while reloading the <grey>config.yml</grey>!", errorPrefix);
for(PluginCommand subCommand : subCommands){
if(subCommand.getArgument().equalsIgnoreCase(args[0])){
if(!sender.hasPermission(subCommand.getPermission())){
sender.sendErrorMsg(
"<red>You do not have the permission <grey>%s</grey> to execute this command.",
subCommand.getPermission()
);
return;
}
if(core.getFileHandler().reloadProfiles()){
sender.sendMsg("%s <green>Loaded <grey>%d Profile(s)</grey>!", prefix, core.getFileHandler().getProfiles().size());
}else{
sender.sendMsg("%s <red>Cannot load Profiles!", errorPrefix);
}
core.clearFaviconCache();
sender.sendMsg("%s <green>Successfully cleared Favicon cache!", prefix);
sender.sendMsg("%s <green>Reload complete!", prefix);
}else{
sender.sendMsg("%s <red>You do not have permissions to execute this command!", errorPrefix);
subCommand.handle(sender);
return;
}
}else{
sender.sendMsg("%s <red>Unknown subcommand <grey>%s</grey>. Use <grey>/asl help</grey> for a list of commands.", prefix, args[0]);
}
sender.sendErrorMsg("<red>Unknown subcommand <grey>%s</grey>. Use <grey>/asl help</grey> for a list of commands.", args[0]);
}
private static class Help extends PluginCommand{
public Help(){
super("help");
}
@Override
public void handle(CmdSender sender){
sender.sendPrefixedMsg("- Commands");
sender.sendMsg();
sender.sendMsg("<aqua>/asl <white>help <grey>- Shows this help");
sender.sendMsg();
sender.sendMsg("<aqua>/asl <white>reload <grey>- Reloads the config.yml and profiles");
sender.sendMsg();
sender.sendMsg("<aqua>/asl <white>clearCache <grey>- Clears the Player and Favicon cache");
}
}
private static class Reload extends PluginCommand{
private final AdvancedServerList<?> core;
public Reload(AdvancedServerList<?> core){
super("reload");
this.core = core;
}
@Override
public void handle(CmdSender sender){
sender.sendPrefixedMsg("Reloading plugin...");
if(core.getFileHandler().reloadConfig()){
sender.sendPrefixedMsg("<green>Reloaded <grey>config.yml</grey>!");
}else{
sender.sendErrorMsg("<red>Error while reloading <grey>config.yml</grey>!");
}
if(core.getFileHandler().reloadProfiles()){
sender.sendPrefixedMsg("<green>Loaded <grey>%d profile(s)</grey>!", core.getFileHandler().getProfiles().size());
}else{
sender.sendErrorMsg("<red>Error while loading profile(s)!");
}
sender.sendPrefixedMsg("<green>Reload complete!");
}
}
private static class ClearCache extends PluginCommand{
private final AdvancedServerList<?> core;
public ClearCache(AdvancedServerList<?> core){
super("clearCache");
this.core = core;
}
@Override
public void handle(CmdSender sender){
sender.sendPrefixedMsg("Clearing caches...");
core.clearFaviconCache();
sender.sendPrefixedMsg("<green>Successfully cleared Favicon Cache!");
core.clearPlayerCache();
sender.sendPrefixedMsg("<green>Successfully cleared Player Cache!");
sender.sendPrefixedMsg("<green>Cache clearing complete!");
}
}
}
@@ -0,0 +1,42 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.compat.maintenance;
import eu.kennytv.maintenance.api.Maintenance;
import eu.kennytv.maintenance.api.MaintenanceProvider;
public class MaintenanceUtil{
private final Maintenance api;
public MaintenanceUtil(){
this.api = MaintenanceProvider.get();
}
public boolean isMaintenanceEnabled(){
return api.isMaintenance();
}
}
@@ -0,0 +1,49 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.compat.papi;
import java.util.function.Supplier;
public class PAPICache{
private CacheValue cache = null;
public PAPICache(){}
public String get(Supplier<String> supplier){
if(cache == null || cache.isExpired())
cache = new CacheValue(supplier.get(), System.currentTimeMillis());
return cache.server();
}
private record CacheValue(String server, long timestamp){
// Consider the cache expired if it is older than 5 seconds.
public boolean isExpired(){
return (timestamp < 0L) || System.currentTimeMillis() - timestamp >= 5000L;
}
}
}
@@ -0,0 +1,87 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.compat.papi;
import net.william278.papiproxybridge.api.PlaceholderAPI;
import java.util.*;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
public class PAPIUtil{
private final PlaceholderAPI papi;
private final PAPICache cache = new PAPICache();
public PAPIUtil(){
this.papi = PlaceholderAPI.createInstance();
}
// Make sure the version of PAPIProxyBridge we get has the required methods we need...
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean isCompatible(){
try{
papi.getClass().getMethod("findServers");
return true;
}catch(NoSuchMethodException ex){
return false;
}
}
public String getServer(){
return cache.get(() -> {
List<String> servers;
try{
servers = papi.findServers().getNow(Collections.emptyList());
}catch(CancellationException | CompletionException ex){
return null;
}
if(servers == null || servers.isEmpty())
return null;
return servers.get(0);
});
}
public <P> P getPlayer(Collection<P> players){
if(players.isEmpty())
return null;
return List.copyOf(players).get(0);
}
public String parse(String text, UUID carrier, UUID player){
try{
CompletableFuture<String> future = papi.formatPlaceholders(text, carrier, player);
return future.getNow(text);
}catch(IllegalArgumentException | CancellationException | CompletionException ex){
return text;
}
}
}
@@ -29,9 +29,11 @@ import ch.andre601.advancedserverlist.api.events.GenericServerListEvent;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.core.compat.maintenance.MaintenanceUtil;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
import ch.andre601.advancedserverlist.core.interfaces.events.GenericEventWrapper;
import ch.andre601.advancedserverlist.core.objects.GenericServerImpl;
import ch.andre601.advancedserverlist.core.compat.papi.PAPIUtil;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import ch.andre601.advancedserverlist.core.profiles.ServerListProfile;
import ch.andre601.advancedserverlist.core.profiles.profile.ProfileManager;
@@ -39,12 +41,21 @@ import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer;
public class PingEventHandler{
private static PAPIUtil papiUtil = null;
private static MaintenanceUtil maintenanceUtil = null;
public static <F, P extends GenericPlayer> void handleEvent(GenericEventWrapper<F, P> event){
if(event.isInvalidProtocol())
event.getPlugin().getPluginLogger().debug(PingEventHandler.class, "Received ping event. Handling it...");
if(event.isInvalidProtocol() || event.isMaintenanceModeActive()){
event.getPlugin().getPluginLogger().debug(PingEventHandler.class, "Not handling event. Either protocol was invalid of Maintenance is enabled.");
return;
}
PluginCore<F> plugin = event.getPlugin();
String host = event.getVirtualHost();
PluginLogger logger = plugin.getPluginLogger();
logger.debug(PingEventHandler.class, "Protocol valid. Continue handling...");
int online = event.getOnlinePlayers();
int max = event.getMaxPlayers();
@@ -53,61 +64,95 @@ public class PingEventHandler{
plugin.getCore().getPlayerHandler().getCachedPlayer(event.getPlayerIP()),
event.getProtocolVersion()
);
GenericServer server = new GenericServerImpl(online, max, host);
GenericServer server = event.createGenericServer(online, max, host);
ServerListProfile profile = ProfileManager.resolveProfile(plugin.getCore(), player, server);
if(profile == null)
if(profile == null){
logger.debugWarn(PingEventHandler.class, "Server List Profile couldn't be resolved properly. Cancelling event handling...");
return;
}
logger.debug(PingEventHandler.class, "Received valid Server List Profile. Calling PreServerListSetEvent...");
GenericServerListEvent e = event.callEvent(ProfileManager.merge(profile));
if(e == null || e.isCancelled())
if(e == null || e.isCancelled()){
logger.debug(PingEventHandler.class, "PreServerListSetEvent was cancelled. Stopping ping handling...");
return;
}
logger.debug(PingEventHandler.class, "PreServerListSetEvent completed. Proceeding with ping handling...");
ProfileEntry entry = e.getEntry();
if(entry.isInvalid())
if(entry.isInvalid()){
logger.debugWarn(PingEventHandler.class, "No valid ProfileEntry retrieved. Cancelling ping handling...");
return;
}
if(ProfileManager.checkOption(entry.isExtraPlayersEnabled())){
max = online + (entry.getExtraPlayersCount() == null ? 0 : entry.getExtraPlayersCount());
boolean extraPlayers = ProfileManager.checkOption(entry.extraPlayersEnabled());
if(extraPlayers){
max = online + (entry.extraPlayersCount() == null ? 0 : entry.extraPlayersCount());
logger.debug(PingEventHandler.class, "Extra Players enabled. Applying '%d' as max player count...", max);
event.setMaxPlayers(max);
}
GenericServer finalServer = new GenericServerImpl(online, max, host);
if(ProfileManager.checkOption(entry.maxPlayersEnabled()) && !extraPlayers){
max = (entry.maxPlayersCount() == null) ? 0 : entry.maxPlayersCount();
logger.debug(PingEventHandler.class, "Max Players enabled. Applying '%d' as max player count...", max);
event.setMaxPlayers(max);
}
if(ProfileManager.checkOption(entry.getMotd())){
GenericServer finalServer = event.createGenericServer(online, max, host);
if(ProfileManager.checkOption(entry.motd())){
logger.debug(PingEventHandler.class, "MOTD set. Applying '%s'...", String.join("\\n", entry.motd()));
event.setMotd(
ComponentParser.list(entry.getMotd())
ComponentParser.list(entry.motd())
.modifyText(text -> StringReplacer.replace(text, player, finalServer))
.modifyText(text -> event.parsePAPIPlaceholders(text, player))
.toComponent()
);
}
boolean hidePlayers = ProfileManager.checkOption(entry.isHidePlayersEnabled());
boolean hidePlayers = ProfileManager.checkOption(entry.hidePlayersEnabled());
if(hidePlayers){
logger.debug(PingEventHandler.class, "Hide Players enabled. Hiding player count...");
event.hidePlayers();
}
if(ProfileManager.checkOption(entry.getPlayerCountText()) && !hidePlayers){
if(ProfileManager.checkOption(entry.playerCountText()) && !hidePlayers){
logger.debug(PingEventHandler.class, "Player Count Text set. Applying '%s'...", entry.playerCountText());
event.setPlayerCount(
ComponentParser.text(entry.getPlayerCountText())
ComponentParser.text(entry.playerCountText())
.modifyText(text -> StringReplacer.replace(text, player, finalServer))
.modifyText(text -> event.parsePAPIPlaceholders(text, player))
.toString()
);
}
if(ProfileManager.checkOption(entry.getPlayers()) && !hidePlayers){
event.setPlayers(entry.getPlayers(), player, server);
if(ProfileManager.checkOption(entry.players()) && !hidePlayers){
logger.debug(PingEventHandler.class, "Player Count Hover set. Applying '%s'...", String.join("\\n", entry.players()));
event.setPlayers(entry.players(), player, server);
}
if(ProfileManager.checkOption(entry.getFavicon())){
String favicon = StringReplacer.replace(entry.getFavicon(), player, server);
if(ProfileManager.checkOption(entry.favicon())){
logger.debug(PingEventHandler.class, "Favicon set. Resolving '%s'...", entry.favicon());
String favicon = StringReplacer.replace(entry.favicon(), player, server);
F fav = plugin.getFaviconHandler().getFavicon(favicon, image -> {
try{
logger.debug(PingEventHandler.class, "Converting BufferedImage to Server or Proxy Favicon instance...");
return event.createFavicon(image);
}catch(Exception ex){
plugin.getPluginLogger().warn("Encountered an Exception while creating Favicon!", ex);
@@ -116,12 +161,31 @@ public class PingEventHandler{
});
if(fav == null){
logger.debugWarn(PingEventHandler.class, "Favicon was invalid or not yet resolved! Using default favicon of Server/Proxy...");
event.setDefaultFavicon();
}else{
logger.debug(PingEventHandler.class, "Applying favicon...");
event.setFavicon(fav);
}
}
logger.debug(PingEventHandler.class, "Event handling completed. Updating Ping data...");
event.updateEvent();
}
public static PAPIUtil getPAPIUtil(){
if(papiUtil != null)
return papiUtil;
return (papiUtil = new PAPIUtil());
}
public static MaintenanceUtil getMaintenanceUtil(){
if(maintenanceUtil != null)
return maintenanceUtil;
return (maintenanceUtil = new MaintenanceUtil());
}
}
@@ -0,0 +1,103 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.file;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import org.spongepowered.configurate.ConfigurateException;
import org.spongepowered.configurate.ConfigurationNode;
import org.spongepowered.configurate.NodePath;
import org.spongepowered.configurate.transformation.ConfigurationTransformation;
import org.spongepowered.configurate.transformation.TransformAction;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class ConfigMigrator{
public static final int LATEST = resolveConfigVersion();
private ConfigMigrator(){}
public static ConfigurationTransformation.Versioned create(){
return ConfigurationTransformation.versionedBuilder()
.versionKey("configVersion")
.addVersion(LATEST, twoToThree())
.addVersion(2, oneToTwo())
.build();
}
public static ConfigurationTransformation twoToThree(){
return ConfigurationTransformation.builder()
.addAction(NodePath.path(), ((path, value) -> {
value.node("debug").set(false);
return null;
}))
.build();
}
public static ConfigurationTransformation oneToTwo(){
return ConfigurationTransformation.builder()
.addAction(NodePath.path("unknown_player"), (path, value) -> new Object[]{"unknownPlayer", "name"})
.addAction(NodePath.path("unknown_player_uuid"), (path, value) -> new Object[]{"unknownPlayer", "uuid"})
.addAction(NodePath.path("disable_cache"), TransformAction.rename("disableCache"))
.addAction(NodePath.path("check_updates"), TransformAction.rename("checkUpdates"))
.addAction(NodePath.path("send_statistics"), TransformAction.rename("sendStatistics"))
.addAction(NodePath.path(), (path, value) -> {
value.node("configVersion").set(LATEST);
return null;
})
.build();
}
public static <N extends ConfigurationNode> N updateNode(final N node, PluginLogger logger) throws ConfigurateException{
if(!node.virtual()){
final ConfigurationTransformation.Versioned versioned = create();
final int startVersion = versioned.version(node);
versioned.apply(node);
final int endVersion = versioned.version(node);
if(startVersion < endVersion)
logger.info("Migrated config.yml from v" + startVersion + " to v" + endVersion);
}
return node;
}
private static int resolveConfigVersion(){
try(InputStream is = AdvancedServerList.class.getResourceAsStream("/version.properties")){
Properties properties = new Properties();
properties.load(is);
return Integer.parseInt(properties.getProperty("config-version"));
}catch(IOException | NumberFormatException ex){
return -1;
}
}
}
@@ -30,7 +30,9 @@ import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.profiles.ServerListProfile;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.core.profiles.profile.ProfileSerializer;
import org.spongepowered.configurate.ConfigurateException;
import org.spongepowered.configurate.ConfigurationNode;
import org.spongepowered.configurate.yaml.NodeStyle;
import org.spongepowered.configurate.yaml.YamlConfigurationLoader;
import java.io.File;
@@ -38,13 +40,16 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
public class FileHandler{
private final AdvancedServerList plugin;
private final AdvancedServerList<?> plugin;
private final PluginLogger logger;
private final Path config;
@@ -54,7 +59,7 @@ public class FileHandler{
private ConfigurationNode node = null;
public FileHandler(AdvancedServerList core){
public FileHandler(AdvancedServerList<?> core){
this.plugin = core;
this.logger = core.getPlugin().getPluginLogger();
@@ -68,7 +73,7 @@ public class FileHandler{
public boolean loadConfig(){
logger.info("Loading config.yml...");
File folder = config.toFile().getParentFile();
File folder = plugin.getPlugin().getFolderPath().toFile();
if(!folder.exists() && !folder.mkdirs()){
logger.warn("Couldn't create folder for plugin. Is it missing Write permissions?");
return false;
@@ -82,6 +87,7 @@ public class FileHandler{
}
Files.copy(stream, config);
logger.info("Created new config.yml!");
}catch(IOException ex){
logger.warn("Cannot create config.yml for plugin.", ex);
return false;
@@ -112,6 +118,26 @@ public class FileHandler{
return reloadProfiles();
}
public boolean migrateConfig(){
YamlConfigurationLoader loader = YamlConfigurationLoader.builder()
.path(config)
.nodeStyle(NodeStyle.BLOCK)
.build();
if(!makeBackup())
return false;
try{
node = ConfigMigrator.updateNode(loader.load(), logger);
loader.save(node);
return true;
}catch(ConfigurateException ex){
logger.warn("Error while trying to migrate config.yml.", ex);
return false;
}
}
public boolean reloadConfig(){
return (node = getConfigurationNode(config)) != null;
}
@@ -131,7 +157,7 @@ public class FileHandler{
continue;
profiles.add(ServerListProfile.Builder.resolve(file.getName(), tmp, logger).build());
logger.info("Loaded " + file.getName());
logger.info("Loaded '%s'!", file.getName());
}
if(profiles.isEmpty()){
@@ -152,7 +178,7 @@ public class FileHandler{
try{
return loader.load();
}catch(IOException ex){
logger.warn("Cannot load " + path.toFile().getName() + " due to an IOException!", ex);
logger.warn("Cannot load '%s' due to an IOException!", ex, path.toFile().getName());
return null;
}
}
@@ -164,4 +190,36 @@ public class FileHandler{
public boolean getBoolean(Object... path){
return node.node(path).getBoolean();
}
public boolean isOldConfig(){
return node.node("configVersion").virtual() || node.node("configVersion").getInt(0) < ConfigMigrator.LATEST;
}
private boolean makeBackup(){
logger.info("Making backup of old config.yml...");
File backups = plugin.getPlugin().getFolderPath().resolve("backups").toFile();
if(!backups.exists() && !backups.mkdirs()){
logger.warn("Cannot create backups folder for migration!");
return false;
}
String date = DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(LocalDateTime.now());
File configBackup = new File(backups, "config_" + date.replace(":", "_") + ".yml");
try{
if(!configBackup.exists() && !configBackup.createNewFile()){
logger.warn("Cannot create backup file for config.yml!");
return false;
}
Files.copy(config, configBackup.toPath(), StandardCopyOption.REPLACE_EXISTING);
logger.info("Saved backup as '%s'!", configBackup.getName());
return true;
}catch(IOException ex){
logger.warn("Encountered IOException while trying to create a backup.", ex);
return false;
}
}
}
@@ -27,6 +27,10 @@ package ch.andre601.advancedserverlist.core.interfaces;
public interface PluginLogger{
void debug(Class<?> clazz, String msg, Object... args);
void debugWarn(Class<?> clazz, String msg, Object... args);
void info(String msg, Object... args);
void warn(String msg, Object... args);
@@ -0,0 +1,48 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.interfaces.commands;
public interface CmdSender{
String prefix = "<grey>[<gradient:aqua:white>AdvancedServerList</gradient>] ";
String errorPrefix = "<grey>[<gradient:dark_red:red>AdvancedServerList</gradient>] ";
boolean hasPermission(String permission);
void sendMsg(String msg, Object... args);
default void sendMsg(){
sendMsg("");
}
default void sendPrefixedMsg(String msg, Object... args){
sendMsg(prefix + msg, args);
}
default void sendErrorMsg(String msg, Object... args){
sendMsg(errorPrefix + msg, args);
}
}
@@ -0,0 +1,47 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.interfaces.commands;
import java.util.Locale;
public abstract class PluginCommand{
private final String argument;
public PluginCommand(String argument){
this.argument = argument;
}
public String getArgument(){
return argument;
}
public String getPermission(){
return "advancedserverlist.command." + getArgument().toLowerCase(Locale.ROOT);
}
public abstract void handle(CmdSender sender);
}
@@ -41,7 +41,7 @@ public interface PluginCore<F>{
void clearFaviconCache();
AdvancedServerList getCore();
AdvancedServerList<F> getCore();
Path getFolderPath();
@@ -54,4 +54,8 @@ public interface PluginCore<F>{
String getPlatformVersion();
String getLoader();
default boolean isDebugEnabled(){
return getCore().getFileHandler().getBoolean("debug");
}
}
@@ -59,6 +59,8 @@ public interface GenericEventWrapper<F, P extends GenericPlayer>{
boolean isInvalidProtocol();
boolean isMaintenanceModeActive();
int getProtocolVersion();
int getOnlinePlayers();
@@ -75,6 +77,8 @@ public interface GenericEventWrapper<F, P extends GenericPlayer>{
P createPlayer(CachedPlayer player, int protocol);
GenericServer createGenericServer(int playersOnline, int playersMax, String host);
F createFavicon(BufferedImage image) throws Exception;
default String resolveHost(InetSocketAddress address){
@@ -30,16 +30,22 @@ import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.profiles.conditions.Expression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ExpressionEngine;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionErrorTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer;
import org.spongepowered.configurate.ConfigurationNode;
import org.spongepowered.configurate.serialize.SerializationException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.StringJoiner;
public class ServerListProfile{
private final int priority;
private final String condition;
private final List<Expression> expressions;
private final ProfileEntry defaultProfile;
@@ -47,18 +53,30 @@ public class ServerListProfile{
private final Random random = new Random();
public ServerListProfile(int priority, List<Expression> expressions, List<ProfileEntry> profiles, ProfileEntry defaultProfile){
public ServerListProfile(int priority, String condition, List<Expression> expressions, ProfileEntry defaultProfile, List<ProfileEntry> profiles){
this.priority = priority;
this.condition = condition;
this.expressions = expressions;
this.profiles = profiles;
this.defaultProfile = defaultProfile;
this.profiles = profiles;
}
public int getPriority(){
return priority;
}
public boolean evalConditions(GenericPlayer player, GenericServer server){
public boolean evalConditions(ExpressionEngine expressionEngine, PluginLogger logger, GenericPlayer player, GenericServer server){
if(condition != null && !condition.isEmpty()){
ExpressionTemplate template = expressionEngine.compile(condition, logger, player, server);
if(template instanceof ExpressionErrorTemplate errorTemplate){
logger.warn(errorTemplate.instantiateWithStringResult().evaluate());
return true;
}
return template.instantiateWithBooleanResult().evaluate();
}
if(expressions.isEmpty())
return true;
@@ -120,6 +138,7 @@ public class ServerListProfile{
private final PluginLogger logger;
private String condition = null;
private List<ProfileEntry> profiles = new ArrayList<>();
private ProfileEntry defaultProfile = ProfileEntry.empty();
@@ -132,11 +151,21 @@ public class ServerListProfile{
public static Builder resolve(String fileName, ConfigurationNode node, PluginLogger logger){
return new Builder(fileName, node, logger)
.resolveCondition()
.resolveExpressions()
.resolveProfiles()
.resolveDefaultProfile();
}
private Builder resolveCondition(){
String condition = node.node("condition").getString();
if(condition == null || condition.isEmpty())
return this;
this.condition = condition;
return this;
}
private Builder resolveExpressions(){
List<String> temp;
try{
@@ -149,6 +178,8 @@ public class ServerListProfile{
if(temp == null || temp.isEmpty())
return this;
StringJoiner joiner = new StringJoiner(" and ");
for(String str : temp){
Expression expr = Expression.resolve(str);
@@ -157,9 +188,18 @@ public class ServerListProfile{
continue;
}
joiner.add(str);
this.expressions.add(expr);
}
if(!this.expressions.isEmpty()){
logger.warn("'%s' uses 'conditions' which is deprecated in favour of the newer 'condition' option.", fileName);
logger.warn("The 'conditions' option will be removed in a future version.");
logger.warn("");
logger.warn("Please migrate your condition(s) over from the old option to the new option like this:");
logger.warn("consition: '%s'", joiner.toString());
}
return this;
}
@@ -183,7 +223,7 @@ public class ServerListProfile{
}
public ServerListProfile build(){
return new ServerListProfile(this.priority, this.expressions, this.profiles, this.defaultProfile);
return new ServerListProfile(this.priority, this.condition, this.expressions, this.defaultProfile, this.profiles);
}
}
}
@@ -0,0 +1,107 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToStringExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.AbstractUnaryToBooleanExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.AbstractUnaryToDoubleExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.AbstractUnaryToStringExpression;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Locale;
public class Conversions{
private final static NumberFormat NUMBER_FORMAT;
static {
NUMBER_FORMAT = NumberFormat.getNumberInstance(Locale.ROOT);
NUMBER_FORMAT.setGroupingUsed(false);
}
public static ToBooleanExpression toBoolean(ToDoubleExpression expression){
return new AbstractUnaryToBooleanExpression<>(expression) {
@Override
public boolean evaluate(){
return delegate.evaluate() != 0;
}
};
}
public static ToBooleanExpression toBoolean(ToStringExpression expression){
return new AbstractUnaryToBooleanExpression<>(expression) {
@Override
public boolean evaluate(){
return Boolean.parseBoolean(delegate.evaluate());
}
};
}
public static ToDoubleExpression toDouble(ToBooleanExpression expression){
return new AbstractUnaryToDoubleExpression<>(expression) {
@Override
public double evaluate(){
return delegate.evaluate() ? 1 : 0;
}
};
}
public static ToDoubleExpression toDouble(ToStringExpression expression){
return new AbstractUnaryToDoubleExpression<>(expression) {
@Override
public double evaluate(){
String result = delegate.evaluate();
try{
return NUMBER_FORMAT.parse(result).doubleValue();
}catch(ParseException | NumberFormatException ex){
return 0;
}
}
};
}
public static ToStringExpression toString(ToBooleanExpression expression){
return new AbstractUnaryToStringExpression<>(expression) {
@Override
public String evaluate(){
return Boolean.toString(delegate.evaluate());
}
};
}
public static ToStringExpression toString(ToDoubleExpression expression){
return new AbstractUnaryToStringExpression<>(expression) {
@Override
public String evaluate(){
double result = delegate.evaluate();
return result == (int)result ? Integer.toString((int)result) : Double.toString(result);
}
};
}
}
@@ -127,12 +127,24 @@ public class Expression{
return left.equals(right);
}
},
EQUALS_IGNORE_CASE('~', '='){
@Override
public boolean evaluate(String left, String right){
return left.equalsIgnoreCase(right);
}
},
NOT_EQUAL('!', '='){
@Override
public boolean evaluate(String left, String right){
return !left.equals(right);
}
},
NOT_EQUAL_IGNORE_CASE('!', '~'){
@Override
public boolean evaluate(String left, String right){
return !left.equalsIgnoreCase(right);
}
},
GREATER('>', '\0'){
@Override
public boolean evaluate(String left, String right){
@@ -172,7 +184,7 @@ public class Expression{
public static Operator getOperand(char first, char second){
for(Operator operator : VALUES){
if(operator.first == first){
if((!operator.hasSecond() && second != '=') || operator.second == second)
if((!operator.hasSecond() && second != '=' && second != '~') || operator.second == second)
return operator;
}
}
@@ -0,0 +1,78 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.readers.TokenReader;
import com.google.common.collect.Ordering;
import java.text.ParsePosition;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
public class ExpressionTokenizer{
private static final Ordering<TokenReader> TOKEN_READER_ORDERING = Ordering.from(Comparator.comparingInt(TokenReader::getPriority)).reverse();
private final List<TokenReader> tokenReaders;
public ExpressionTokenizer(Iterable<TokenReader> tokenReaders){
this.tokenReaders = TOKEN_READER_ORDERING.immutableSortedCopy(tokenReaders);
}
public List<Token> parse(String text, PluginLogger logger, GenericPlayer player, GenericServer server){
ParsePosition position = new ParsePosition(0);
List<Token> tokens = new LinkedList<>();
next_token:
while(true){
while(position.getIndex() < text.length() && Character.isWhitespace(text.charAt(position.getIndex()))){
position.setIndex(position.getIndex() + 1);
}
if(position.getIndex() >= text.length())
break;
for(TokenReader tokenReader : tokenReaders){
Token token;
if(null != (token = tokenReader.read(text, position, player, server))){
tokens.add(token);
continue next_token;
}
}
logger.warn("Illegal token '%c' at index %d.", text.charAt(position.getIndex()), position.getIndex());
break;
}
return tokens;
}
}
@@ -0,0 +1,28 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.expressions;
public interface Expression{}
@@ -0,0 +1,176 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.expressions;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.profiles.conditions.ExpressionTokenizer;
import ch.andre601.advancedserverlist.core.profiles.conditions.operators.ListOperator;
import ch.andre601.advancedserverlist.core.profiles.conditions.operators.Operator;
import ch.andre601.advancedserverlist.core.profiles.conditions.parsers.*;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplates;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.BooleanToken;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.DefaultTokens;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.readers.*;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ExpressionEngine{
private final ExpressionTokenizer tokenizer;
private final ExpressionTemplateParser templateParser;
public ExpressionEngine(){
Options options = new Options.Builder()
.withDefaultTokenReaders()
.withDefaultOperators()
.withDefaultValueReaders()
.build();
this.tokenizer = new ExpressionTokenizer(options.tokenReaders);
this.templateParser = new ExpressionTemplateParser(options.operators, options.valueReaders);
}
public ExpressionTemplate compile(String expression, PluginLogger logger, GenericPlayer player, GenericServer server){
return templateParser.parse(tokenizer.parse(expression, logger, player, server));
}
public static class Options{
private final List<TokenReader> tokenReaders;
private final ImmutableMap<Token, Operator> operators;
private final ImmutableList<ValueReader> valueReaders;
private Options(List<TokenReader> tokenReaders, ImmutableMap<Token, Operator> operators, ImmutableList<ValueReader> valueReaders){
this.tokenReaders = tokenReaders;
this.operators = operators;
this.valueReaders = valueReaders;
}
public static class Builder{
private final List<TokenReader> tokenReaders = new ArrayList<>();
private final Map<Token, Operator> operators = new HashMap<>();
private final List<ValueReader> valueReaders = new ArrayList<>();
public Builder(){}
public Builder withDefaultTokenReaders(){
return this
.tokenReader(new PatternTokenReader(BooleanToken.FALSE, "false"))
.tokenReader(new PatternTokenReader(BooleanToken.TRUE, "true"))
.tokenReader(new PatternTokenReader(DefaultTokens.AND, "and"))
.tokenReader(new PatternTokenReader(DefaultTokens.AND, "&&"))
.tokenReader(new PatternTokenReader(DefaultTokens.OR, "or"))
.tokenReader(new PatternTokenReader(DefaultTokens.OR, "||"))
.tokenReader(new PatternTokenReader(DefaultTokens.EQUAL, "=="))
.tokenReader(new PatternTokenReader(DefaultTokens.EQUAL, "="))
.tokenReader(new PatternTokenReader(DefaultTokens.NOT_EQUAL, "!="))
.tokenReader(new PatternTokenReader(DefaultTokens.EQUAL_IGNORE_CASE, "~="))
.tokenReader(new PatternTokenReader(DefaultTokens.NOT_EQUAL_IGNORE_CASE, "!~"))
.tokenReader(new PatternTokenReader(DefaultTokens.STARTS_WITH, "|-"))
.tokenReader(new PatternTokenReader(DefaultTokens.ENDS_WITH, "-|"))
.tokenReader(new PatternTokenReader(DefaultTokens.CONTAINS, "<_"))
.tokenReader(new PatternTokenReader(DefaultTokens.GREATER_OR_EQUAL_THAN, ">="))
.tokenReader(new PatternTokenReader(DefaultTokens.LESSER_OR_EQUAL_THAN, "<="))
.tokenReader(new PatternTokenReader(DefaultTokens.OPENING_PARENTHESIS, "("))
.tokenReader(new PatternTokenReader(DefaultTokens.CLOSING_PARENTHESIS, ")"))
.tokenReader(new PatternTokenReader(DefaultTokens.NEGATION, "!"))
.tokenReader(new PatternTokenReader(DefaultTokens.GREATER_THAN, ">"))
.tokenReader(new PatternTokenReader(DefaultTokens.LESSER_THAN, "<"))
.tokenReader(new PatternTokenReader(DefaultTokens.CONCAT_STRING, "."))
.tokenReader(new PatternTokenReader(DefaultTokens.ADD, "+"))
.tokenReader(new PatternTokenReader(DefaultTokens.SUB, "-"))
.tokenReader(new PatternTokenReader(DefaultTokens.MULT, "*"))
.tokenReader(new PatternTokenReader(DefaultTokens.DIV, "/"))
.tokenReader(new QuotedLiteralTokenReader(-10, '\"'))
.tokenReader(new QuotedLiteralTokenReader(-10, '\''))
.tokenReader(new PlaceholderTokenReader(-20))
.tokenReader(new NumberTokenReader(-50))
.tokenReader(new NonQuotedLiteralTokenReader(-100));
}
public Builder withDefaultOperators(){
return this
.operator(DefaultTokens.AND, ListOperator.of(100, ExpressionTemplates::and))
.operator(DefaultTokens.OR, ListOperator.of(50, ExpressionTemplates::or))
.operator(DefaultTokens.EQUAL, Operator.of(25, ExpressionTemplates::equal))
.operator(DefaultTokens.NOT_EQUAL, Operator.of(25, ExpressionTemplates::notEqual))
.operator(DefaultTokens.EQUAL_IGNORE_CASE, Operator.of(25, ExpressionTemplates::equalIgnoreCase))
.operator(DefaultTokens.NOT_EQUAL_IGNORE_CASE, Operator.of(25, ExpressionTemplates::notEqualIgnoreCase))
.operator(DefaultTokens.STARTS_WITH, Operator.of(25, ExpressionTemplates::startsWith))
.operator(DefaultTokens.ENDS_WITH, Operator.of(25, ExpressionTemplates::endsWith))
.operator(DefaultTokens.CONTAINS, Operator.of(25, ExpressionTemplates::contains))
.operator(DefaultTokens.GREATER_THAN, Operator.of(25, ExpressionTemplates::greater))
.operator(DefaultTokens.GREATER_OR_EQUAL_THAN, Operator.of(25, ExpressionTemplates::greaterOrEqual))
.operator(DefaultTokens.LESSER_THAN, Operator.of(25, ExpressionTemplates::less))
.operator(DefaultTokens.LESSER_OR_EQUAL_THAN, Operator.of(25, ExpressionTemplates::lessOrEqual))
.operator(DefaultTokens.CONCAT_STRING, ListOperator.of(10, ExpressionTemplates::concat))
.operator(DefaultTokens.ADD, ListOperator.of(4, ExpressionTemplates::sum))
.operator(DefaultTokens.SUB, Operator.of(3, ExpressionTemplates::sub))
.operator(DefaultTokens.MULT, ListOperator.of(2, ExpressionTemplates::product))
.operator(DefaultTokens.DIV, Operator.of(1, ExpressionTemplates::div));
}
public Builder withDefaultValueReaders(){
return this
.valueReader(new BooleanConstantReader())
.valueReader(new NumberConstantReader())
.valueReader(new StringConstantReader())
.valueReader(new NegatedExpressionReader(DefaultTokens.NEGATION))
.valueReader(new ParenthesisedExpressionReader(DefaultTokens.OPENING_PARENTHESIS, DefaultTokens.CLOSING_PARENTHESIS))
.valueReader(new PlaceholderReader())
.valueReader(new NegatedNumberReader(DefaultTokens.SUB));
}
public Builder tokenReader(TokenReader tokenReader){
this.tokenReaders.add(tokenReader);
return this;
}
public Builder operator(Token token, Operator operator){
this.operators.put(token, operator);
return this;
}
public Builder valueReader(ValueReader valueReader){
this.valueReaders.add(valueReader);
return this;
}
public Options build(){
return new Options(this.tokenReaders, ImmutableMap.copyOf(operators), ImmutableList.copyOf(valueReaders));
}
}
}
}
@@ -0,0 +1,238 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.expressions;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.*;
import java.util.Collection;
public class Expressions{
public static ToBooleanExpression negate(ToBooleanExpression expression){
return new AbstractUnaryToBooleanExpression<>(expression){
@Override
public boolean evaluate(){
return !delegate.evaluate();
}
};
}
public static ToBooleanExpression and(Collection<ToBooleanExpression> operands){
return new AbstractToBooleanExpression<>(operands){
@Override
public boolean evaluate(){
for(ToBooleanExpression operand : operands){
if(!operand.evaluate())
return false;
}
return true;
}
};
}
public static ToBooleanExpression or(Collection<ToBooleanExpression> operands){
return new AbstractToBooleanExpression<>(operands){
@Override
public boolean evaluate(){
for(ToBooleanExpression operand : operands){
if(operand.evaluate())
return true;
}
return false;
}
};
}
public static ToStringExpression concat(Collection<ToStringExpression> operands){
return new AbstractToStringExpression<>(operands){
@Override
public String evaluate(){
StringBuilder result = new StringBuilder();
for(ToStringExpression operand : operands){
result.append(operand.evaluate());
}
return result.toString();
}
};
}
public static ToBooleanExpression equal(ToStringExpression a, ToStringExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return a.evaluate().equals(b.evaluate());
}
};
}
public static ToBooleanExpression notEqual(ToStringExpression a, ToStringExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return !a.evaluate().equals(b.evaluate());
}
};
}
public static ToBooleanExpression equalIgnoreCase(ToStringExpression a, ToStringExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return a.evaluate().equalsIgnoreCase(b.evaluate());
}
};
}
public static ToBooleanExpression notEqualIgnoreCase(ToStringExpression a, ToStringExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return !a.evaluate().equalsIgnoreCase(b.evaluate());
}
};
}
public static ToBooleanExpression startsWith(ToStringExpression a, ToStringExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return a.evaluate().startsWith(b.evaluate());
}
};
}
public static ToBooleanExpression endsWith(ToStringExpression a, ToStringExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return a.evaluate().endsWith(b.evaluate());
}
};
}
public static ToBooleanExpression contains(ToStringExpression a, ToStringExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return a.evaluate().contains(b.evaluate());
}
};
}
public static ToBooleanExpression greaterThan(ToDoubleExpression a, ToDoubleExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return a.evaluate() > b.evaluate();
}
};
}
public static ToBooleanExpression greaterOrEqualThan(ToDoubleExpression a, ToDoubleExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return a.evaluate() >= b.evaluate();
}
};
}
public static ToBooleanExpression lessThan(ToDoubleExpression a, ToDoubleExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return a.evaluate() < b.evaluate();
}
};
}
public static ToBooleanExpression lessOrEqualThan(ToDoubleExpression a, ToDoubleExpression b){
return new AbstractBinaryToBooleanExpression<>(a, b){
@Override
public boolean evaluate(){
return a.evaluate() <= b.evaluate();
}
};
}
public static ToDoubleExpression sum(Collection<ToDoubleExpression> operands){
return new AbstractToDoubleExpression<>(operands){
@Override
public double evaluate(){
double result = 0;
for(ToDoubleExpression operand : operands){
result += operand.evaluate();
}
return result;
}
};
}
public static ToDoubleExpression product(Collection<ToDoubleExpression> operands){
return new AbstractToDoubleExpression<>(operands){
@Override
public double evaluate(){
double result = 1;
for(ToDoubleExpression operand : operands){
result *= operand.evaluate();
}
return result;
}
};
}
public static ToDoubleExpression sub(ToDoubleExpression a, ToDoubleExpression b){
return new AbstractBinaryToDoubleExpression<>(a, b){
@Override
public double evaluate(){
return a.evaluate() - b.evaluate();
}
};
}
public static ToDoubleExpression div(ToDoubleExpression a, ToDoubleExpression b){
return new AbstractBinaryToDoubleExpression<>(a, b){
@Override
public double evaluate(){
return a.evaluate() / b.evaluate();
}
};
}
public static ToDoubleExpression negateNumber(ToDoubleExpression a){
return new AbstractUnaryToDoubleExpression<>(a){
@Override
public double evaluate(){
return -delegate.evaluate();
}
};
}
}
@@ -0,0 +1,49 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.expressions;
public interface ToBooleanExpression extends Expression{
boolean evaluate();
static ToBooleanExpression literal(boolean value){
return new ConstantToBooleanExpression(value);
}
class ConstantToBooleanExpression implements ToBooleanExpression{
private final boolean value;
public ConstantToBooleanExpression(boolean value){
this.value = value;
}
@Override
public boolean evaluate(){
return value;
}
}
}
@@ -0,0 +1,49 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.expressions;
public interface ToDoubleExpression extends Expression{
double evaluate();
static ToDoubleExpression literal(double value){
return new ConstantToDoubleExpression(value);
}
class ConstantToDoubleExpression implements ToDoubleExpression{
private final double value;
public ConstantToDoubleExpression(double value){
this.value = value;
}
@Override
public double evaluate(){
return value;
}
}
}
@@ -0,0 +1,49 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.expressions;
public interface ToStringExpression extends Expression{
String evaluate();
static ToStringExpression literal(String value){
return new ConstantToStringExpression(value);
}
class ConstantToStringExpression implements ToStringExpression{
private final String value;
private ConstantToStringExpression(String value){
this.value = value;
}
@Override
public String evaluate(){
return value;
}
}
}
@@ -0,0 +1,56 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.operators;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.function.Function;
public abstract class ListOperator extends Operator{
public ListOperator(int priority){
super(priority);
}
public static ListOperator of(int priority, Function<Collection<ExpressionTemplate>, ExpressionTemplate> function){
return new ListOperator(priority){
@Override
public ExpressionTemplate createTemplate(List<ExpressionTemplate> operands){
return function.apply(operands);
}
};
}
@Override
public ExpressionTemplate createTemplate(ExpressionTemplate a, ExpressionTemplate b){
return createTemplate(Arrays.asList(a, b));
}
public abstract ExpressionTemplate createTemplate(List<ExpressionTemplate> operands);
}
@@ -0,0 +1,54 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.operators;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import java.util.function.BiFunction;
public abstract class Operator{
private final int priority;
public Operator(int priority){
this.priority = priority;
}
public static Operator of(int priority, BiFunction<ExpressionTemplate, ExpressionTemplate, ExpressionTemplate> function){
return new Operator(priority){
@Override
public ExpressionTemplate createTemplate(ExpressionTemplate a, ExpressionTemplate b){
return function.apply(a, b);
}
};
}
public int getPriority(){
return priority;
}
public abstract ExpressionTemplate createTemplate(ExpressionTemplate a, ExpressionTemplate b);
}
@@ -0,0 +1,44 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.parsers;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ConstantExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.BooleanToken;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.util.List;
public class BooleanConstantReader extends ValueReader{
@Override
public ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokenList){
if(tokenList.get(0) instanceof BooleanToken){
return ConstantExpressionTemplate.of(((BooleanToken)tokenList.remove(0)).getValue());
}
return null;
}
}
@@ -0,0 +1,133 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.parsers;
import ch.andre601.advancedserverlist.core.profiles.conditions.operators.ListOperator;
import ch.andre601.advancedserverlist.core.profiles.conditions.operators.Operator;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionErrorTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplates;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.List;
public class ExpressionTemplateParser{
private final ImmutableMap<Token, Operator> operators;
private final ImmutableList<ValueReader> valueReaders;
public ExpressionTemplateParser(ImmutableMap<Token, Operator> operators, ImmutableList<ValueReader> valueReaders){
this.operators = operators;
this.valueReaders = valueReaders;
}
public ExpressionTemplate parse(List<Token> tokenList){
List<ExpressionTemplate> parts = new ArrayList<>();
List<Operator> operators = new ArrayList<>();
try{
parts.add(read(tokenList));
}catch(IllegalArgumentException ex){
return ExpressionErrorTemplate.of(ex.getMessage());
}
while(!tokenList.isEmpty()){
Token token = tokenList.remove(0);
Operator operator = this.operators.get(token);
if(operator == null){
return ExpressionErrorTemplate.of("Error while parsing Expression. Got \"" + token + "\" but expected OPERATOR.");
}
operators.add(operator);
if(tokenList.isEmpty()){
return ExpressionErrorTemplate.of("Received unexpected end of input.");
}
try{
parts.add(read(tokenList));
}catch(IllegalArgumentException ex){
return ExpressionErrorTemplate.of(ex.getMessage());
}
}
while(!operators.isEmpty()){
Operator operator = operators.get(0);
int lowest = operator.getPriority();
int start = 0;
int end = 1;
for(int i = 1; i < operators.size(); i++){
operator = operators.get(i);
if(operator.getPriority() < lowest){
lowest = operator.getPriority();
start = i;
end = i + 1;
}else
if(operator.getPriority() > lowest){
break;
}else{
end++;
}
}
operator = operators.get(start);
ExpressionTemplate replacement;
if(start + 1 == end){
replacement = operator.createTemplate(parts.get(start), parts.get(end));
}else
if(operator instanceof ListOperator listOperator){
replacement = listOperator.createTemplate(new ArrayList<>(parts.subList(start, end + 1)));
}else{
List<ExpressionTemplate> conditions = new ArrayList<>(end - start);
for(int i = start; i < end; i++)
conditions.add(operators.get(i).createTemplate(parts.get(i), parts.get(i + 1)));
replacement = ExpressionTemplates.and(conditions);
}
for(int i = start; i < end; i++){
parts.remove(start);
operators.remove(start);
}
parts.set(start, replacement);
}
return parts.get(0);
}
ExpressionTemplate read(List<Token> tokenList){
for(ValueReader valueReader : valueReaders){
ExpressionTemplate template = valueReader.read(this, tokenList);
if(template != null)
return template;
}
throw new IllegalArgumentException("Invalid Expression. Expected literal but got token \"" + tokenList.get(0).toString() + "\"");
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,29 +23,29 @@
*
*/
package ch.andre601.advancedserverlist.spigot.commands;
package ch.andre601.advancedserverlist.core.profiles.conditions.parsers;
import ch.andre601.advancedserverlist.spigot.SpigotCore;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplates;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
public class CmdAdvancedServerList implements CommandExecutor{
import java.util.List;
public class NegatedExpressionReader extends ValueReader{
SpigotCore plugin;
BukkitAudiences bukkitAudiences;
private final Token tokenNegation;
public CmdAdvancedServerList(SpigotCore plugin){
this.plugin = plugin;
bukkitAudiences = BukkitAudiences.create(plugin);
public NegatedExpressionReader(Token tokenNegation){
this.tokenNegation = tokenNegation;
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, @NotNull String[] args){
plugin.getCore().getCommandHandler().handle(new SpigotCmdSender(sender, bukkitAudiences), args);
public ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokenList){
if(tokenList.get(0) == tokenNegation){
tokenList.remove(0);
return ExpressionTemplates.negate(parser.read(tokenList));
}
return true;
return null;
}
}
@@ -0,0 +1,51 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.parsers;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplates;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.util.List;
public class NegatedNumberReader extends ValueReader{
private final Token tokenNegation;
public NegatedNumberReader(Token tokenNegation){
this.tokenNegation = tokenNegation;
}
@Override
public ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokenList){
if(tokenList.get(0) == tokenNegation){
tokenList.remove(0);
return ExpressionTemplates.negateNumber(parser.read(tokenList));
}
return null;
}
}
@@ -0,0 +1,43 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.parsers;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ConstantExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.NumberToken;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.util.List;
public class NumberConstantReader extends ValueReader{
@Override
public ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokenList){
if(tokenList.get(0) instanceof NumberToken){
return ConstantExpressionTemplate.of(((NumberToken)tokenList.remove(0)).getValue());
}
return null;
}
}
@@ -0,0 +1,71 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.parsers;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.util.ArrayList;
import java.util.List;
public class ParenthesisedExpressionReader extends ValueReader{
private final Token openingParenthesis;
private final Token closingParenthesis;
public ParenthesisedExpressionReader(Token openingParenthesis, Token closingParenthesis){
this.openingParenthesis = openingParenthesis;
this.closingParenthesis = closingParenthesis;
}
@Override
public ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokenList){
if(tokenList.get(0) == openingParenthesis){
int index = 0;
int cnt = 1;
do {
index += 1;
if(tokenList.size() <= index)
return null;
Token token = tokenList.get(index);
if(token == openingParenthesis){
cnt++;
}else
if(token == closingParenthesis){
cnt--;
}
}while(cnt != 0);
ExpressionTemplate result = parser.parse(new ArrayList<>(tokenList.subList(1, index)));
tokenList.subList(0, index + 1).clear();
return result;
}
return null;
}
}
@@ -0,0 +1,43 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.parsers;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.PlaceholderToken;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.util.List;
public class PlaceholderReader extends ValueReader{
@Override
public ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokenList){
if(tokenList.get(0) instanceof PlaceholderToken){
PlaceholderToken token = (PlaceholderToken)tokenList.remove(0);
return token.getValue();
}
return null;
}
}
@@ -0,0 +1,44 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.parsers;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ConstantExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.StringToken;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.util.List;
public class StringConstantReader extends ValueReader{
@Override
public ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokenList){
if(tokenList.get(0) instanceof StringToken){
return ConstantExpressionTemplate.of(((StringToken)tokenList.remove(0)).getValue());
}
return null;
}
}
@@ -0,0 +1,36 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.parsers;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.util.List;
public abstract class ValueReader{
public abstract ExpressionTemplate read(ExpressionTemplateParser parser, List<Token> tokenList);
}
@@ -0,0 +1,62 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.placeholders;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToStringExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.templates.ExpressionTemplate;
public interface Placeholder extends ExpressionTemplate{
static LiteralPlaceholderValue of(String value){
return new LiteralPlaceholderValue(value);
}
class LiteralPlaceholderValue implements Placeholder{
private final String value;
public LiteralPlaceholderValue(String value){
this.value = value;
}
@Override
public ToStringExpression instantiateWithStringResult(){
return ToStringExpression.literal(value);
}
@Override
public ToDoubleExpression instantiateWithDoubleResult(){
return ToDoubleExpression.literal(value.length());
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return ToBooleanExpression.literal(Boolean.parseBoolean(value));
}
}
}
@@ -0,0 +1,111 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.placeholders;
import ch.andre601.advancedserverlist.api.AdvancedServerListAPI;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import java.text.ParsePosition;
public class PlaceholderParser{
public static Placeholder parse(String text, ParsePosition position, GenericPlayer player, GenericServer server){
AdvancedServerListAPI api = AdvancedServerListAPI.get();
int index = position.getIndex();
StringBuilder identifier = new StringBuilder();
StringBuilder values = new StringBuilder();
boolean identified = false;
boolean invalid = true;
char[] chars = text.substring(index).toCharArray();
for(final char c : chars){
index++;
if(c == '}'){
invalid = false;
break;
}
if(c == ' ' && !identified){
identified = true;
continue;
}
if(identified){
values.append(c);
}else{
identifier.append(c);
}
}
String identifierStr = identifier.toString();
String valuesStr = values.toString();
StringBuilder raw = new StringBuilder();
position.setIndex(index + 1);
if(invalid){
raw.append("${").append(identifierStr);
if(identified)
raw.append(' ').append(valuesStr);
return Placeholder.of(raw.toString());
}
PlaceholderProvider provider = api.retrievePlaceholderProvider(identifierStr);
if(provider == null){
raw.append("${").append(identifierStr);
if(identified)
raw.append(' ').append(valuesStr);
raw.append('}');
return Placeholder.of(raw.toString());
}
String replacement = provider.parsePlaceholder(valuesStr, player, server);
if(replacement == null){
raw.append("${").append(identifierStr);
if(identified)
raw.append(' ').append(valuesStr);
raw.append('}');
return Placeholder.of(raw.toString());
}
return Placeholder.of(replacement);
}
}
@@ -0,0 +1,40 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.Expression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
public abstract class AbstractBinaryToBooleanExpression<T extends Expression> implements ToBooleanExpression{
protected final T a;
protected final T b;
public AbstractBinaryToBooleanExpression(T a, T b){
this.a = a;
this.b = b;
}
}
@@ -0,0 +1,40 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.Expression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
public abstract class AbstractBinaryToDoubleExpression<T extends Expression> implements ToDoubleExpression{
protected final T a;
protected final T b;
public AbstractBinaryToDoubleExpression(T a, T b){
this.a = a;
this.b = b;
}
}
@@ -0,0 +1,43 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.Conversions;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToStringExpression;
public abstract class AbstractBooleanExpressionTemplate implements ExpressionTemplate{
@Override
public ToStringExpression instantiateWithStringResult(){
return Conversions.toString(instantiateWithBooleanResult());
}
@Override
public ToDoubleExpression instantiateWithDoubleResult(){
return Conversions.toDouble(instantiateWithBooleanResult());
}
}
@@ -0,0 +1,43 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.Conversions;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToStringExpression;
public abstract class AbstractDoubleExpressionTemplate implements ExpressionTemplate{
@Override
public ToStringExpression instantiateWithStringResult(){
return Conversions.toString(instantiateWithDoubleResult());
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Conversions.toBoolean(instantiateWithDoubleResult());
}
}
@@ -0,0 +1,43 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.Conversions;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
public abstract class AbstractStringExpressionTemplate implements ExpressionTemplate{
@Override
public ToDoubleExpression instantiateWithDoubleResult(){
return Conversions.toDouble(instantiateWithStringResult());
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Conversions.toBoolean(instantiateWithStringResult());
}
}
@@ -0,0 +1,40 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.Expression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
import java.util.Collection;
public abstract class AbstractToBooleanExpression<T extends Expression> implements ToBooleanExpression{
protected final Collection<T> operands;
public AbstractToBooleanExpression(Collection<T> operands){
this.operands = operands;
}
}
@@ -0,0 +1,40 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.Expression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
import java.util.Collection;
public abstract class AbstractToDoubleExpression<T extends Expression> implements ToDoubleExpression{
protected final Collection<T> operands;
public AbstractToDoubleExpression(Collection<T> operands){
this.operands = operands;
}
}
@@ -0,0 +1,40 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.Expression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToStringExpression;
import java.util.Collection;
public abstract class AbstractToStringExpression<T extends Expression> implements ToStringExpression{
protected Collection<T> operands;
public AbstractToStringExpression(Collection<T> operands){
this.operands = operands;
}
}
@@ -0,0 +1,38 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.Expression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
public abstract class AbstractUnaryToBooleanExpression<T extends Expression> implements ToBooleanExpression{
protected final T delegate;
public AbstractUnaryToBooleanExpression(T delegate){
this.delegate = delegate;
}
}
@@ -0,0 +1,38 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.Expression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
public abstract class AbstractUnaryToDoubleExpression<T extends Expression> implements ToDoubleExpression{
protected final T delegate;
public AbstractUnaryToDoubleExpression(T delegate){
this.delegate = delegate;
}
}
@@ -0,0 +1,38 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.Expression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToStringExpression;
public abstract class AbstractUnaryToStringExpression<T extends Expression> implements ToStringExpression{
protected final T delegate;
public AbstractUnaryToStringExpression(T delegate){
this.delegate = delegate;
}
}
@@ -0,0 +1,77 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToStringExpression;
public class ConstantExpressionTemplate implements ExpressionTemplate{
private final ToStringExpression stringExpression;
private final ToDoubleExpression doubleExpression;
private final ToBooleanExpression booleanExpression;
private ConstantExpressionTemplate(String stringValue, double doubleValue, boolean booleanValue){
this.stringExpression = ToStringExpression.literal(stringValue);
this.doubleExpression = ToDoubleExpression.literal(doubleValue);
this.booleanExpression = ToBooleanExpression.literal(booleanValue);
}
public static ConstantExpressionTemplate of(String stringValue){
double doubleValue;
try{
doubleValue = Double.parseDouble(stringValue);
}catch(NumberFormatException ex){
doubleValue = stringValue.length();
}
return new ConstantExpressionTemplate(stringValue, doubleValue, Boolean.parseBoolean(stringValue));
}
public static ConstantExpressionTemplate of(double doubleValue){
return new ConstantExpressionTemplate(((int)doubleValue) == doubleValue ? Integer.toString((int)doubleValue) : Double.toString(doubleValue), doubleValue, doubleValue != 0);
}
public static ConstantExpressionTemplate of(boolean booleanValue){
return new ConstantExpressionTemplate(Boolean.toString(booleanValue), booleanValue ? 1 : 0, booleanValue);
}
@Override
public ToStringExpression instantiateWithStringResult(){
return stringExpression;
}
@Override
public ToDoubleExpression instantiateWithDoubleResult(){
return doubleExpression;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return booleanExpression;
}
}
@@ -0,0 +1,58 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToStringExpression;
public class ExpressionErrorTemplate implements ExpressionTemplate{
private final String msg;
private ExpressionErrorTemplate(String msg){
this.msg = msg;
}
public static ExpressionErrorTemplate of(String msg){
return new ExpressionErrorTemplate(msg);
}
@Override
public ToStringExpression instantiateWithStringResult(){
return ToStringExpression.literal(msg);
}
@Override
public ToDoubleExpression instantiateWithDoubleResult(){
return ToDoubleExpression.literal(0);
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return ToBooleanExpression.literal(false);
}
}
@@ -0,0 +1,39 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToStringExpression;
public interface ExpressionTemplate{
ToStringExpression instantiateWithStringResult();
ToDoubleExpression instantiateWithDoubleResult();
ToBooleanExpression instantiateWithBooleanResult();
}
@@ -0,0 +1,422 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.templates;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.Expressions;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToBooleanExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToDoubleExpression;
import ch.andre601.advancedserverlist.core.profiles.conditions.expressions.ToStringExpression;
import java.util.Collection;
public class ExpressionTemplates{
public static ExpressionTemplate negate(ExpressionTemplate template){
return new Negation(template);
}
public static ExpressionTemplate and(Collection<ExpressionTemplate> operands){
return new And(operands);
}
public static ExpressionTemplate or(Collection<ExpressionTemplate> operands){
return new Or(operands);
}
public static ExpressionTemplate concat(Collection<ExpressionTemplate> operands){
return new Concatenate(operands);
}
public static ExpressionTemplate equal(ExpressionTemplate a, ExpressionTemplate b){
return new Equal(a, b);
}
public static ExpressionTemplate notEqual(ExpressionTemplate a, ExpressionTemplate b){
return new NotEqual(a, b);
}
public static ExpressionTemplate equalIgnoreCase(ExpressionTemplate a, ExpressionTemplate b){
return new EqualIgnoreCase(a, b);
}
public static ExpressionTemplate notEqualIgnoreCase(ExpressionTemplate a, ExpressionTemplate b){
return new NotEqualIgnoreCase(a, b);
}
public static ExpressionTemplate startsWith(ExpressionTemplate a, ExpressionTemplate b){
return new StartsWith(a, b);
}
public static ExpressionTemplate endsWith(ExpressionTemplate a, ExpressionTemplate b){
return new EndsWith(a, b);
}
public static ExpressionTemplate contains(ExpressionTemplate a, ExpressionTemplate b){
return new Contains(a, b);
}
public static ExpressionTemplate greater(ExpressionTemplate a, ExpressionTemplate b){
return new Greater(a, b);
}
public static ExpressionTemplate greaterOrEqual(ExpressionTemplate a, ExpressionTemplate b){
return new GreaterOrEqual(a, b);
}
public static ExpressionTemplate less(ExpressionTemplate a, ExpressionTemplate b){
return new Less(a, b);
}
public static ExpressionTemplate lessOrEqual(ExpressionTemplate a, ExpressionTemplate b){
return new LessOrEqual(a, b);
}
public static ExpressionTemplate sum(Collection<ExpressionTemplate> operands){
return new Sum(operands);
}
public static ExpressionTemplate product(Collection<ExpressionTemplate> operands){
return new Product(operands);
}
public static ExpressionTemplate sub(ExpressionTemplate a, ExpressionTemplate b){
return new Sub(a, b);
}
public static ExpressionTemplate div(ExpressionTemplate a, ExpressionTemplate b){
return new Div(a, b);
}
public static ExpressionTemplate negateNumber(ExpressionTemplate template){
return new NegationNumber(template);
}
private static class Negation extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate template;
Negation(ExpressionTemplate template){
this.template = template;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.negate(template.instantiateWithBooleanResult());
}
}
private static class And extends AbstractBooleanExpressionTemplate{
private final Collection<ExpressionTemplate> operands;
And(Collection<ExpressionTemplate> operands){
this.operands = operands;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.and(operands.stream().map(ExpressionTemplate::instantiateWithBooleanResult).toList());
}
}
private static class Or extends AbstractBooleanExpressionTemplate{
private final Collection<ExpressionTemplate> operands;
Or(Collection<ExpressionTemplate> operands){
this.operands = operands;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.or(operands.stream().map(ExpressionTemplate::instantiateWithBooleanResult).toList());
}
}
private static class Concatenate extends AbstractStringExpressionTemplate{
private final Collection<ExpressionTemplate> operands;
Concatenate(Collection<ExpressionTemplate> operands){
this.operands = operands;
}
@Override
public ToStringExpression instantiateWithStringResult(){
return Expressions.concat(operands.stream().map(ExpressionTemplate::instantiateWithStringResult).toList());
}
}
private static class Equal extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
Equal(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.equal(a.instantiateWithStringResult(), b.instantiateWithStringResult());
}
}
private static class NotEqual extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
NotEqual(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.notEqual(a.instantiateWithStringResult(), b.instantiateWithStringResult());
}
}
private static class EqualIgnoreCase extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
EqualIgnoreCase(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.equalIgnoreCase(a.instantiateWithStringResult(), b.instantiateWithStringResult());
}
}
private static class NotEqualIgnoreCase extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
NotEqualIgnoreCase(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.notEqualIgnoreCase(a.instantiateWithStringResult(), b.instantiateWithStringResult());
}
}
private static class StartsWith extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
private StartsWith(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.startsWith(a.instantiateWithStringResult(), b.instantiateWithStringResult());
}
}
private static class EndsWith extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
private EndsWith(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.endsWith(a.instantiateWithStringResult(), b.instantiateWithStringResult());
}
}
private static class Contains extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
private Contains(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.contains(a.instantiateWithStringResult(), b.instantiateWithStringResult());
}
}
private static class Greater extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
Greater(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.greaterThan(a.instantiateWithDoubleResult(), b.instantiateWithDoubleResult());
}
}
private static class GreaterOrEqual extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
GreaterOrEqual(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.greaterOrEqualThan(a.instantiateWithDoubleResult(), b.instantiateWithDoubleResult());
}
}
private static class Less extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
Less(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.lessThan(a.instantiateWithDoubleResult(), b.instantiateWithDoubleResult());
}
}
private static class LessOrEqual extends AbstractBooleanExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
LessOrEqual(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToBooleanExpression instantiateWithBooleanResult(){
return Expressions.lessOrEqualThan(a.instantiateWithDoubleResult(), b.instantiateWithDoubleResult());
}
}
private static class Sum extends AbstractDoubleExpressionTemplate{
private final Collection<ExpressionTemplate> operands;
Sum(Collection<ExpressionTemplate> operands){
this.operands = operands;
}
@Override
public ToDoubleExpression instantiateWithDoubleResult(){
return Expressions.sum(operands.stream().map(ExpressionTemplate::instantiateWithDoubleResult).toList());
}
}
private static class Product extends AbstractDoubleExpressionTemplate{
private final Collection<ExpressionTemplate> operands;
Product(Collection<ExpressionTemplate> operands){
this.operands = operands;
}
@Override
public ToDoubleExpression instantiateWithDoubleResult(){
return Expressions.product(operands.stream().map(ExpressionTemplate::instantiateWithDoubleResult).toList());
}
}
private static class Sub extends AbstractDoubleExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
Sub(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToDoubleExpression instantiateWithDoubleResult(){
return Expressions.sub(a.instantiateWithDoubleResult(), b.instantiateWithDoubleResult());
}
}
private static class Div extends AbstractDoubleExpressionTemplate{
private final ExpressionTemplate a;
private final ExpressionTemplate b;
Div(ExpressionTemplate a, ExpressionTemplate b){
this.a = a;
this.b = b;
}
@Override
public ToDoubleExpression instantiateWithDoubleResult(){
return Expressions.div(a.instantiateWithDoubleResult(), b.instantiateWithDoubleResult());
}
}
private static class NegationNumber extends AbstractDoubleExpressionTemplate{
private final ExpressionTemplate template;
NegationNumber(ExpressionTemplate template){
this.template = template;
}
@Override
public ToDoubleExpression instantiateWithDoubleResult(){
return Expressions.negateNumber(template.instantiateWithDoubleResult());
}
}
}
@@ -0,0 +1,42 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens;
public class BooleanToken extends Token{
public static final BooleanToken TRUE = new BooleanToken(true);
public static final BooleanToken FALSE = new BooleanToken(false);
private final boolean value;
public BooleanToken(boolean value){
super("BOOLEAN(" + value + ")");
this.value = value;
}
public boolean getValue(){
return value;
}
}
@@ -0,0 +1,50 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens;
public class DefaultTokens{
public static final Token AND = new Token("AND");
public static final Token OR = new Token("OR");
public static final Token OPENING_PARENTHESIS = new Token("OPENING_PARENTHESIS");
public static final Token CLOSING_PARENTHESIS = new Token("CLOSING_PARENTHESIS");
public static final Token EQUAL = new Token("EQUAL");
public static final Token NOT_EQUAL = new Token("NOT_EQUAL");
public static final Token EQUAL_IGNORE_CASE = new Token("EQUAL_IGNORE_CASE");
public static final Token NOT_EQUAL_IGNORE_CASE = new Token("NOT_EQUAL_IGNORE_CASE");
public static final Token STARTS_WITH = new Token("STARTS_WITH");
public static final Token ENDS_WITH = new Token("ENDS_WITH");
public static final Token CONTAINS = new Token("CONTAINS");
public static final Token NEGATION = new Token("NEGATION");
public static final Token GREATER_THAN = new Token("GREATER_THAN");
public static final Token GREATER_OR_EQUAL_THAN = new Token("GREATER_OR_EQUAL_THAN");
public static final Token LESSER_THAN = new Token("LESSER_THAN");
public static final Token LESSER_OR_EQUAL_THAN = new Token("LESSER_OR_EQUAL_THAN");
public static final Token CONCAT_STRING = new Token("CONCAT_STRING");
public static final Token ADD = new Token("ADD");
public static final Token SUB = new Token("SUB");
public static final Token MULT = new Token("MULT");
public static final Token DIV = new Token("DIV");
}
@@ -0,0 +1,40 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens;
public class NumberToken extends Token{
private final double value;
public NumberToken(double value){
super("NUMBER(" + value + ")");
this.value = value;
}
public double getValue(){
return value;
}
}
@@ -0,0 +1,42 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens;
import ch.andre601.advancedserverlist.core.profiles.conditions.placeholders.Placeholder;
public class PlaceholderToken extends Token{
private final Placeholder value;
public PlaceholderToken(Placeholder value){
super("PLACEHOLDER");
this.value = value;
}
public Placeholder getValue(){
return value;
}
}
@@ -0,0 +1,40 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens;
public class StringToken extends Token{
private final String value;
public StringToken(String value){
super("STRING(" + value + ")");
this.value = value;
}
public String getValue(){
return value;
}
}
@@ -0,0 +1,40 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens;
public class Token{
private final String id;
public Token(String id){
this.id = id;
}
@Override
public String toString(){
return id;
}
}
@@ -0,0 +1,53 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens.readers;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.StringToken;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.text.ParsePosition;
public class NonQuotedLiteralTokenReader extends TokenReader{
public NonQuotedLiteralTokenReader(int priority){
super(priority);
}
@Override
public Token read(String text, ParsePosition position, GenericPlayer player, GenericServer server){
int startIndex = position.getIndex();
int index = position.getIndex();
while(++index < text.length() && !Character.isWhitespace(text.charAt(index)))
;
position.setIndex(index);
return new StringToken(text.substring(startIndex, position.getIndex()));
}
}
@@ -0,0 +1,55 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens.readers;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.NumberToken;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.text.NumberFormat;
import java.text.ParsePosition;
import java.util.Locale;
public class NumberTokenReader extends TokenReader{
private final NumberFormat format = NumberFormat.getInstance(Locale.ROOT);
public NumberTokenReader(int priority){
super(priority);
}
@Override
public Token read(String text, ParsePosition position, GenericPlayer player, GenericServer server){
int previous = position.getIndex();
Number number = format.parse(text, position);
if(position.getIndex() != previous)
return new NumberToken(number.doubleValue());
return null;
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,34 +23,39 @@
*
*/
package ch.andre601.advancedserverlist.spigot.objects;
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens.readers;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
public class SpigotPlayerPlaceholders extends PlaceholderProvider{
import java.text.ParsePosition;
public class PatternTokenReader extends TokenReader{
public SpigotPlayerPlaceholders(){
super("player");
private final Token token;
private final String pattern;
private final boolean ignoreCase;
public PatternTokenReader(Token token, String pattern){
this(token, pattern, true);
}
public PatternTokenReader(Token token, String pattern, boolean ignoreCase){
super(pattern.length());
this.token = token;
this.pattern = pattern;
this.ignoreCase = ignoreCase;
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server){
SpigotPlayer spigotPlayer = (SpigotPlayer)player;
public Token read(String text, ParsePosition position, GenericPlayer player, GenericServer server){
if(text.regionMatches(ignoreCase, position.getIndex(), pattern, 0, pattern.length())){
position.setIndex(position.getIndex() + pattern.length());
return token;
}
return switch(placeholder){
case "name" -> spigotPlayer.getName();
case "protocol" -> String.valueOf(spigotPlayer.getProtocol());
case "uuid" -> String.valueOf(spigotPlayer.getUUID());
case "hasPlayedBefore" -> returnValue(spigotPlayer, spigotPlayer.hasPlayedBefore());
case "isBanned" -> returnValue(spigotPlayer, spigotPlayer.isBanned());
case "isWhitelisted" -> returnValue(spigotPlayer, spigotPlayer.isWhitelisted());
default -> null;
};
}
private String returnValue(SpigotPlayer player, Object value){
return player.getPlayer() == null ? null : String.valueOf(value);
return null;
}
}
@@ -0,0 +1,50 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens.readers;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.core.profiles.conditions.placeholders.PlaceholderParser;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.PlaceholderToken;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.text.ParsePosition;
public class PlaceholderTokenReader extends TokenReader{
public PlaceholderTokenReader(int priority){
super(priority);
}
@Override
public Token read(String text, ParsePosition position, GenericPlayer player, GenericServer server){
if(position.getIndex() + 1 < text.length() && text.charAt(position.getIndex()) == '$' && text.charAt(position.getIndex() + 1) == '{'){
position.setIndex(position.getIndex() + 2);
return new PlaceholderToken(PlaceholderParser.parse(text, position, player, server));
}
return null;
}
}
@@ -0,0 +1,62 @@
/*
* MIT License
*
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens.readers;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.StringToken;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
import java.text.ParsePosition;
public class QuotedLiteralTokenReader extends TokenReader{
private final char quote;
public QuotedLiteralTokenReader(int priority, char quote){
super(priority);
this.quote = quote;
}
@Override
public Token read(String text, ParsePosition position, GenericPlayer player, GenericServer server){
if(position.getIndex() < text.length() && text.charAt(position.getIndex()) == quote){
int startIndex = position.getIndex();
position.setIndex(position.getIndex() + 1);
while(position.getIndex() < text.length() && quote != text.charAt(position.getIndex()))
position.setIndex(position.getIndex() + 1);
position.setIndex(position.getIndex() + 1);
return new StringToken(text.substring(startIndex + 1, position.getIndex() - 1));
}
return null;
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
* Copyright (c) 2022-2024 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,25 +23,25 @@
*
*/
package ch.andre601.advancedserverlist.core.objects;
package ch.andre601.advancedserverlist.core.profiles.conditions.tokens.readers;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.core.profiles.conditions.tokens.Token;
public class ServerPlaceholders extends PlaceholderProvider{
import java.text.ParsePosition;
public abstract class TokenReader{
public ServerPlaceholders(){
super("server");
private final int priority;
public TokenReader(int priority){
this.priority = priority;
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer genericPlayer, GenericServer genericServer){
return switch(placeholder){
case "playersOnline" -> String.valueOf(genericServer.getPlayersOnline());
case "playersMax" -> String.valueOf(genericServer.getPlayersMax());
case "host" -> genericServer.getHost();
default -> null;
};
public int getPriority(){
return priority;
}
public abstract Token read(String text, ParsePosition position, GenericPlayer player, GenericServer server);
}
@@ -26,8 +26,8 @@
package ch.andre601.advancedserverlist.core.profiles.favicon;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import javax.imageio.ImageIO;
import java.awt.*;
@@ -39,42 +39,65 @@ import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
import java.util.function.Function;
public class FaviconHandler<F>{
private final Cache<String, F> favicons = Caffeine.newBuilder()
private final Cache<String, CompletableFuture<F>> favicons = CacheBuilder.newBuilder()
.expireAfterWrite(5, TimeUnit.MINUTES)
.build();
private final AdvancedServerList core;
private final AdvancedServerList<F> core;
private final ThreadPoolExecutor faviconThreadPool;
public FaviconHandler(AdvancedServerList core){
public FaviconHandler(AdvancedServerList<F> core){
this.core = core;
this.faviconThreadPool = createFaviconThreadPool();
}
public F getFavicon(String input, Function<BufferedImage, F> function){
return favicons.get(input, k -> {
BufferedImage image = resolveImage(core, input);
if(image == null)
return null;
return function.apply(image);
});
try{
return favicons.get(input, () -> convert(input, function)).getNow(null);
}catch(ExecutionException e){
return null;
}
}
public void clearCache(){
favicons.invalidateAll();
}
private BufferedImage resolveImage(AdvancedServerList core, String input){
private CompletableFuture<F> convert(String input, Function<BufferedImage, F> function){
return CompletableFuture.supplyAsync(() -> {
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "Getting BufferedImage for input '%s'...", input);
BufferedImage img = resolveImage(core, input);
if(img == null){
core.getPlugin().getPluginLogger().debugWarn(FaviconHandler.class, "No BufferedImage could be created!");
return null;
}
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "Received BufferedImage! Applying it...");
return function.apply(img);
}, faviconThreadPool);
}
private BufferedImage resolveImage(AdvancedServerList<F> core, String input){
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "Resolving favicon for input '%s'...", input);
InputStream stream;
if(input.toLowerCase(Locale.ROOT).startsWith("https://")){
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "URL detected. Getting file from it...");
stream = getFromUrl(core, input);
}else
if(input.toLowerCase(Locale.ROOT).endsWith(".png")){
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "Image file detected. Trying to reolve it...");
File folder = core.getPlugin().getFolderPath().resolve("favicons").toFile();
if(!folder.exists()){
core.getPlugin().getPluginLogger().warn("Cannot get Favicon %s from favicons folder. Folder doesn't exist!", input);
@@ -85,12 +108,16 @@ public class FaviconHandler<F>{
try{
stream = new FileInputStream(file);
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "Resolved image file!");
}catch(IOException ex){
core.getPlugin().getPluginLogger().warn("Cannot create Favicon from File %s.", input);
core.getPlugin().getPluginLogger().warn("Cause: %s", ex.getMessage());
return null;
}
}else{
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "Possible player name/UUID detected. Using https://mc-heads.net/avatar/%s/64...", input);
stream = getFromUrl(core, "https://mc-heads.net/avatar/" + input + "/64");
}
@@ -106,6 +133,8 @@ public class FaviconHandler<F>{
return null;
}
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "Resizing image to 64x64 pixels...");
BufferedImage favicon = new BufferedImage(64, 64, BufferedImage.TYPE_INT_ARGB);
Graphics2D img = favicon.createGraphics();
@@ -113,6 +142,7 @@ public class FaviconHandler<F>{
img.drawImage(original, 0, 0, 64, 64, null);
img.dispose();
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "Image resized!");
return favicon;
}catch(IOException ex){
core.getPlugin().getPluginLogger().warn("Unable to create Favicon. Encountered IOException during creation.");
@@ -121,13 +151,16 @@ public class FaviconHandler<F>{
}
}
private InputStream getFromUrl(AdvancedServerList core, String url){
private InputStream getFromUrl(AdvancedServerList<F> core, String url){
try{
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "Resolving URL '%s'...", url);
URL faviconUrl = new URL(url);
URLConnection connection = faviconUrl.openConnection();
connection.setRequestProperty("User-Agent", "AdvancedServerList/" + core.getVersion());
connection.connect();
core.getPlugin().getPluginLogger().debug(FaviconHandler.class, "URL resolved!");
return connection.getInputStream();
}catch(IOException ex){
core.getPlugin().getPluginLogger().warn("Error while connecting to %s for Favicon creation.", url);
@@ -135,4 +168,12 @@ public class FaviconHandler<F>{
return null;
}
}
private ThreadPoolExecutor createFaviconThreadPool(){
return new ThreadPoolExecutor(3, 3, 60L, TimeUnit.SECONDS, new LinkedBlockingDeque<>(1024), r -> {
Thread t = new Thread(r, "AdvancedServerList-FaviconThread");
t.setDaemon(true);
return t;
});
}
}
@@ -31,33 +31,31 @@ import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import com.google.gson.Gson;
import io.leangen.geantyref.TypeToken;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.Reader;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.*;
public class PlayerHandler{
private final AdvancedServerList core;
private final AdvancedServerList<?> core;
private final PluginLogger logger;
private final Path cache;
private List<CachedPlayer> cachedPlayers = new ArrayList<>();
private final Type listType = new TypeToken<ArrayList<CachedPlayer>>(){}.getType();
private final Gson gson = new Gson();
// UUID of MHF_Question
private final String defaultUUID = "606e2ff0-ed77-4842-9d6c-e1d3321c7838";
private final UUID defaultUUID = UUID.fromString("606e2ff0-ed77-4842-9d6c-e1d3321c7838");
private List<CachedPlayer> cachedPlayers = new ArrayList<>();
private CachedPlayer defaultPlayer = null;
public PlayerHandler(AdvancedServerList core){
public PlayerHandler(AdvancedServerList<?> core){
this.core = core;
this.logger = core.getPlugin().getPluginLogger();
this.cache = core.getPlugin().getFolderPath().resolve("playercache.json");
@@ -69,13 +67,13 @@ public class PlayerHandler{
return;
}
if(core.getFileHandler().getBoolean("disable_cache")){
if(core.getFileHandler().getBoolean("disableCache")){
logger.info("'disable_cache' is set to true. Skipping playercache.json loading...");
return;
}
try{
Reader reader = Files.newBufferedReader(cache);
BufferedReader reader = Files.newBufferedReader(cache);
cachedPlayers = gson.fromJson(reader, listType);
@@ -85,6 +83,14 @@ public class PlayerHandler{
return;
}
// In case Gson messes up... I guess.
if(cachedPlayers == null){
logger.warn("Couldn't load players from playercache.json file. Is the JSON valid?");
// Create new ArrayList instance to avoid further issues.
cachedPlayers = new ArrayList<>();
return;
}
logger.info("Loaded %d players into cache!", cachedPlayers.size());
}
@@ -94,7 +100,7 @@ public class PlayerHandler{
return;
}
if(core.getFileHandler().getBoolean("disable_cache")){
if(core.getFileHandler().getBoolean("disableCache")){
logger.info("'disable_cache' is set to true. Skipping saving of cached players...");
return;
}
@@ -110,14 +116,14 @@ public class PlayerHandler{
}
public void addPlayer(String ip, String name, UUID uuid){
if(contains(ip) || core.getFileHandler().getBoolean("disable_cache"))
if(contains(ip) || core.getFileHandler().getBoolean("disableCache"))
return;
cachedPlayers.add(new CachedPlayer(ip, name, uuid));
}
public CachedPlayer getCachedPlayer(String key){
if(!contains(key) || core.getFileHandler().getBoolean("disable_cache"))
if(!contains(key) || core.getFileHandler().getBoolean("disableCache"))
return getDefaultPlayer();
for(CachedPlayer player : cachedPlayers){
@@ -128,6 +134,20 @@ public class PlayerHandler{
return getDefaultPlayer();
}
public CachedPlayer getCachedPlayer(UUID uuid){
for(CachedPlayer player : cachedPlayers){
if(player.getUuid().equals(uuid))
return player;
}
return getDefaultPlayer();
}
public void clearCache(){
cachedPlayers.clear();
defaultPlayer = null;
}
private boolean contains(String ip){
for(CachedPlayer player : cachedPlayers){
if(player.getIp().equals(ip))
@@ -143,8 +163,8 @@ public class PlayerHandler{
return (defaultPlayer = new CachedPlayer(
"0.0.0.0",
core.getFileHandler().getString("Anonymous", "unknown_player"),
convertToUUID(core.getFileHandler().getString(defaultUUID, "unknown_player_uuid"))
core.getFileHandler().getString("Anonymous", "unknownPlayer", "name"),
convertToUUID(core.getFileHandler().getString(defaultUUID.toString(), "unknownPlayer", "uuid"))
));
}
@@ -153,7 +173,7 @@ public class PlayerHandler{
return UUID.fromString(uuid);
}catch(IllegalArgumentException ex){
// This is always a valid UUID.
return UUID.fromString(defaultUUID);
return defaultUUID;
}
}
@@ -53,18 +53,21 @@ public class ProfileManager{
String favicon = resolveFavicon(entry, defEntry);
boolean isHidePlayersEnabled = resolveHidePlayersEnabled(entry, defEntry);
boolean isExtraPlayersEnabled = resolveExtraPlayersEnabled(entry, defEntry);
boolean isMaxPlayersEnabled = resolveMaxPlayersEnabled(entry, defEntry);
Integer extraPlayersCount = resolveExtraPlayersCount(entry, defEntry);
Integer maxPlayersCount = resolveMaxPlayersCount(entry, defEntry);
return new ProfileEntry(motd, players, playerCountText, favicon,
NullBool.resolve(isHidePlayersEnabled), NullBool.resolve(isExtraPlayersEnabled), extraPlayersCount);
NullBool.resolve(isHidePlayersEnabled), NullBool.resolve(isExtraPlayersEnabled), NullBool.resolve(isMaxPlayersEnabled),
extraPlayersCount, maxPlayersCount);
}
public static ServerListProfile resolveProfile(AdvancedServerList core, GenericPlayer player, GenericServer server){
public static ServerListProfile resolveProfile(AdvancedServerList<?> core, GenericPlayer player, GenericServer server){
for(ServerListProfile profile : core.getFileHandler().getProfiles()){
if(profile.isInvalidProfile())
continue;
if(profile.evalConditions(player, server))
if(profile.evalConditions(core.getExpressionEngine(), core.getPlugin().getPluginLogger(), player, server))
return profile;
}
@@ -78,7 +81,9 @@ public class ProfileManager{
String favicon = node.node("favicon").getString("");
NullBool hidePlayers = resolveNullBool(node, "playerCount", "hidePlayers");
NullBool extraPlayersEnabled = resolveNullBool(node, "playerCount", "extraPlayers", "enabled");
Integer extraPlayers = resolveNullableInt(node);
NullBool maxPlayersEnabled = resolveNullBool(node, "playerCount", "maxPlayers", "enabled");
Integer extraPlayers = resolveNullableInt(node, "playerCount", "extraPlayers", "amount");
Integer maxPlayers = resolveNullableInt(node, "playerCount", "maxPlayers", "amount");
return new ProfileEntry.Builder()
.setMotd(motd)
@@ -87,7 +92,9 @@ public class ProfileManager{
.setFavicon(favicon)
.setHidePlayersEnabled(hidePlayers)
.setExtraPlayersEnabled(extraPlayersEnabled)
.setExtraPlayerCount(extraPlayers)
.setMaxPlayersEnabled(maxPlayersEnabled)
.setExtraPlayersCount(extraPlayers)
.setMaxPlayersCount(maxPlayers)
.build();
}
@@ -99,7 +106,7 @@ public class ProfileManager{
return !list.isEmpty(); // Check if list isn't empty
}else
if(obj instanceof String str){
return !str.isEmpty(); // Check if list is not empty
return !str.isEmpty(); // Check if String is not empty
}else
if(obj instanceof NullBool nb){
return nb.getOrDefault(false); // Return NullBool's value
@@ -109,52 +116,66 @@ public class ProfileManager{
}
private static List<String> resolveMOTD(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.getMotd()))
return defaultProfile.getMotd();
if(profile == null || !checkOption(profile.motd()))
return defaultProfile.motd();
return profile.getMotd();
return profile.motd();
}
private static List<String> resolvePlayers(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.getPlayers()))
return defaultProfile.getPlayers();
if(profile == null || !checkOption(profile.players()))
return defaultProfile.players();
return profile.getPlayers();
return profile.players();
}
private static String resolvePlayerCountText(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.getPlayerCountText()))
return defaultProfile.getPlayerCountText();
if(profile == null || !checkOption(profile.playerCountText()))
return defaultProfile.playerCountText();
return profile.getPlayerCountText();
return profile.playerCountText();
}
private static String resolveFavicon(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.getFavicon()))
return defaultProfile.getFavicon();
if(profile == null || !checkOption(profile.favicon()))
return defaultProfile.favicon();
return profile.getFavicon();
return profile.favicon();
}
private static boolean resolveHidePlayersEnabled(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.isHidePlayersEnabled()))
return defaultProfile.isHidePlayersEnabled().getOrDefault(false);
if(profile == null || !checkOption(profile.hidePlayersEnabled()))
return defaultProfile.hidePlayersEnabled().getOrDefault(false);
return profile.isHidePlayersEnabled().getOrDefault(false);
return profile.hidePlayersEnabled().getOrDefault(false);
}
private static boolean resolveExtraPlayersEnabled(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.isExtraPlayersEnabled()))
return defaultProfile.isExtraPlayersEnabled().getOrDefault(false);
if(profile == null || !checkOption(profile.extraPlayersEnabled()))
return defaultProfile.extraPlayersEnabled().getOrDefault(false);
return profile.isExtraPlayersEnabled().getOrDefault(false);
return profile.extraPlayersEnabled().getOrDefault(false);
}
private static boolean resolveMaxPlayersEnabled(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.maxPlayersEnabled()))
return defaultProfile.maxPlayersEnabled().getOrDefault(false);
return profile.maxPlayersEnabled().getOrDefault(false);
}
private static Integer resolveExtraPlayersCount(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || profile.getExtraPlayersCount() == null)
return defaultProfile.getExtraPlayersCount() == null ? 0 : defaultProfile.getExtraPlayersCount();
if(profile == null || profile.extraPlayersCount() == null)
return defaultProfile.extraPlayersCount() == null ? 0 : defaultProfile.extraPlayersCount();
return profile.getExtraPlayersCount();
return profile.extraPlayersCount();
}
private static Integer resolveMaxPlayersCount(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || profile.maxPlayersCount() == null)
return defaultProfile.maxPlayersCount() == null ? 0 : defaultProfile.maxPlayersCount();
return profile.maxPlayersCount();
}
private static List<String> resolveList(ConfigurationNode node, Object... path){
@@ -172,10 +193,10 @@ public class ProfileManager{
return NullBool.resolve(node.node(path).getBoolean());
}
private static Integer resolveNullableInt(ConfigurationNode node){
if(node.node("playerCount", "extraPlayers", "amount").virtual())
private static Integer resolveNullableInt(ConfigurationNode node, Object... path){
if(node.node(path).virtual())
return null;
return node.node("playerCount", "extraPlayers", "amount").getInt();
return node.node(path).getInt();
}
}
@@ -48,12 +48,14 @@ public class ProfileSerializer implements TypeSerializer<ProfileEntry>{
return;
}
node.node("motd").set(profile.getMotd());
node.node("playerCount", "hover").set(profile.getPlayers());
node.node("playerCount", "text").set(profile.getPlayerCountText());
node.node("favicon").set(profile.getFavicon());
node.node("playerCount", "hidePlayers").set(profile.isHidePlayersEnabled());
node.node("playerCount", "extraPlayers", "enabled").set(profile.isExtraPlayersEnabled());
node.node("playerCount", "extraPlayers", "amount").set(profile.getExtraPlayersCount());
node.node("motd").set(profile.motd());
node.node("playerCount", "hover").set(profile.players());
node.node("playerCount", "text").set(profile.playerCountText());
node.node("favicon").set(profile.favicon());
node.node("playerCount", "hidePlayers").set(profile.hidePlayersEnabled().getOrDefault(false));
node.node("playerCount", "extraPlayers", "enabled").set(profile.extraPlayersEnabled().getOrDefault(false));
node.node("playerCount", "extraPlayers", "amount").set((profile.extraPlayersCount() == null) ? 0 : profile.extraPlayersCount());
node.node("playerCount", "maxPlayers", "enabled").set(profile.maxPlayersEnabled().getOrDefault(false));
node.node("playerCount", "maxPlayers", "amount").set((profile.maxPlayersCount() == null) ? 0 : profile.maxPlayersCount());
}
}
+32 -15
View File
@@ -1,27 +1,25 @@
#
# Used for when AdvancedServerList doesn't have a cached player to use for ${player name}
# Used for when AdvancedServerList doesn't have a cached player to use for player placeholders.
#
# Defaults to 'Anonymous' when not present.
#
unknown_player: "Anonymous"
#
# UUID used for when AdvancedServerList doesn't have a cached player to use for the ${player uuid}
# placeholder.
#
# Defaults to the UUID of MHF_Question (606e2ff0-ed77-4842-9d6c-e1d3321c7838) when not present.
#
unknown_player_uuid: "606e2ff0-ed77-4842-9d6c-e1d3321c7838"
unknownPlayer:
#
# The name to use. Defaults to Anonymous.
#
name: "Anonymous"
#
# The UUID to use. Defaults to 606e2ff0-ed77-4842-9d6c-e1d3321c7838 (UUID of MHF_Question).
#
uuid: "606e2ff0-ed77-4842-9d6c-e1d3321c7838"
#
# Should the Caching of players be disabled?
#
# When set to true will AdvancedServerList not load any players from the cache.data file (if present) nor save any to it.
# Placeholders that rely on the player being cached (such as ${player isWhitelisted}) will not work while this option is enabled.
# Placeholders that rely on the player being cached (such as ${player name}) will not work while this option is enabled.
#
# Defaults to false when not present.
#
disable_cache: false
disableCache: false
#
# Should AdvancedServerList check for new versions?
@@ -31,4 +29,23 @@ disable_cache: false
#
# Defaults to false when not present.
#
check_updates: true
checkUpdates: true
#
# Should debug mode be enabled?
#
# When set to true will AdvancedServerList print additional messages to the console prefixed with "[DEBUG]".
# It is recommended to only enable this when having problems or when being told to by the plugin dev, as it could
# otherwise cause significant spam in your console.
#
# Defaults to false when not present.
#
debug: false
#
# DO NOT EDIT!
#
# This is used internally to determine if the config needs to be migrated.
# Changing or even removing this option could result in your config being broken.
#
config-version: ${plugin.config.version}
+51 -13
View File
@@ -2,15 +2,24 @@
# Set the priority of this profile.
# Higher number = Higher priority.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#priority
# Read more: https://asl.andre601.ch/profiles/#priority
#
priority: 0
#
# Set conditions that need to me met to show this profile.
# You can use keywords 'and' or 'or' (Or alternatively '&&' or `||`) to make more complex condition sets.
#
# Read more: https://asl.andre601.ch/profiles/#condition
#
# condition: '${player protocol} < 759'
#
#
# Set conditions that needs to be met.
# Only when all conditions return true will the profile be shown (Given no profile with higher priority is used).
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#conditions
# Read more: https://asl.andre601.ch/profiles/#conditions
#
#conditions:
# - '{playerVersion} < 759'
@@ -25,7 +34,7 @@ priority: 0
#
# Remove this option or set it to profiles: [] to use the global options of this file.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#profiles
# Read more: https://asl.andre601.ch/profiles/#profiles
#
#profiles:
# - motd:
@@ -49,7 +58,7 @@ priority: 0
#
# Remove this option or set it to motd: [] to not alter the MOTD.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#motds
# Read more: https://asl.andre601.ch/profiles/#motd
#
motd:
- '<grey>Line 1'
@@ -64,14 +73,14 @@ motd:
#
# Remove this option or set to favicon: '' to not replace the Favicon.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#favicon
# Read more: https://asl.andre601.ch/profiles/#favicon
#
favicon: ''
#
# Contains various options to manipulate the player count (Text displaying online and max players allowed).
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#playercount
# Read more: https://asl.andre601.ch/profiles/#playercount
#
playerCount:
#
@@ -82,7 +91,7 @@ playerCount:
#
# Defaults to false when not present.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#hideplayers
# Read more: https://asl.andre601.ch/profiles/#hideplayers
#
hidePlayers: false
#
@@ -90,7 +99,7 @@ playerCount:
#
# Remove this option or set it to hover: [] to not modify the player samples on the player count.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#hover
# Read more: https://asl.andre601.ch/profiles/#hover
#
hover:
- '<grey>Line 1'
@@ -104,24 +113,24 @@ playerCount:
#
# Remove this option or set it to text: '' to not modify the player count text.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#text
# Read more: https://asl.andre601.ch/profiles/#text
#
text: ''
#
# Allows you to modify the max player count displayed.
# Note that this will affect ${server playersMax} (Except for when used in conditions).
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#extraPlayers
# Read more: https://asl.andre601.ch/profiles/#extraplayers
#
extraPlayers:
#
# Enables/Disables the extraPlayers option.
# When enabled will the total amount of players allowed be modified to the current
# When enabled will the total amount of players allowed to join be modified to the current
# number of online players + 'amount'
#
# Defaults to false when not present.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#enabled
# Read more: https://asl.andre601.ch/profiles/#extraplayers-enabled
#
enabled: false
#
@@ -134,6 +143,35 @@ playerCount:
#
# Defaults to 0 when not present.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#amount
# Read more: https://asl.andre601.ch/profiles/#extraplayers-amount
#
amount: 0
#
# Allows you to set the max players that could join your server.
# Note that this option influences the '${server playersMax}' placeholder.
#
# The settings of this option have no effect should 'extraPlayers' be enabled
#
# Read more: https://asl.andre601.ch/profiles/#maxplayers
#
maxPlayers:
#
# Enables/Disables the maxPlayers option.
# When enabled will the total amount of players allowed to join be changed to what 'amount' is set to.
#
# Defaults to false when not present.
#
# Read more: https://asl.andre601.ch/profiles/#maxplayers-enabled
#
enabled: false
#
# Sets the number to display for the max number of players allowed to join your server.
#
# Example:
# Setting this option to 0 (Default) while 1 player is online would display '1/0'
#
# Defaults to 0 if not set.
#
# Read more: https://asl.andre601.ch/profiles/#maxplayers-amount
#
amount: 0
Loaded 100 of 228 files, more files were not shown because too many files have changed in this diff. Show more