Compare commits

...
296 Commits
Author SHA1 Message Date
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
114 changed files with 3858 additions and 942 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:
+4 -4
View File
@@ -91,10 +91,10 @@ Spanish Video by Ajneb97
</a>
<!-- Links -->
[profiles]: https://andre601.ch/AdvancedServerList/latest/profiles
[conditions]: https://andre601.ch/AdvancedServerList/latest/profiles/#conditions
[placeholders]: https://andre601.ch/AdvancedServerList/latest/profiles/placeholders
[minimessage]: https://andre601.ch/AdvancedServerList/latest/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/
-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: "/bukkit"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- 'Type: Update Dependency'
- 'Target: Bukkit'
- 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'
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- 'Type: Update Dependency'
- 'Target: MkDocs'
+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/**"]
-100
View File
@@ -1,100 +0,0 @@
name: Create PR Artifacts
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
branches:
- master
paths-ignore:
- '.github/**'
- 'docs/**'
- '.gitignore'
- 'LICENSE'
- 'README.md'
- 'mkdocs.yml'
- 'requirements.txt'
concurrency:
group: '${{ github.workflow }}-${{ github.head_ref }}'
cancel-in-progress: false
permissions:
issues: write
pull-requests: write
jobs:
buildArtifacts:
runs-on: ubuntu-latest
outputs:
comment_id: ${{ steps.comment.outputs.comment-id }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Find Comment
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- pr-build comment -->'
- name: Print Comment info
run: |
echo "Comment ID: ${{ steps.find-comment.outputs.comment-id }}"
echo "Comment Author: ${{ steps.find-comment.outputs.comment-author }}"
echo "Comment created at: ${{ steps.find-comment.outputs.comment-created-at }}"
- name: Post/Update Comment
uses: peter-evans/create-or-update-comment@v3
id: comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body-path: .github/assets/pr-comments/building.md
- name: Set up JDK 1.16
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '16'
cache: 'maven'
- name: Obtain short Commit SHA
id: get-commit
run: 'echo "sha_short=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})" >> $GITHUB_OUTPUT'
- name: Build Jar files
run: mvn clean install
env:
COMMIT_SHA: ${{ steps.get-commit.outputs.sha_short }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: AdvancedServerList-Artifacts
path: '*/target/AdvancedServerList-*.jar'
if-no-files-found: error
commentOnFail:
needs: [buildArtifacts]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Render Markdown Template
id: render
uses: chuhlomin/render-template@v1.7
with:
template: './.github/assets/pr-comments/failed.md'
vars: |
commit: ${{ github.event.pull_request.head.sha }}
logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Update Comment (Failure)
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ needs.buildArtifacts.outputs.comment_id }}
edit-mode: replace
body: ${{ steps.render.outputs.result }}
+27 -8
View File
@@ -6,18 +6,33 @@ on:
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'mkdocs-theme/**'
- 'requirements.txt'
- '.github/workflows/docs-deploy.yml'
branches:
- master
tags-ignore:
- '**'
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
with:
@@ -31,9 +46,13 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements.txt
- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "actions@github.com"
- name: Deploy Files
run: mkdocs gh-deploy --force
- name: Build docs
run: mkdocs build
- name: Configure GitHub Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'site/'
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2
-99
View File
@@ -1,99 +0,0 @@
name: Comment on Pull request
on:
workflow_run:
types:
- completed
workflows:
- 'Create PR Artifacts'
permissions:
issues: write
pull-requests: write
jobs:
comment:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get Artifact and Pull request info
env:
GITHUB_TOKEN: ${{ github.token }} # Needs to be set as env variable so that 'gh api' can be used.
WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
run: |
PREVIOUS_JOB_ID=$(jq -r '.id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Previous Job ID: $PREVIOUS_JOB_ID"
echo "PREVIOUS_JOB_ID=$PREVIOUS_JOB_ID" >> "$GITHUB_ENV"
SUITE_ID=$(jq -r '.check_suite_id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Previous Suite ID: $SUITE_ID"
echo "SUITE_ID=$SUITE_ID" >> "$GITHUB_ENV"
ARTIFACT_ID=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
--jq ".artifacts.[] |
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
select(.expired==false) |
.id")
echo "Artifact ID: $ARTIFACT_ID"
echo "ARTIFACT_ID=$ARTIFACT_ID" >> "$GITHUB_ENV"
ARTIFACT_EXPIRE_DATE=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
--jq ".artifacts.[] |
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
select(.expired==false) |
.expires_at")
echo "Artifact Expire Date: $ARTIFACT_EXPIRE_DATE"
echo "ARTIFACT_EXPIRE_DATE=$ARTIFACT_EXPIRE_DATE" >> "$GITHUB_ENV"
PR_NUMBER=$(jq -r '.pull_requests[0].number' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Pull request Number: $PR_NUMBER"
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV"
HEAD_SHA=$(jq -r '.pull_requests[0].head.sha' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Head SHA: $HEAD_SHA"
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_ENV"
- name: Find Comment
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ env.PR_NUMBER }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- pr-build comment -->'
- name: Print Comment info
run: |
echo "Comment ID: ${{ steps.find-comment.outputs.comment-id }}"
echo "Comment Author: ${{ steps.find-comment.outputs.comment-author }}"
echo "Comment created at: ${{ steps.find-comment.outputs.comment-created-at }}"
- name: Render Markdown Template
id: render
uses: chuhlomin/render-template@v1.7
env:
JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ env.PREVIOUS_JOB_ID }}"
ARTIFACT_URL: "https://nightly.link/${{ github.repository }}/suites/${{ env.SUITE_ID }}/artifacts/${{ env.ARTIFACT_ID }}"
ARTIFACT_EXPIRE_DATE: "${{ env.ARTIFACT_EXPIRE_DATE }}"
HEAD_SHA: "${{ env.HEAD_SHA }}"
with:
template: './.github/assets/pr-comments/success.md'
timezone: Europe/Zurich
vars: |
commit: ${{ env.HEAD_SHA }}
logs: ${{ env.JOB_PATH }}
download: ${{ env.ARTIFACT_URL }}
expire: ${{ env.ARTIFACT_EXPIRE_DATE }}
- name: Update Comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ env.PR_NUMBER }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body: ${{ steps.render.outputs.result }}
-119
View File
@@ -1,119 +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
outputs:
plugin_release: ${{ steps.github-release.outputs.PLUGIN_RELEASE }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get Version from Release
id: github-release
run: |
version=$(echo ${{ github.event.release.tag_name }} | cut -d'v' -f2)
echo "PLUGIN_RELEASE=$version" >> $GITHUB_OUTPUT
- 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 All files
uses: actions/upload-artifact@v3
with:
name: asl-files
path: |
*/target/AdvancedServerList-*.jar
hangar-uploader/target/HangarUploader.jar
if-no-files-found: error
retention-days: 1
publish:
needs: [buildJars]
strategy:
matrix:
include:
- platforms: BungeeCord, Waterfall
directory: bungeecord
loaders: |
bungeecord
waterfall
- platforms: Spigot, Paper
directory: bukkit
loaders: |
spigot
paper
- 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-files
- name: Upload AdvancedServerList v${{ needs.buildJars.outputs.plugin_release }} (${{ matrix.loaders }}) to GitHub and Modrinth
if: '!github.event.release.prerelease'
uses: Kir-Antipov/mc-publish@v3.3
with:
name: ${{ github.event.release.tag_name }} (${{ matrix.platforms }})
version: ${{ needs.buildJars.outputs.plugin_release }}
version-type: release
files: ${{ matrix.directory}}/target/AdvancedServerList-*.jar
loaders: ${{ matrix.loaders }}
game-version-filter: releases
game-versions: '>=1.19'
java: 16
modrinth-id: xss83sOY
modrinth-featured: false
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload AdvancedServerList v${{ needs.buildJars.outputs.plugin_release }} (${{ matrix.loaders }}) to GitHub and Modrinth [Pre-Release]
if: 'github.event.release.prerelease'
uses: Kir-Antipov/mc-publish@v3.3
with:
name: ${{ github.event.release.tag_name }} (${{ matrix.platforms }})
version: ${{ needs.buildJars.outputs.plugin_release }}
version-type: beta
files: ${{ matrix.directory }}/target/AdvancedServerList-*.jar
loaders: ${{ matrix.loaders }}
game-version-filter: releases
game-versions: '>=1.19'
java: 16
modrinth-id: xss83sOY
modrinth-featured: false
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
publishHangar:
needs: [buildJars]
runs-on: ubuntu-latest
steps:
- name: Set up JDK 1.16
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '16'
- name: Download Release Assets
uses: actions/download-artifact@v3
with:
name: asl-files
- name: Move HangarUploader.jar
working-directory: hangar-uploader/target/
run: mv HangarUploader.jar ../../
- name: Execute HangarUploader.jar
run: java -jar HangarUploader.jar ${{ secrets.HANGAR_TOKEN }} ${{ needs.buildJars.outputs.plugin_release }} ${{ github.event.release.prerelease }}
env:
GITHUB_RELEASE_BODY: ${{ github.event.release.body }}
+35
View File
@@ -0,0 +1,35 @@
when:
- event: tag
branch: master
steps:
createFiles:
image: maven:3.9.4-eclipse-temurin-17
secrets:
- source: cb_token
target: codeberg_api_token
- source: gh_token
target: github_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 --all
uploadToCodeberg:
image: woodpeckerci/plugin-gitea-release
settings:
base_url: https://codeberg.org
files:
- "bukkit/target/AdvancedServerList-*.jar"
- "bungeecord/target/AdvancedServerList-*.jar"
- "velocity/target/AdvancedServerList-*.jar"
api_key:
from_secret: CB_TOKEN
+28
View File
@@ -0,0 +1,28 @@
when:
- branch: master
event: push
path:
include: ['requirements.txt', 'mkdocs.yml', 'docs/**']
steps:
buildDocs:
image: python
secrets:
- cb_token
commands:
- chmod -R a+w .
- git config --global --add safe.directory /woodpecker/src/codeberg.org/Andre601/blog-source/website
- git config --global user.email "github@andre601.ch"
- git config --global user.name "CI Website Builder"
- git fetch --unshallow
- git clone -b pages https://codeberg.org/Andre601/AdvancedServerList.git site
- chmod -R a+w site
- python -m pip install --upgrade pip
- python -m pip install -r requirements.txt
- mkdocs build
- 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" )) [CI SKIP]"
- git push
+45
View File
@@ -0,0 +1,45 @@
platform: linux/amd64
when:
event:
- cron
- manual
branch:
- master
steps:
#renovateDryRun:
# image: renovate/renovate
# pull: true
# commands:
# - renovate $${CI_REPO}
# environment:
# RENOVATE_PLATFORM: gitea
# RENOVATE_ENDPOINT: https://codeberg.org
# LOG_LEVEL: debug
# RENOVATE_DRY_RUN: full
# secrets:
# - source: rb_token
# target: renovate_token
# - source: git_author
# target: renovate_git_author
# when:
# - event: push
renovate:
image: renovate/renovate
pull: true
commands:
- renovate $${CI_REPO}
environment:
RENOVATE_PLATFORM: gitea
RENOVATE_ENDPOINT: https://codeberg.org
LOG_LEVEL: debug
secrets:
- source: rb_token
target: renovate_token
- source: gh_renovate_token
target: github_com_token
when:
- event: cron
cron: renovate
- event: manual
+15 -15
View File
@@ -10,10 +10,6 @@ AdvancedServerList is a plugin that allowys you to customize your server's MOTD,
<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>
<br>
<a href="https://www.spigotmc.org/resources/102910" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@b9ff12b/assets/compact/available/spigot_vector.svg" height="46" alt="spigot" title="Available on SpigotMC">
</a>
## Supported Platforms
@@ -64,11 +60,13 @@ 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 |
| [ViaVersion] | Spigot, Paper | No |
| Dependency | Platforms | Required? |
|-------------------|----------------------|-----------|
| [ProtocolLib] | Spigot | Yes |
| [PlaceholderAPI] | Spigot, Paper | No |
| [ViaVersion] | Spigot, Paper | No |
| [PAPIProxyBridge] | BungeeCord, Velocity | No |
| [Maintenance] | All | No |
## Statistics
@@ -97,16 +95,18 @@ You can disable this in the global bStats config file located in `/plugins/bstat
</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/#conditions
[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/
[protocollib]: https://hangar.papermc.io/dmulloy2/ProtocolLib
[placeholderapi]: https://www.spigotmc.org/resources/6245/
[viaversion]: https://www.spigotmc.org/resources/19254/
[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
+6 -6
View File
@@ -82,13 +82,13 @@
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19.3-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -100,7 +100,7 @@
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.0.0</version>
<version>5.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -118,13 +118,13 @@
<dependency>
<groupId>com.viaversion</groupId>
<artifactId>viaversion-api</artifactId>
<version>4.7.0</version>
<version>4.8.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>AdvancedServerList-Bukkit-${plugin.version}${project.build.commit}</finalName>
<finalName>AdvancedServerList-Bukkit-${plugin.version}</finalName>
<resources>
<resource>
<filtering>true</filtering>
@@ -143,7 +143,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
@@ -32,6 +32,7 @@ import ch.andre601.advancedserverlist.bukkit.BukkitCore;
import ch.andre601.advancedserverlist.bukkit.listeners.PreServerListSetEventImpl;
import ch.andre601.advancedserverlist.bukkit.objects.impl.BukkitServerImpl;
import ch.andre601.advancedserverlist.bukkit.objects.impl.BukkitPlayerImpl;
import ch.andre601.advancedserverlist.core.events.PingEventHandler;
import ch.andre601.advancedserverlist.core.interfaces.events.GenericEventWrapper;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
@@ -129,6 +130,14 @@ public class PaperEventWrapper implements GenericEventWrapper<CachedServerIcon,
return false;
}
@Override
public boolean isMaintenanceModeActive(){
if(!Bukkit.getPluginManager().isPluginEnabled("Maintenance"))
return false;
return PingEventHandler.getMaintenanceUtil().isMaintenanceEnabled();
}
@Override
public int getProtocolVersion(){
return event.getClient().getProtocolVersion();
@@ -31,6 +31,7 @@ import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.bukkit.BukkitCore;
import ch.andre601.advancedserverlist.bukkit.listeners.PreServerListSetEventImpl;
import ch.andre601.advancedserverlist.bukkit.objects.impl.BukkitServerImpl;
import ch.andre601.advancedserverlist.core.events.PingEventHandler;
import ch.andre601.advancedserverlist.core.interfaces.events.GenericEventWrapper;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
@@ -133,6 +134,14 @@ public class ProtocolLibEventWrapper implements GenericEventWrapper<WrappedServe
return event.getPlayer().getAddress() == null;
}
@Override
public boolean isMaintenanceModeActive(){
if(!Bukkit.getPluginManager().isPluginEnabled("Maintenance"))
return false;
return PingEventHandler.getMaintenanceUtil().isMaintenanceEnabled();
}
@Override
public int getProtocolVersion(){
return ping.getVersionProtocol();
+6 -1
View File
@@ -6,7 +6,9 @@ description: '${plugin.description}'
main: 'ch.andre601.advancedserverlist.paper.PaperCore'
loader: 'ch.andre601.advancedserverlist.paper.ASLLoader'
api-version: 1.19
api-version: '1.19'
folia-supported: true
dependencies:
server:
@@ -16,6 +18,9 @@ dependencies:
ViaVersion:
load: BEFORE
required: false
Maintenance:
load: BEFORE
required: false
# The below stuff is NOT used by Paper plugin.
commands:
+1
View File
@@ -20,6 +20,7 @@ libraries:
softdepend:
- 'ProtocolLib'
- 'PlaceholderAPI'
- 'Maintenance'
commands:
advancedserverlist:
+8 -8
View File
@@ -67,39 +67,39 @@
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1</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.1</version>
<type>javadoc</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.13.0</version>
<version>4.14.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.13.0</version>
<version>4.14.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bungeecord</artifactId>
<version>4.1.2</version>
<version>4.3.0</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>
@@ -111,13 +111,13 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.10.0</version>
<version>4.11.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>AdvancedServerList-BungeeCord-${plugin.version}${project.build.commit}</finalName>
<finalName>AdvancedServerList-BungeeCord-${plugin.version}</finalName>
<resources>
<resource>
<filtering>true</filtering>
@@ -31,6 +31,7 @@ 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;
@@ -42,6 +43,7 @@ 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;
@@ -131,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();
@@ -153,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
+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'
+23 -3
View File
@@ -48,6 +48,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>
@@ -96,13 +104,25 @@
<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>32.0.1-jre</version>
<version>32.1.2-jre</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.william278</groupId>
<artifactId>papiproxybridge</artifactId>
<version>1.3</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>
@@ -116,7 +136,7 @@
</dependencies>
<build>
<finalName>AdvancedServerList-Core-${plugin.version}${project.build.commit}</finalName>
<finalName>AdvancedServerList-Core-${plugin.version}</finalName>
<resources>
<resource>
<filtering>true</filtering>
@@ -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;
}
}
@@ -52,7 +52,7 @@ 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 AdvancedServerList<?> core;
private final PluginLogger logger;
private final String loader;
@@ -65,7 +65,7 @@ public class UpdateChecker{
private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(new UpdateCheckThread());
public UpdateChecker(AdvancedServerList core){
public UpdateChecker(AdvancedServerList<?> core){
this.core = core;
this.logger = core.getPlugin().getPluginLogger();
this.loader = core.getPlugin().getLoader();
@@ -36,7 +36,7 @@ public class CommandHandler{
private final List<PluginCommand> subCommands = new ArrayList<>();
public CommandHandler(AdvancedServerList core){
public CommandHandler(AdvancedServerList<?> core){
subCommands.add(new Help());
subCommands.add(new Reload(core));
subCommands.add(new ClearCache(core));
@@ -78,7 +78,7 @@ public class CommandHandler{
sender.sendMsg();
sender.sendMsg("<aqua>/asl <white>help <grey>- Shows this help");
sender.sendMsg();
sender.sendMsg("<aqua>/asl <white>reload <grey>- Reloads the plugin and clears caches");
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");
}
@@ -86,9 +86,9 @@ public class CommandHandler{
private static class Reload extends PluginCommand{
private final AdvancedServerList core;
private final AdvancedServerList<?> core;
public Reload(AdvancedServerList core){
public Reload(AdvancedServerList<?> core){
super("reload");
this.core = core;
@@ -110,21 +110,15 @@ public class CommandHandler{
sender.sendErrorMsg("<red>Error while loading profile(s)!");
}
core.clearFaviconCache();
sender.sendPrefixedMsg("<green>Successfully cleared Favicon Cache!");
core.clearPlayerCache();
sender.sendPrefixedMsg("<green>Successfully cleared Player Cache!");
sender.sendPrefixedMsg("<green>Reload complete!");
}
}
private static class ClearCache extends PluginCommand{
private final AdvancedServerList core;
private final AdvancedServerList<?> core;
public ClearCache(AdvancedServerList core){
public ClearCache(AdvancedServerList<?> core){
super("clearCache");
this.core = core;
@@ -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,10 @@ 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.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,8 +40,11 @@ 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())
if(event.isInvalidProtocol() || event.isMaintenanceModeActive())
return;
PluginCore<F> plugin = event.getPlugin();
@@ -68,11 +72,18 @@ public class PingEventHandler{
if(entry.isInvalid())
return;
if(ProfileManager.checkOption(entry.extraPlayersEnabled())){
boolean extraPlayers = ProfileManager.checkOption(entry.extraPlayersEnabled());
if(extraPlayers){
max = online + (entry.extraPlayersCount() == null ? 0 : entry.extraPlayersCount());
event.setMaxPlayers(max);
}
if(ProfileManager.checkOption(entry.maxPlayersEnabled()) && !extraPlayers){
max = (entry.maxPlayersCount() == null) ? 0 : entry.maxPlayersCount();
event.setMaxPlayers(max);
}
GenericServer finalServer = event.createGenericServer(online, max, host);
if(ProfileManager.checkOption(entry.motd())){
@@ -124,4 +135,18 @@ public class PingEventHandler{
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());
}
}
@@ -59,6 +59,8 @@ public interface GenericEventWrapper<F, P extends GenericPlayer>{
boolean isInvalidProtocol();
boolean isMaintenanceModeActive();
int getProtocolVersion();
int getOnlinePlayers();
@@ -39,32 +39,27 @@ import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
import java.util.function.Function;
public class FaviconHandler<F>{
private final Cache<String, F> favicons = CacheBuilder.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){
try{
return favicons.get(input, () -> {
BufferedImage image = resolveImage(core, input);
if(image == null)
return null;
return function.apply(image);
});
}catch(ExecutionException ignored){
return favicons.get(input, () -> convert(input, function)).getNow(null);
}catch(ExecutionException e){
return null;
}
}
@@ -73,7 +68,17 @@ public class FaviconHandler<F>{
favicons.invalidateAll();
}
private BufferedImage resolveImage(AdvancedServerList core, String input){
private CompletableFuture<F> convert(String input, Function<BufferedImage, F> function){
return CompletableFuture.supplyAsync(() -> {
BufferedImage img = resolveImage(core, input);
if(img == null)
return null;
return function.apply(img);
}, faviconThreadPool);
}
private BufferedImage resolveImage(AdvancedServerList<F> core, String input){
InputStream stream;
if(input.toLowerCase(Locale.ROOT).startsWith("https://")){
@@ -126,7 +131,7 @@ public class FaviconHandler<F>{
}
}
private InputStream getFromUrl(AdvancedServerList core, String url){
private InputStream getFromUrl(AdvancedServerList<F> core, String url){
try{
URL faviconUrl = new URL(url);
URLConnection connection = faviconUrl.openConnection();
@@ -140,4 +145,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,23 +31,20 @@ 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 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();
@@ -55,6 +52,7 @@ public class PlayerHandler{
// UUID of MHF_Question
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){
@@ -75,7 +73,7 @@ public class PlayerHandler{
}
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());
}
@@ -53,13 +53,16 @@ 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;
@@ -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();
}
@@ -150,6 +157,13 @@ public class ProfileManager{
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.extraPlayersCount() == null)
return defaultProfile.extraPlayersCount() == null ? 0 : defaultProfile.extraPlayersCount();
@@ -157,6 +171,13 @@ public class ProfileManager{
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){
try{
return node.node(path).getList(String.class);
@@ -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();
}
}
@@ -52,8 +52,10 @@ public class ProfileSerializer implements TypeSerializer<ProfileEntry>{
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());
node.node("playerCount", "extraPlayers", "enabled").set(profile.extraPlayersEnabled());
node.node("playerCount", "extraPlayers", "amount").set(profile.extraPlayersCount());
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());
}
}
+1 -1
View File
@@ -37,4 +37,4 @@ checkUpdates: true
# 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: 2
config-version: 2
+42 -13
View File
@@ -2,7 +2,7 @@
# 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
@@ -10,7 +10,7 @@ priority: 0
# 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 +25,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 +49,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 +64,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 +82,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 +90,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 +104,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 +134,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
+35
View File
@@ -0,0 +1,35 @@
{% extends "base.html" %}
{% import "api-objects/info-template.html" as info %}
{% block content %}
{% include "partials/content.html" %}
{% if page.meta %}
<!--
Object summaries
-->
{% if page.meta.constructors %}
{{ info.summary('Constructor Summary', page.meta.constructors, details_type='constructor') }}
{% endif %}
{% if page.meta.classes %}
{{ info.summary('Class Summary', page.meta.classes, details_type='class') }}
{% endif %}
{% if page.meta.enums %}
{{ info.summary('Enum Constant Summary', page.meta.enums, details_type='enum') }}
{% endif %}
{% if page.meta.methods or page.meta.inherits %}
{{ info.summary('Method Summary', page.meta.methods, page.meta.inherits, details_type='method') }}
{% endif %}
<!--
Detailed object info
-->
{% if page.meta.constructors %}
{{ info.info('Constructor Detail', page.meta.constructors) }}
{% endif %}
{% if page.meta.enums %}
{{ info.info('Enum Constant Detail', page.meta.enums, true) }}
{% endif %}
{% if page.meta.methods %}
{{ info.info('Method Detail', page.meta.methods)}}
{% endif %}
{% endif %}
{% endblock %}
@@ -0,0 +1,218 @@
{% macro summary(title, summaries, inherits, details_type = 'unknown') -%}
<h2 id="{{ title | lower() | replace(' ', '-') | e}}">
{{ title }}
</h2>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table">
{% if summaries %}
<table>
<thead>
<tr>
{% if details_type and details_type == "method" %}
<th>Modifier and Type</th>
{% endif %}
<th>{{ details_type | capitalize() }}</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for summary in summaries %}
<tr>
{% set modifiers = namespace(name = "") %}
{% for attribute in summary.attributes %}
{% set modifiers.name = modifiers.name ~ attribute %}
{% if loop.revindex > 0 %}{% set modifiers.name = modifiers.name ~ " " %}{% endif %}
{% endfor %}
{% if modifiers.name %}{% set modifiers.name = modifiers.name ~ " " %}{% endif %}
{% if summary.type and summary.type.name %}
{% set modifiers.name = modifiers.name ~ summary.type.name %}
{% else %}
{% set modifiers.name = modifiers.name ~ "void" %}
{% endif %}
{% set desc = "" %}
{% if summary.deprecated %}
{% set desc = "<api__deprecated></api__deprecated><br>" ~ summary.deprecated.split("<br>")[0] %}
{% elif summary.description %}
{% set desc = summary.description.split("<br>")[0] %}
{% endif %}
{% set final_name = namespace(name = "") %}
{% if details_type and details_type == "enum" %}
{% set final_name.name = summary.name | upper() %}
{% else %}
{% set final_name.name = summary.name ~ "(" %}
{% endif %}
{% for parameter in summary.parameters %}
{% set final_name.name = final_name.name ~ parameter.type %}
{% if loop.revindex > 1 %}{% set final_name.name = final_name.name ~ ", " %}{% endif %}
{% endfor %}
{% if details_type != "enum" %}
{% set final_name.name = final_name.name ~ ")" %}
{% endif %}
{% if details_type and details_type == "method" %}
{% if modifiers.name %}
<td><code>{{ modifiers.name }}</code></td>
{% else %}
<td></td>
{% endif %}
{% endif %}
<td>
{% if summary.link %}
<a href="{{ summary.link }}"><code>{{ final_name.name | e}}</code></a>
{% else %}
<a href="#{{ final_name.name | lower() | replace(' ', '-') | e }}"><code>{{ final_name.name | e}}</code></a>
{% endif %}
</td>
<td>{{ desc }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if inherits %}
{% for classpath, inherit in inherits.items() %}
<table>
<thead>
<tr>
<th>Methods inherited from <a href="{{ inherit.link }}"><code>{{ classpath }}</code></a></th>
</tr>
</thead>
<tbody>
<tr>
<td>
{% for inh in inherit.list %}
<a href="{{ inherit.link }}#{{ inh | lower() | replace(' ', '-') | e }}">
<code>{{- inh | e -}}</code>
</a>
{%- if loop.revindex > 1 %}, {% endif -%}
{% endfor %}
</td>
</tr>
</tbody>
</table>
{% endfor %}
{% endif %}
</div>
</div>
{%- endmacro %}
{% macro info(title, details, enum = false) -%}
<h2 id="{{ title | lower() | replace(' ', '-') | e}}">
{{ title }}
</h2>
{% for detail in details %}
<div class="api-detail">
{% set final_name = namespace(name = "") %}
{% if enum %}
{% set final_name.name = detail.name | upper() %}
{% else %}
{% set final_name.name = detail.name ~ "(" %}
{% endif %}
{% for parameter in detail.parameters %}
{% set final_name.name = final_name.name ~ parameter.type %}
{% if loop.revindex > 1 %}{% set final_name.name = final_name.name ~ ", " %}{% endif %}
{% endfor %}
{% if not enum %}
{% set final_name.name = final_name.name ~ ")" %}
{% endif %}
<h3 id="{{ final_name.name | lower() | replace(' ', '-') | e }}">
{% if detail.deprecated %}
<api__deprecated></api__deprecated>
{% endif %}
{% for attribute in detail.attributes %}
<api__{{- attribute -}}></api__{{- attribute -}}>
{% endfor %}
{% if enum %}
<api__static></api__static> <api__final></api__final>
{% endif %}
{% if detail.type %}
{% if detail.type.link %}
<a href="{{ detail.type.link }}" class="api-type__{{- detail.type.type | default('primitive') -}}">{{ detail.type.name | default('void') | e }}</a>
{% else %}
<span class="api-type__{{- detail.type.type | default('primitive') -}}">{{ detail.type.name | default('void') | e }}</span>
{% endif %}
{% endif %}
<code>{{ final_name.name | e }}</code><a href="#{{ final_name.name | lower() | replace(' ', '-') | e }}" class="headerlink" title="Permanent link"></a>
</h3>
{% if detail.deprecated %}
<div class="admonition danger">
<div class="admonition-title">Deprecation Warning</div>
<p>
{{ detail.deprecated }}
</p>
</div>
{% endif %}
{% if detail.description %}
<p class="api-detail__description">
{{ detail.description }}
</p>
{% endif %}
{% if detail.parameters %}
<h4 id="{{ detail.name | lower() | replace(' ', '-') | e }}-parameters">
Parameters:<a href="#{{ detail.name | lower() | replace(' ', '-') | e }}-parameters" class="headerlink" title="Permanent link"></a>
</h4>
<ul>
{% for parameter in detail.parameters %}
<li>
{% for attribute in parameter.attribute %}
<api__{{- attribute -}}></api__{{- attribute -}}>
{% endfor %}
<code>{{ parameter.type | e }}: {{ parameter.name }}</code>{% if parameter.description %} - {{ parameter.description }}{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% if detail.returns %}
<h4 id="{{ detail.name | lower() | replace(' ', '-') | e }}-returns">
Returns:<a href="#{{ detail.name | lower() | replace(' ', '-') | e }}-returns" class="headerlink" title="Permanent link"></a>
</h4>
<p class="api-detail__description">
{{ detail.returns }}
</p>
{% endif %}
{% if detail.throws %}
<h4 id="{{ detail.name | lower() | replace(' ', '-') | e }}-throws">
Throws:<a href="#{{ detail.name | lower() | replace(' ', '-') | e }}-throws" class="headerlink" title="Permanent link"></a>
</h4>
<ul>
{% for throw in detail.throws %}
<li>
<code>{{ throw.name }}</code>{% if throw.description %} - {{ throw.description }}{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% if seealso %}
<h4 id="{{ detail.name | lower() | replace(' ', '-') | e }}-see-also">
See also:<a href="#{{ detail.name | lower() | replace(' ', '-') | e }}-see-also" class="headerlink" title="Permanent link"></a>
</h4>
<ul>
{% for see in detail.seealso %}
<li>
<a href="{{ see.link }}"><code>{{ see.name }}</code></a>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
{%- endmacro %}
+42
View File
@@ -0,0 +1,42 @@
<!-- Tags -->
{% if "material/tags" in config.plugins and tags %}
{% include "partials/tags.html" %}
{% endif %}
<!-- Actions -->
{% include "partials/actions.html" %}
{% if config.extra.github_repository %}
<div class="admonition info">
<p class="admonition-title">Moved</p>
<p>
The documenation has been moved and can now be found at <a href="https://asl.andre601.ch" target="_blank" rel="noreferral nofollow noopener"><strong>asl.andre601.ch</strong></a>.<br>
This page in particular can be found at <a href="https://asl.andre601.ch/{{ page.url }}" target="_blank" rel="noreferral nofollow noopener"><strong>asl.andre601.ch/{{ page.url }}</strong></a>.
</p>
</div>
{% endif %}
<!--
Hack: check whether the content contains a h1 headline. If it doesn't, the
page title (or respectively site name) is used as the main headline.
-->
{% if "\x3ch1" not in page.content %}
<h1>{{ page.title | d(config.site_name, true)}}</h1>
{% endif %}
<!-- Page content -->
{{ page.content }}
<!-- Source file information -->
{% if page.meta and (
page.meta.git_revision_date_localized or
page.meta.revision_date
) %}
{% include "partials/source-file.html" %}
{% endif %}
<!-- Was this page helpful? -->
{% include "partials/feedback.html" %}
<!-- Comment system -->
{% include "partials/comments.html" %}
+8
View File
@@ -0,0 +1,8 @@
nav:
- Home: index.md
- commands
- profiles
- examples
- migration
- api
- PlaceholderAPI: placeholderapi
+2
View File
@@ -0,0 +1,2 @@
nav:
- ...
+34 -5
View File
@@ -1,8 +1,30 @@
---
icon: octicons/log-24
---
# Changelog
This page lists the recent changes made towards the AdvancedServerListAPI.
They are ordered newest to oldest.
## v3.1.0
### :octicons-plus-circle-24:{ .changelog-added title="Added" } Added { #v3.1.0-added }
- New getters in `ProfileEntry`:
- `maxPlayersEnabled()` - Returns the value for `playerCount -> maxPlayers -> enabled` as `NullBool`
- `maxPlayersCount()` - Returns the value of `playerCount -> maxPlayers -> amount` as nullable `Integer`
- New setters in `ProfileEntry.Builder`:
- `setMaxPlayersEnabled(NullBool)` - Sets whether the max players feature is enabled or not.
- `setMaxPlayersCount(Integer)` - Sets the number to use for the max players count.
- `setExtraPlayersCount(Integer)` - Replacement for [deprecated `setExtraPlayerCount(Integer)` method](#v3.1.0-deprecated).
### :octicons-zap-24:{ .changelog-breaking title="Deprecated" } Deprecated { #v3.1.0-deprecated }
- `setExtraPlayerEnabled(Integer)` in `ProfileEntry.Builder` - Typo in method name.
----
## v3.0.0
### :octicons-alert-24:{ .changelog-breaking title="Breaking Changes" } Breaking Changes { #v3-breaking }
@@ -13,14 +35,16 @@ They are ordered newest to oldest.
### :octicons-plus-circle-24:{ .changelog-added title="Added" } Added { #v3-added }
- New platform-specific `GenericServer` instances with their own methods to use.
- `BukkitServer` - Contains a `getWorlds()` method that returns a `Map<String, World>` of all loaded worlds in the server.
- `BungeeProxy` - Contains a `getServers()` method that returns a `Map<String, ServerInfo>` of all known Servers for BungeeCord.
- `VelocityProxy` - Contains a `getServers()` method that returns a `Map<String, RegisteredServer>` of all known Servers for Velocity.
- `BukkitServer` - Contains a `getWorlds()` method that returns a `Map<String, World>` of all loaded worlds in the server.
- `BungeeProxy` - Contains a `getServers()` method that returns a `Map<String, ServerInfo>` of all known Servers for BungeeCord.
- `VelocityProxy` - Contains a `getServers()` method that returns a `Map<String, RegisteredServer>` of all known Servers for Velocity.
### :octicons-trash-24:{ .changelog-removed title="Removed" } Removed { #v-removed }
### :octicons-trash-24:{ .changelog-removed title="Removed" } Removed { #v3-removed }
- All previously deprecated `getX()` methods from the `ProfileEntry` record
----
## v2.1.0
### :octicons-pencil-24:{ .changelog-changed title="Changed" } Changed { #v2.1.0-changed }
@@ -28,6 +52,8 @@ They are ordered newest to oldest.
- Turned `ProfileEntry` class into a record
- Former `getX()` methods are now deprecated in favour of the record's own `x()` methods (i.e. `getMotd()` -> `motd()`)
----
## v2.0.0
### :octicons-alert-24:{ .changelog-breaking title="Breaking Changes" } Breaking Changes { #v2-breaking }
@@ -57,6 +83,8 @@ They are ordered newest to oldest.
- `UnsupportedAPIAccessException` as it is no longer used in the API itself.
----
## v1.0.0
### :octicons-plus-circle-24:{ .changelog-added title="Added" } Added { #v1-added }
@@ -74,5 +102,6 @@ Templates for changelog
### :octicons-plus-circle-24:{ .changelog-added title="Added" } Added { #v-added }
### :octicons-pencil-24:{ .changelog-changed title="Changed" } Changed { #v-changed }
### :octicons-trash-24:{ .changelog-removed title="Removed" } Removed { #v-removed }
### :octicons-zap-24:{ .changelog-deprecated title="Deprecated" } Deprecated { #v-deprecated }
-->
-->
+14 -5
View File
@@ -1,3 +1,7 @@
---
icon: octicons/command-palette-24
---
# API
AdvancedServerList v2 introduced a new API that plugins can hook into to use.
@@ -9,7 +13,9 @@ Add the following to your `build.gradle` or `pom.xml` file to use the API:
=== ":simple-gradle: Gradle"
Make sure to replace `{version}` with the latest version available in the [GitHub Repository][api-repo].
[![latest_release][release]][api-repo]
Make sure to replace `{version}` with the version displayed above.
```groovy title="build.gradle"
repositorories {
@@ -20,15 +26,17 @@ Add the following to your `build.gradle` or `pom.xml` file to use the API:
implementation 'ch.andre601.asl-api:api:{version}'
// Optional platform dependencies
implementation 'ch.andre601.asl-api:platform-bukkit:{version}'
implementation 'ch.andre601.asl-api:platform-bungeecord:{version}'
implementation 'ch.andre601.asl-api:platform-spigot:{version}'
implementation 'ch.andre601.asl-api:platform-velocity:{version}'
}
```
=== ":simple-apachemaven: Maven"
Make sure to replace `{version}` with the latest version available in the [GitHub Repository][api-repo].
[![latest_release][release]][api-repo]
Make sure to replace `{version}` with the version displayed above.
```xml title="pom.xml"
<repositories>
@@ -48,12 +56,12 @@ Add the following to your `build.gradle` or `pom.xml` file to use the API:
<!-- Optional platform dependencies -->
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>platform-bungeecord</artifactId>
<artifactId>platform-bukkit</artifactId>
<version>{version}</version>
</dependency>
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>platform-spigot</artifactId>
<artifactId>platform-bungeecord</artifactId>
<version>{version}</version>
</dependency>
<dependency>
@@ -64,6 +72,7 @@ Add the following to your `build.gradle` or `pom.xml` file to use the API:
</dependencies>
```
[release]: https://img.shields.io/github/v/tag/Andre601/asl-api?labelColor=252631&color=292a36&style=for-the-badge&label=Latest%20Release:
[api-repo]: https://github.com/Andre601/asl-api
## Add own placeholders
+6
View File
@@ -0,0 +1,6 @@
nav:
- index.md
- api: api
- platform-bukkit: platform-bukkit
- platform-bungeecord: platform-bungeecord
- platform-velocity: platform-velocity
+3
View File
@@ -0,0 +1,3 @@
nav:
- index.md
- ch.andre601.advancedserverlist.api: ch.andre601.advancedserverlist.api
@@ -0,0 +1,54 @@
---
template: api-doc.html
methods:
- name: 'get'
description: |
Retrieve the instance used of this API.<br>
If no instance has been made so far will a new one be created.
returns: 'Instance of this API.'
attributes:
- static
type:
name: 'AdvancedServerListAPI'
type: 'object'
- name: 'addPlaceholderProvider'
description: |
Adds the provided <a href="./../placeholderprovider/"><code>PlaceholderProvider</code></a> to the list, if it passes the following checks:<br>
<ul>
<li>Provided PlaceholderProvider instance is not null.</li>
<li>The identifier is not null nor empty.</li>
<li>The identifier does not contain any spaces.</li>
<li>A PlaceholderProvider with the same identifier doesn't exist already.</li>
</ul>
Not passing any of the above checks results in a <a href="./../exceptions/invalidplaceholderproviderexception/"><code>InvalidPlaceholderProviderException</code></a> being thrown.
parameters:
- name: 'placeholderProvider'
description: 'The <a href="./../placeholderprovider/"><code>PlaceholderProvider</code></a> to add.'
type: PlaceholderProvider
attributes:
- notnull
throws:
- name: 'InvalidPlaceholderProviderException'
description: 'When the provided <a href="./../placeholderprovider/"><code>PlaceholderProvider</code> instance</a> is null, has a null or empty identifier, the identifier contains spaces, or another PlaceholderProvider with the same identifier is already in use.'
type:
name: 'void'
- name: 'retrievePlaceholderProvider'
description: 'Retrieves the <a href="./../placeholderprovider/"><code>PlaceholderProvider</code></a> associated with the provided identifier, or <code>null</code> should no such entry exist.'
parameters:
- name: 'identifier'
description: 'The identifier to find a matching <a href="./../placeholderprovider/"><code>PlaceholderProvider</code></a> for.'
type: String
returns: 'Possibly-null <a href="./../placeholderprovider/"><code>PlaceholderProvider</code> instance</a>.'
attributes:
- nullable
type:
name: PlaceholderProvider
type: object
link: './../placeholderprovider'
---
# <api__class></api__class> AdvancedServerListAPI
Core class of the API for AdvancedServerList.
Use [`get()`](#get) to retrieve the instance currently used.
@@ -0,0 +1,45 @@
---
template: api-doc.html
methods:
- name: 'getEntry'
description: 'Gets the <a href="../../profiles/profileentry/"><code>ProfileEntry</code></a> currently set.'
returns: The currently used ProfileEntry.
type:
name: ProfileEntry
type: object
link: '../../profiles/profileentry/'
- name: 'setEntry'
description: |-
Sets the new <a href="../../profiles/profileentry/"><code>ProfileEntry</code></a> to use.<br>
This may not be <code>null</code>.
parameters:
- name: 'entry'
description: 'The new <a href="../../profiles/profileentry/"><code>ProfileEntry</code></a> to use.'
type: ProfileEntry
attributes:
- notnull
throws:
- name: 'IllegalArgumentException'
description: 'When the provided ProfileEntry is <code>null</code>'
type:
name: 'void'
- name: 'isCancelled'
description: Returns whether this event has been cancelled or not.
returns: Whether this event has been cancelled or not.
type:
name: boolean
- name: 'setCancelled'
description: Sets the event's cancel state
parameters:
- name: 'cancelled'
description: 'Boolean to set the event''s cancelled state.'
type: boolean
type:
name: 'void'
---
# <api__interface></api__interface> GenericServerListEvent
Interface used for the platform-specific PreServerListSetEvent instances.
This allows the plugin to pull common info such as ProfileEntry or if the event has been cancelled by another plugin.
@@ -0,0 +1,13 @@
---
template: 'api-doc.html'
constructors:
- name: 'InvalidPlaceholderProviderException'
parameters:
- name: msg
type: String
---
# <api__class></api__class> InvalidPlaceholderProviderException
RuntimeException thrown whenever an invalid [`PlaceholderProvider`](../placeholderprovider.md) has been given.
@@ -0,0 +1,42 @@
---
template: api-doc.html
methods:
- name: 'getName'
description: |
Returns the name of the player.<br>
Note that on Spigot, Paper and other forks can the name differ from the one cached by AdvancedServerList, if the plugin was able to retrieve an OfflinePlayer instance from the server. On BungeeCord and Velocity will the returned String always be the name from the cache.<br>
<br>
Name may be whatever has been defined in AdvancedServerList's config.yml, should the player not be cached yet by the plugin.
returns: 'String representing the player''s name'
type:
name: String
type: object
- name: 'getProtocol'
description: |
Returns the protocol ID the player is using.<br>
The protocol ID is an integer used by Minecraft to determine what version a server or client is running.
returns: 'Integer representing the protocol version of this player.'
type:
name: int
- name: 'getUUID'
description: |
Returns the unique ID associated with this player.<br>
<br>
UUID may be whatever has been defined in AdvancedServerList's config.yml, should the player not be cached yet by AdvancedServerList.
returns: 'UUID of the player'
type:
name: UUID
type: object
---
# <api__interface></api__interface> GenericPlayer
A basic interface used to store generic player data to use in placeholder resolving.
The different variants of AdvancedServerList implement this into their own class and may provide additional data not available through this interface.
The following values will always be present, no matter the platform this interface is used on:
- [Name of the Player](#getname())
- [Protocol version of the Player](#getprotocol())
- [UUID of the Player](#getuuid())
@@ -0,0 +1,27 @@
---
template: api-doc.html
methods:
- name: 'getPlayersOnline'
description: 'Returns the number of players currently online on the server.'
returns: 'Number of players online on the server.'
type:
name: int
- name: 'getPlayersMax'
description: 'Returns the number of total players that can join the server.'
returns: 'Number of total players that can join the server.'
type:
name: int
- name: 'getHost'
description: 'Returns the IP/Domain that got pinged by the player.'
returns: 'Possibly-null String containing the IP/Domain that got pinged by the player'
attributes:
- nullable
type:
name: 'String'
type: 'object'
---
# <api__interface></api__interface> GenericServer
Simple class used to wrap around some generic server data such as online player count, number of total players that can join and the host (IP/Domain) that got pinged by the player.
@@ -0,0 +1,51 @@
---
template: api-doc.html
enums:
- name: 'true'
description: 'Boolean value <code>true</code>'
- name: 'false'
description: 'Boolean value <code>false</code>'
- name: 'not_set'
description: 'Boolean value <code>null</code>'
methods:
- name: 'resolve'
description: |
Returns a NullBool instance based on the provided <code>Boolean</code> value.<br>
In case of <code>null</code> being provided will <a href="#not_set"><code>NullBool.NOT_SET</code></a> be returned, otherwise will the corresponding NullBool instance matching the Boolean value be returned.
returns: 'NullBool instance based on the provided <code>Boolean</code> value.'
parameters:
- name: 'bool'
description: 'The <code>Boolean</code> value to receive a NullBool instance for.'
type: Boolean
attributes:
- nullable
attributes:
- static
type:
name: 'NullBool'
type: 'object'
- name: 'isNotSet'
description: 'Returns whether the NullBool is <a href="#not_set"><code>NullBool.NOT_SET</code></a>.'
returns: 'True if the instance is <a href="#not_set"><code>NullBool.NOT_SET</code></a>, otherwise false.'
type:
name: 'boolean'
type: 'primitive'
- name: 'getOrDefault'
description: |
Gets the corresponding boolean value associated with the NullBool instance.<br>
In the case of NullBool <a href="#isnotset()">not being set</a> will the provided default value be returned.
returns: 'True or false depending on the NullBool instance and the provided default value.'
parameters:
- name: 'def'
description: 'The default boolean value to return should the NullBool instance be <a href="#not_set"><code>NullBool.NOT_SET</code></a>.'
type: boolean
type:
name: 'boolean'
type: 'primitive'
---
# <api__enum></api__enum> NullBool
Enum used to return a `Boolean` value with a default one should no value be set.
@@ -0,0 +1,50 @@
---
template: api-doc.html
constructors:
- name: 'PlaceholderProvider'
description: 'Constructor used to set the identifier for the class extending the PlaceholderProvider class itself.'
parameters:
- name: 'identifier'
description: 'The identifier to use for the placeholder. Cannot be empty.'
type: String
attributes:
- notnull
methods:
- name: 'parsePlaceholder'
description: |
Method called by AdvancedServerList's StringReplacer class to replace any appearances of <code>${&lt;identifier&gt; &lt;placeholder&gt;}</code> with whatever value a matching PlaceholderProvider may return.<br>
<br>
Returning <code>null</code> will be treated as an invalid placeholder by the plugin, making it return the placeholder as-is without any changes.
parameters:
- name: 'placeholder'
type: String
description: 'The part of the Placeholder that comes after the identifier and before the closing curly bracket.'
- name: 'player'
type: GenericPlayer
description: 'The <a href="./../objects/genericplayer/"><code>GenericPlayer</code> instance</a> used.'
- name: 'server'
type: GenericServer
description: 'The <a href="./../objects/genericserver/"><code>GenericServer</code> instance</a> used.'
returns: 'Possibly-parsed or possibly-null String to replace the placeholder with.'
attributes:
- nullable
- abstract
type:
name: 'String'
type: 'object'
- name: 'getIdentifier'
description: 'Returns the identifier used by this PlaceholderProvider instance.'
returns: 'String representing the identifier of this PlaceholderProvider instance.'
type:
name: 'String'
type: 'object'
---
# <api__abstract></api__abstract> <api__class></api__class> PlaceholderProvider
Abstract class that is used to provide your own Placeholder patterns for AdvancedServerList to parse.
In order for your class to be considered a valid PlaceholderProvider will you need to set the `identifier` to a non-null, non-empty value without having any spaces in it.
Once set, use [`AdvancedServerListAPI#addPlaceholderProvider(PlaceholderProvider)`](advancedserverlistapi.md#addplaceholderprovider(placeholderprovider)) to register your class for AdvancedServerList to use.
@@ -0,0 +1,193 @@
---
template: api-doc.html
constructors:
- name: 'Builder'
methods:
- name: 'setMotd'
description: |
Sets a new MOTD to use.<br>
<br>
Set to an empty list to not change the MOTD.<br>
Only the first two entries of the list will be considered and any additional ones discarded.
returns: 'This Builder after the motd has been set. Useful for chaining.'
parameters:
- name: 'motd'
description: 'The MOTD to use.'
type: 'List<String>'
attributes:
- notnull
throws:
- name: 'IllegalArgumentException'
description: 'Thrown by the <code>CheckUtil</code> in case <code>null</code> has been provided as parameter.'
type:
name: 'Builder'
type: 'object'
- name: 'setPlayers'
description: |
Sets the players (lines) to use for the hover.<br>
<br>
Set to an empty list to not change the hover text.
returns: 'This Builder after the players have been set. Useful for chaining.'
parameters:
- name: 'players'
description: 'The lines to set for the hover.'
type: 'List<String>'
attributes:
- notnull
throws:
- name: 'IllegalArgumentException'
description: 'Thrown by the <code>CheckUtil</code> in case <code>null</code> has been provided as parameter.'
type:
name: 'Builder'
type: 'object'
- name: 'setPlayerCountText'
description: |
Sets the text to override the player count with.<br>
<br>
Set to an empty String or <code>null</code> to not alter the player count text.
returns: 'This Builder after the player count text has been set. Useful for chaining.'
parameters:
- name: 'playerCountText'
description: 'The text to show in the player count.'
type: String
attributes:
- nullable
type:
name: 'Builder'
type: 'object'
- name: 'setFavicon'
description: |
Sets the value to use for the favicon.<br>
The following values are supported:
<ul>
<li>URL to a valid PNG file.</li>
<li>File name (with <code>.png</code> extension) matching a file saved in the favicons folder of AdvancedServerList.</li>
<li><code>${player uuid}</code> to display the avatar of the player.</li>
</ul>
returns: 'This Builder after the favicon has been set. Useful for chaining.'
parameters:
- name: 'favicon'
description: 'The favicon to set'
type: String
attributes:
- nullable
type:
name: 'Builder'
type: 'object'
- name: 'setHidePlayersEnabled'
description: |
Sets whether the player count should be hidden or not.<br>
<br>
Set to <a href="../../objects/nullbool/#not_set"><code>NullBool.NOT_SET</code></a> to not set this.
returns: 'This Builder after the NullBool has been set. Useful for chaining.'
parameters:
- name: 'hidePlayersEnabled'
description: 'Whether the player count should be hidden or not.'
type: NullBool
attributes:
- notnull
throws:
- name: 'IllegalArgumentException'
description: 'Thrown by the <code>CheckUtil</code> in case <code>null</code> has been provided as parameter.'
type:
name: 'Builder'
type: 'object'
- name: 'setExtraPlayersEnabled'
description: |
Sets whether the extra players feature should be enabled or not.<br>
<br>
Set to <a href="../../objects/nullbool/#not_set"><code>NullBool.NOT_SET</code></a> to not set this.
returns: 'This Builder after the NullBool has been set. Useful for chaining.'
parameters:
- name: 'extraPlayersEnabled'
description: 'Whether the extra players feature should be enabled or not.'
type: NullBool
attributes:
- notnull
throws:
- name: 'IllegalArgumentException'
description: 'Thrown by the <code>CheckUtil</code> in case <code>null</code> has been provided as parameter.'
type:
name: 'Builder'
type: 'object'
- name: 'setMaxPlayersEnabled'
description: |
Sets whether the max players feature should be enabled.<br>
<br>
Set to <a href="../../objects/nullbool/#not_set"><code>NullBool.NOT_SET</code></a> to not set this.
returns: 'This Builder after the NullBool has been set. Useful for chaining.'
parameters:
- name: 'maxPlayersEnabled'
description: 'Whether the extra players feature should be enabled or not.'
type: NullBool
attributes:
- notnull
throws:
- name: 'IllegalArgumentException'
description: 'Thrown by the <code>CheckUtil</code> in case <code>null</code> has been provided as parameter.'
type:
name: 'Builder'
type: 'object'
- name: 'setExtraPlayerCount'
description: |
Sets the number of players to add to the online players to use as the new max players value.<br>
This option has no effect when <a href="../#extraplayersenabled()"><code>extraPlayersEnabled</code></a> is set to <a href="../../objects/nullbool/#false"><code>NullBool.FALSE</code></a> or <a href="../../objects/nullbool/#not_set"><code>NullBool.NOT_SET</code></a>.<br>
<br>
Set this to <code>null</code> to not alter the max player count. Alternatively, set <a href="#setextraplayersenabled(nullbool)"><code>setExtraPlayersEnabled(NullBool)</code></a> to <a href="../../objects/nullbool/#false"><code>NullBool.FALSE</code></a>.
returns: 'This Builder after the extra player count has been set. Useful for chaining.'
parameters:
- name: 'extraPlayersCount'
description: 'The number of extra players to add.'
type: Integer
attributes:
- nullable
deprecated: 'Typo in the name. Use <a href="#setextraplayerscount(integer)">setExtraPlayersCount(Integer)</a> instead.'
type:
name: 'Builder'
type: 'object'
- name: 'setExtraPlayersCount'
description: |
Sets the number of players to add to the online players to use as the new max players value.<br>
This option has no effect when <a href="../#extraplayersenabled()"><code>extraPlayersEnabled</code></a> is set to <a href="../../objects/nullbool/#false"><code>NullBool.FALSE</code></a> or <a href="../../objects/nullbool/#not_set"><code>NullBool.NOT_SET</code></a>.<br>
<br>
Set this to <code>null</code> to not alter the max player count. Alternatively, set <a href="#setextraplayersenabled(nullbool)"><code>setExtraPlayersEnabled(NullBool)</code></a> to <a href="../../objects/nullbool/#false"><code>NullBool.FALSE</code></a>.
returns: 'This Builder after the extra player count has been set. Useful for chaining.'
parameters:
- name: 'extraPlayersCount'
description: 'The number of extra players to add.'
type: Integer
attributes:
- nullable
type:
name: 'Builder'
type: 'object'
- name: 'setMaxPlayersCount'
description: |
Sets the number of max players allowed to join this server.<br>
This option has no effect when <a href="../#maxplayersenabled()"><code>maxPlayersEnabled</code></a> is set to <a href="../../objects/nullbool/#false"><code>NullBool.FALSE</code></a> or <a href="../../objects/nullbool/#not_set"><code>NullBool.NOT_SET</code></a>.<br>
<br>
Set this to <code>null</code> to not alter the max player count. Alternatively, set <a href="#setmaxplayersenabled(nullbool)"><code>setMaxPlayersEnabled(NullBool)</code></a> to <a href="../../objects/nullbool/#false"><code>NullBool.FALSE</code></a>.
returns: 'This Builder after the extra player count has been set. Useful for chaining.'
parameters:
- name: 'maxPlayersCount'
description: 'The number of max players to set.'
type: Integer
attributes:
- nullable
type:
name: 'Builder'
type: 'object'
- name: 'build'
description: 'Creates a new <a href="./.."><code>ProfileEntry</code> instance</a> with the values set in this Builder.'
returns: 'New <a href="./.."><code>ProfileEntry</code> instance</a>.'
type:
name: 'ProfileEntry'
type: 'object'
link: './..'
---
# <api__class></api__class> Builder
Builder class to create a new [`ProfileEntry` instance](index.md).
@@ -0,0 +1,204 @@
---
template: api-doc.html
constructors:
- name: 'ProfileEntry'
description: |
Creates a new instance of a ProfileEntry with the given values.<br>
It's recommended to use the <a href="./builder/"><code>Builder</code> class</a> for a more convenient configuration of the Settings.
parameters:
- name: 'motd'
description: 'The MOTD to use.'
type: 'List<String>'
attributes:
- notnull
- name: 'players'
description: 'The players (Lines) to show in the hover.'
type: 'List<String>'
attributes:
- notnull
- name: 'playerCountText'
description: 'The text to display instead of the player count.'
type: String
attributes:
- nullable
- name: 'favicon'
description: 'The favicon to use.'
type: String
attributes:
- nullable
- name: 'hidePlayersEnabled'
description: 'Whether player count should be hidden.'
type: NullBool
attributes:
- notnull
- name: 'extraPlayersEnabled'
description: 'Whether the extra players option should be enabled.'
type: NullBool
attributes:
- notnull
- name: 'maxPlayersEnabled'
description: 'Whether the max players option should be enabled.'
type: NullBool
attributes:
- notnull
- name: 'extraPlayersCount'
description: 'The number to add to the online players for the max players number.'
type: Integer
attributes:
- nullable
- name: 'maxPlayersCount'
description: 'The number to use for the max players count.'
type: Integer
attributes:
- nullable
seealso:
- name: 'ProfileEntry.Builder'
link: './builder/'
classes:
- name: 'Builder'
description: 'Builder class to create a new ProfileEntry instance.'
type: 'static class'
link: 'builder/'
methods:
- name: 'empty'
description: |
Creates an "empty" PlayerEntry with the following values set:<br>
<ul>
<li><a href="#motd()"><code>motd</code></a>: Empty List</li>
<li><a href="#players()"><code>players</code></a>: Empty List</li>
<li><a href="#playercounttext()"><code>playerCountText</code></a>: Empty String</li>
<li><a href="#favicon()"><code>favicon</code></a>: Empty String</li>
<li><a href="#hideplayersenabled()"><code>hidePlayersEnabled</code></a>: <a href="../../objects/nullbool/#not_set"><code>NullBool.NOT_SET</code></a></li>
<li><a href="#extraplayersenabled()"><code>extraPlayersEnabled</code></a>: <a href="../../objects/nullbool/#not_set"><code>NullBool.NOT_SET</code></a></li>
<li><a href="#maxplayersenabled()"><code>maxPlayersEnabled</code></a>: <a href="../../objects/nullbool/#not_set"><code>NullBoo.NOT_SET</code></a></li>
<li><a href="#extraplayerscount()"><code>extraPlayersCount</code></a>: <code>null</code></li>
<li><a href="#maxplayerscount()"><code>maxPlayersCount</code></a>: <code>null</code></li>
</ul>
returns: 'New ProfileEntry instance with empty/null values defined'
attributes:
- static
type:
name: 'ProfileEntry'
type: 'object'
- name: 'copy'
description: |
Creates a copy of this ProfileEntry instance.<br>
<br>
This is simply a convenience method to not have to call <a href="#builder()"><code>builder()</code></a><code>.</code><a href="./builder/#build()"><code>build()</code></a>.<br>
If you want to modify the ProfileEntry <a href="#builder()"><code>builder()</code></a> is preferred.
returns: 'A copy of this ProfileEntry instance.'
seealso:
- name: 'builder()'
link: '#builder()'
type:
name: 'ProfileEntry'
type: 'object'
- name: 'builder'
description: |
Creates a <a href="./builder/"><code>Builder</code> instance</a> with the values from this ProfileEntry set.<br>
Use this method if you would like to modify the ProfileEntry.
returns: 'A new <a href="./builder/"><code>Builder</code> instance</a> with the values of this ProfileEntry set.'
type:
name: 'Builder'
type: 'object'
link: './builder/'
- name: 'motd'
description: 'Gets the currently set MOTD of this ProfileEntry.'
returns: 'The current MOTD used by this ProfileEntry.'
type:
name: 'List<String>'
type: 'object'
- name: 'players'
description: 'Gets the currently set players of this ProfileEntry.'
returns: 'The current list of players used by this ProfileEntry.'
type:
name: 'List<String>'
type: 'object'
- name: 'playerCountText'
description: 'Gets the currently set player count text of this ProfileEntry.'
returns: 'The current player count text used by this ProfileEntry.'
type:
name: 'String'
type: 'object'
- name: 'favicon'
description: |
Gets the currently set favicon of this ProfileEntry.<br>
Note that the favicon usually is and supports one of the following options:
<ul>
<li>URL to a valid PNG file</li>
<li>File name (with <code>.png</code> extension) matching a file saved in the favicons folder of AdvancedServerList</li>
<li><code>${player uuid}</code> to display the avatar of the player</li>
</ul>
returns: 'The current favicon used by this ProfileEntry.'
type:
name: 'String'
type: 'object'
- name: 'hidePlayersEnabled'
description: |
Whether the player count should be hidden or not in this ProfileEntry.<br>
To get the actual boolean value, append <a href="../../objects/nullbool/#getordefault()"><code>getOrDefault(boolean)</code></a>.
returns: 'Whether the player count should be hidden or not in this ProfileEntry.'
type:
name: 'NullBool'
type: 'object'
link: '../../objects/nullbool/'
- name: 'extraPlayersEnabled'
description: |
Whether the extra players feature should be used or not in this ProfileEntry.<br>
To get the actual boolean value, append <a href="../../objects/nullbool/#getordefault()"><code>getOrDefault(boolean)</code></a>.
returns: 'Whether the extra players feature should be used or not in this ProfileEntry.'
type:
name: 'NullBool'
type: 'object'
link: '../../objects/nullbool/'
- name: 'maxPlayersEnabled'
description: |
Whether the max players feature should be used or not.<br>
To get the actual boolean value, append <a href="../../objects/nullbool/#getordefault()"><code>getOrDefault(boolean)</code></a>.
returns: 'Whether the max players feature should be used or not.'
type:
name: 'NullBool'
type: 'object'
link: '../../objects/nullbool/'
- name: 'extraPlayersCount'
description: 'Gets the currently set number of extra players to use by this ProfileEntry. May be <code>null</code>.'
returns: 'Possibly-null integer number of extra players used by this ProfileEntry.'
attributes:
- nullable
type:
name: 'Integer'
type: 'object'
- name: 'maxPlayersCount'
description: 'Gets the currently set number of max players of this ProfileEntry.'
returns: 'The current number of max players used by this ProfileEntry.'
attributes:
- nullable
type:
name: 'Integer'
type: 'object'
- name: 'isInvalid'
description: |
Whether this ProfileEntry is considered invalid or not.<br>
The ProfileEntry is considered invalid if all the following is true:
<ul>
<li><a href="#motd()"><code>motd()</code></a> is empty.</li>
<li><a href="#players()"><code>players()</code></a> is empty.</li>
<li><a href="#playercounttext()"><code>playerCountText()</code></a> is null/empty <b>and</b> <a href="#hideplayersenabled()"><code>hidePlayersEnabled()</code></a> is <code>false</code>.</li>
<li><a href="#favicon()"><code>favicon()</code></a> is null/empty.</li>
</ul>
As long as one of the above is <b>not</b> true is this ProfileEntry considered valid and <code>false</code> will be returned.
returns: 'Whether this ProfileEntry is invalid or not.'
type:
name: 'boolean'
type: 'primitive'
---
# <api__record></api__record> ProfileEntry
This record represents the content found in a server list profile YAML file.
The content may come from either the "profiles" list, the options in the file itself (global options) or a mix of both.
This class is immutable. Use [`builder()`](#builder()) to get a [`Builder` instance](builder.md) with the values of this class added.
+7
View File
@@ -0,0 +1,7 @@
# API Module
The `api` module is the main part of the AdvancedServerList API. It contains all necessary classes and methods you would want to use to interact with AdvancedServerList.
## Module Structure
{nav}
+12
View File
@@ -0,0 +1,12 @@
---
icon: octicons/file-code-24
---
# API Reference
This page contains the various classes and methods that the AdvancedServerList API provides to you for use.
Please note that while the nav and page content is auto-generated, the data used for the page content is not. So information may be out of date.
## API Structure
{nav}
@@ -0,0 +1,3 @@
nav:
- index.md
- ch.andre601.advancedserverlist.api.bukkit: ch.andre601.advancedserverlist.api.bukkit
@@ -0,0 +1,36 @@
---
template: api-doc.html
constructors:
- name: 'PreServerListSetEvent'
parameters:
- name: 'entry'
type: ProfileEntry
methods:
- name: 'getHandlerList'
returns: 'Static <code>HandlerList</code> instance.'
attributes:
- static
type:
name: 'HandlerList'
type: 'object'
inherits:
'ch.andre601.advancedserverlist.api.events.GenericServerListEvent':
link: '../../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent/'
list:
- 'getEntry()'
- 'setEntry(ProfileEntry)'
- 'isCancelled()'
- 'setCancelled(boolean)'
'org.bukkit.event.Event':
link: 'https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/Event.html'
list:
- 'getHandlers()'
---
# <api__class></api__class> PreServerListSetEvent
Called **before** AdvancedServerList modifies the server list.
The provided [`ProfileEntry`](../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent.md#getentry()) will be the one used for the server list.
@@ -0,0 +1,50 @@
---
template: api-doc.html
methods:
- name: 'getPlayer'
description: 'Gives the OfflinePlayer embedded in this BukkitPlayer.'
returns: 'OfflinePlayer instance'
type:
name: 'OfflinePlayer'
type: 'object'
- name: 'hasPlayedBefore'
description: |
Returns whether this player has played on the server before.<br>
<br>
The returned boolean may be inaccurate if AdvancedServerList was unable to obtain a valid OfflinePlayer instance.
returns: 'Boolean indicating whether this player has played on the server before.'
type:
name: 'boolean'
- name: 'isBanned'
description: |
Returns whether this player has been banned from the server.<br>
<br>
The returned boolean may be inaccurate if AdvancedServerList was unable to obtain a valid OfflinePlayer instance.
returns: 'Boolean indicating whether this player has been banned from the server.'
type:
name: 'boolean'
- name: 'isWhitelisted'
description: |
Returns whether this player is whitelisted on the server.<br>
<br>
The returned boolean may be inaccurate if AdvancedServerList was unable to obtain a valid OfflinePlayer instance.
returns: 'Boolean indicating whether this player is whitelisted on the server.'
type:
name: 'boolean'
inherits:
'ch.andre601.advancedserverlist.api.objects.GenericPlayer':
link: '../../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer/'
list:
- 'getName()'
- 'getProtocol()'
- 'getUUID()'
---
# <api__interface></api__interface> BukkitPlayer
[`GenericPlayer` instance](../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer.md) for the SpigotMC/Paper server implementation of AdvancedServerList.
This interface includes a [`OfflinePlayer` instance](#getplayer()) obtained from the server the plugin runs on alongside some getters to get if the player [has played on the server before](#hasplayedbefore()), [is banned](#isbanned()) or [is whitelisted](#iswhitelisted()). These options actually require a proper OfflinePlayer instance to be present or will otherwise default to `false`.
This class is useful for cases where you want to use the OfflinePlayer. Simply cast the GenericPlayer instance to a SpigotPlayer (Granted that it actually is an instance of it to begin with).
@@ -0,0 +1,26 @@
---
template: api-doc.html
methods:
- name: 'getWorlds'
description: 'Returns a <code>Map&lt;String, World&gt;</code> where the key is the name of the World and the value the world of the server.'
returns: 'Possibly-empty Map containing pairs of Strings and Worlds.'
type:
name: 'Map<String, World>'
type: 'object'
inherits:
'ch.andre601.advancedserverlist.api.objects.GenericServer':
link: '../../../../api/ch.andre601.advancedserverlist.api/objects/genericserver/'
list:
- 'getPlayersOnline()'
- 'getPlayersMax()'
- 'getHost()'
---
# <api__interface></api__interface> BukkitServer
Spigot/Paper specific instance of a [`GenericServer`](../../../api/ch.andre601.advancedserverlist.api/objects/genericserver.md).
This interface includes a [Map of Worlds](#getworlds()) the server currently has.
This interface is useful for cases where you want to get the worlds of the Server itself, by simply casting your GenericServer instance to a BukkitServer one. Make sure to do proper instanceof checks first before attempting to cast.
@@ -0,0 +1,7 @@
# Bukkit Module
The `platform-bukkit` module contains classes for platform-specific things such as Server events or a Server-specific CachedPlayer instance.
## Module Structure
{nav}
@@ -0,0 +1,3 @@
nav:
- index.md
- ch.andre601.advancedserverlist.api.bungeecord: ch.andre601.advancedserverlist.api.bungeecord
@@ -0,0 +1,24 @@
---
template: api-doc.html
constructors:
- name: 'PreServerListSetEvent'
parameters:
- name: 'entry'
type: ProfileEntry
inherits:
'ch.andre601.advancedserverlist.api.events.GenericServerListEvent':
link: '../../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent/'
list:
- 'getEntry()'
- 'setEntry(ProfileEntry)'
- 'isCancelled()'
- 'setCancelled(boolean)'
---
# <api__class></api__class> PreServerListSetEvent
Called **before** AdvancedServerList modifies the server list.
The provided [`ProfileEntry`](../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent.md#getentry()) will be the one used for the server list.
@@ -0,0 +1,17 @@
---
template: api-doc.html
inherits:
'ch.andre601.advancedserverlist.api.objects.GenericPlayer':
link: '../../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer/'
list:
- 'getName()'
- 'getProtocol()'
- 'getUUID()'
---
# <api__interface></api__interface> BungeePlayer
[`GenericPlayer` instance](../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer.md) for the BungeeCord proxy implementation of AdvancedServerList.
To get an instance of this class from a GenericPlayer instance, simply cast it to a BungeePlayer (Granted that the GenericPlayer instance actually is a BungeePlayer instance).
@@ -0,0 +1,21 @@
---
template: api-doc.html
methods:
- name: 'getServers'
description: 'Returns a <code>Map&lt;String, ServerInfo&gt;</code> where the key is the name of the server and the value the ServerInfo of the proxy.'
returns: 'Possibly-empty Map containing pairs of Strings and ServerInfos.'
type:
name: 'Map<String, ServerInfo>'
type: 'object'
inherits:
'ch.andre601.advancedserverlist.api.objects.GenericServer':
link: '../../../../api/ch.andre601.advancedserverlist.api/objects/genericserver/'
list:
- 'getPlayersOnline()'
- 'getPlayersMax()'
- 'getHost()'
---
# <api__interface></api__interface> BungeeProxy
@@ -0,0 +1,7 @@
# BungeeCord Module
The `platform-bungeecord` module contains classes for platform-specific things such as Proxy events or a Proxy-specific CachedPlayer instance.
## Module Structure
{nav}
@@ -0,0 +1,3 @@
nav:
- index.md
- ch.andre601.advancedserverlist.api.velocity: ch.andre601.advancedserverlist.api.velocity
@@ -0,0 +1,23 @@
---
template: api-doc.html
constructors:
- name: 'PreServerListSetEvent'
parameters:
- name: 'entry'
type: ProfileEntry
inherits:
'ch.andre601.advancedserverlist.api.events.GenericServerListEvent':
link: '../../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent/'
list:
- 'getEntry()'
- 'setEntry(ProfileEntry)'
- 'isCancelled()'
- 'setCancelled(boolean)'
---
# <api__class></api__class> PreServerListSetEvent
Called **before** AdvancedServerList modifies the server list.
The provided [`ProfileEntry`](../../../api/ch.andre601.advancedserverlist.api/events/genericserverlistevent.md#getentry()) will be the one used for the server list.
@@ -0,0 +1,26 @@
---
template: api-doc.html
methods:
- name: 'getVersion'
description: 'Returns the <a href="../../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer/#getprotocol()">protocol version</a> of the player in a readable MC version format (i.e. 1.19.3).'
returns: 'The readable MC version the player uses.'
type:
name: 'String'
type: 'object'
inherits:
'ch.andre601.advancedserverlist.api.objects.GenericPlayer':
link: '../../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer/'
list:
- 'getName()'
- 'getProtocol()'
- 'getUUID()'
---
# <api__interface></api__interface> VelocityPlayer
[`GenericPlayer` instance](../../../api/ch.andre601.advancedserverlist.api/objects/genericplayer.md) for the Velocity proxy implementation of AdvancedServerList.
Provides a [`getVersion()` method](#getversion()) to get the MC version used as a readable String (i.e. 1.19.3) rather than just the protocol version.
To get an instance of this class from a GenericPlayer instance, simply cast it to a VelocityPlayer (Granted that the GenericPlayer instance actually is a VelocityPlayer instance).
@@ -0,0 +1,21 @@
---
template: api-doc.html
methods:
- name: 'getServers'
description: 'Returns a <code>Map&lt;String, RegisteredServer&gt;</code> where the key is the name of the server and the value the RegisteredServer of the proxy.'
returns: 'Possibly-empty Map containing pairs of Strings and RegisteredServers.'
type:
name: 'Map<String, RegisteredServer>'
type: 'object'
inherits:
'ch.andre601.advancedserverlist.api.objects.GenericServer':
link: '../../../api/objects/genericserver/'
list:
- 'getPlayersOnline()'
- 'getPlayersMax()'
- 'getHost()'
---
# <api__interface></api__interface> VelocityProxy
@@ -0,0 +1,7 @@
# Velocity Module
The `platform-velocity` module contains classes for platform-specific things such as Proxy events or a Proxy-specific CachedPlayer instance.
## Module Structure
{nav}
+204
View File
@@ -0,0 +1,204 @@
# API Reference Docs Structure
The Reference docs follow a specific mixture of manually created and auto-generated page content.
A page may look something like this:
```markdown
---
template: api-doc.html
constructors:
- name: 'Constructor'
description: 'Creates a new instance of this class.'
methods:
- name: 'getString'
description: 'Gets a String.'
type:
name: String
type: object
---
# <api__class></api__class> Constructor
An example class to show how the page structure may look like.
```
## custom HTML tags
There is a collection of custom HTML tags that are used to render specific text in certain styles.
Below is a list of all custom tags. Note that these tags only render on the actual site and not within the repository.
- `<api__class></api__class>`: <api__class></api__class>
- `<api__interface></api__interface>`: <api__interface></api__interface>
- `<api__enum></api__enum>`: <api__enum></api__enum>
- `<api__record></api__record>`: <api__record></api__record>
- `<api__abstract></api__abstract>`: <api__abstract></api__abstract>
- `<api__static></api__static>`: <api__static></api__static>
- `<api__final></api__final>`: <api__final></api__final>
- `<api__notnull></api__notnull>`: <api__notnull></api__notnull>
- `<api__nullable></api__nullable>`: <api__nullable></api__nullable>
- `<api__deprecated></api__deprecated>`: <api__deprecated></api__deprecated>
In addition are there two classes used within `span` tags to colour the text, to indicate their type:
- `<span class="api-type__object">Object</span>`: <span class="api-type__object">Object</span>
- `<span class="api-type__primitive">Object</span>`: <span class="api-type__primitive">Primitive</span>
## Auto-generated content
The page template used checks for specific YAML frontmatter in the page to include other templates.
These templates pull the data from the YAML frontmatter to generate the page content which is then appendet to the already existing page content.
There are 5 frontmatter options, each following a specific structure:
- [`Constructors`](#constructors)
- [`Nested Classes`](#nested-classes)
- [`Enum Constants`](#enum constants)
- [`Methods`](#methods)
- [`Inherits`](#inherits)
### Constructors
```yaml
constructors:
- name: '<string>'
description: '<string>'
parameters:
- name: '<string>'
description: '<string>'
type: '<string>'
attributes:
- '<string>'
deprecated: '<string>'
throws:
- name: '<string>'
description: '<string>'
seealso:
- name: '<string>'
link: '<string>'
```
**Options:**
- `name` - The name to display for the Constructor summary and detail. This should include any parameters the Constructor has, but without any parameter name.
- `description` - The description to display for the Constructor.
- `parameters` - List of parameters to display.
- `name` - Name of the parameter to display.
- `description` - Description of the parameter.
- `type` - The type this parameter is.
- `attributes` - List of attributes (i.e. nullability) to display. The provided values will be turned into `<api__{name}></api__{name}>` tags that will be prependet to the parameter name.
- `deprecated` - Adds a notice about the deprecation of this Constructor in the form of a deprecation label and a `deprecated` section with the provided explanation.
- `throws` - List of possible throws to display.
- `name` - Name of the throw to display.
- `description` - Description of the throw.
- `seealso` - List of "See also" text to display.
- `name` - Name of the See also link.
- `link` - Link (Relative, absolute or URL) to use for the See also text.
### Nested Classes
```yaml
classes:
- name: '<string>'
description: '<string>'
type: '<string>'
link: '<string>'
```
**Options:**
- `name` - The name to display for the Nested Classes Summary.
- `description` - The description of the nested class.
- `type` - Modifier and type of the nested class.
- `link` - Link to the nested class.
### Enum Constants
```yaml
enums:
- name: '<string>'
description: '<string>'
type: '<string>'
deprecated: '<string>'
seealso:
- name: '<string>'
link: '<string>'
```
**Options:**
- `name` - The name to display for the Constructor summary and detail. This should include any parameters the Constructor has, but without any parameter name.
- `description` - The description to display for the Constructor.
- `type` - The return type to display. Will default to `{{ page.title }}` if not set.
- `deprecated` - Adds a notice about the deprecation of this Enum in the form of a deprecation label and a `deprecated` section with the provided explanation.
- `seealso` - List of "See also" text to display.
- `name` - Name of the See also link.
- `link` - Link (Relative, absolute or URL) to use for the See also text.
### Methods
```yaml
methods:
- name: '<string>'
description: '<string>'
type:
name: '<string>'
type: '<string>'
link: '<string>'
attributes:
- '<string>'
parameters:
- name: '<string>'
description: '<string>'
type: '<string>'
attributes:
- '<string>'
returns: '<string>'
deprecated: '<string>'
throws:
- name: '<string>'
description: '<string>'
seealos:
- name: '<string>'
link: '<string>'
```
**Options:**
- `name` - The name to display for the Constructor summary and detail. This should include any parameters the Constructor has, but without any parameter name.
- `description` - The description to display for the Constructor.
- `type` - Options for object type to display.
- `name` - Displayed name of the object.
- `type` - Object type. Can be either `object` or `primitive` which would be used in a class name for styling.
- `link` - Link (Relative, absolute or URL) to use for the type name.
- `attributes` - List of attributes (i.e. nullability) to display. The provided values will be turned into `<api__{name}></api__{name}>` tags that will be prependet to the name.
- `parameters` - List of parameters to display.
- `name` - Name of the parameter to display.
- `description` - Description of the parameter.
- `type` - The type this parameter is.
- `attributes` - List of attributes (i.e. nullability) to display. The provided values will be turned into `<api__{name}></api__{name}>` tags that will be prependet to the parameter name.
- `returns` - Possible return values.
- `deprecated` - Adds a notice about the deprecation of this Method in the form of a deprecation label and a `deprecated` section with the provided explanation.
- `throws` - List of possible throws to display.
- `name` - Name of the throw to display.
- `description` - Description of the throw.
- `seealso` - List of "See also" text to display.
- `name` - Name of the See also link.
- `link` - Link (Relative, absolute or URL) to use for the See also text.
### Inherits
```yaml
inherits:
'<string>':
link: '<string>'
methods:
- '<string>'
```
**Options:**
- `inherits.<string>` - Classpath used to display in the text `Methods inherited from <string>`
- `link` - Link to use for the classpath text.
- `methods` - List of strings to display. Each will be linked using `{link}#{method}`
+1
View File
@@ -0,0 +1 @@
hide: true
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

+53
View File
@@ -0,0 +1,53 @@
document$.subscribe(async () => {
const url = 'https://codeberg-stats-proxy.vercel.app/repo'
const repo_stats = document.querySelector('[data-md-component="source"] .md-source__repository');
function loadInfo(data) {
const facts = document.createElement("ul");
facts.className = "md-source__facts";
const version = document.createElement("li");
version.className = "md-source__fact md-source__fact--version";
const stars = document.createElement("li");
stars.className = "md-source__fact md-source__fact--stars";
const forks = document.createElement("li");
forks.className = "md-source__fact md-source__fact--forks";
version.innerText = data["version"];
stars.innerText = data["stars"];
forks.innerText = data["forks"];
facts.appendChild(version);
facts.appendChild(stars);
facts.appendChild(forks);
repo_stats.appendChild(facts);
}
async function fetchInfo() {
const [release, repo] = await Promise.all([
fetch(`${url}/latest-release`).then(_ => _.json()),
fetch(`${url}/stats`).then(_ => _.json()),
]);
const data = {
"version": release.name,
"stars": repo.stars,
"forks": repo.forks
};
__md_set("__git_repo", data, sessionStorage);
loadInfo(data);
}
if(!document.querySelector('[data-md-component="source"] .md-source__facts')){
const cached = __md_get("__git_repo", sessionStorage);
if((cached != null) && (cached["version"])) {
loadInfo(cached);
} else {
fetchInfo();
}
}
})
+151
View File
@@ -0,0 +1,151 @@
:root {
--api-label-border-radius: .2rem;
--api-label-padding: 0 .3em;
--color-border: #e9ebfc1f;
--color-api-fg__deprecated: #ff5252;
--color-api-bg__deprecated: #ff52521a;
--color-api-fg__static: #00c853;
--color-api-fg__final: #ff9100;
--color-api-fg__abstract: #00bfa5;
--color-api-fg__annotation: #00b8d4;
--color-api-bg__annotation: #00b8d41a;
--color-api-fg-type__object: #9e9e9e;
--color-api-fg-type__primitive: #448aff;
--color-api-bg__static: #00c8531a;
--color-api-bg__final: #ff91001a;
--color-api-bg__abstract: #00bfa51a;
}
/* Page design */
.api-detail {
border: .05rem solid var(--color-border);
border-bottom-left-radius: .1rem;
border-bottom-right-radius: .1rem;
padding: 0 1em;
margin: .5em 0;
overflow: visible;
}
.api-detail h3 {
margin: .5em 0 .8em;
}
.api-detail__description {
margin-left: 1em;
}
/* Attributes */
api__deprecated::before {
color: var(--color-api-fg__deprecated);
background-color: var(--color-api-bg__deprecated);
border-radius: var(--api-label-border-radius);
padding: var(--api-label-padding);
content: "Deprecated"
}
api__static::before {
color: var(--color-api-fg__static);
background-color: var(--color-api-bg__static);
border-radius: var(--api-label-border-radius);
padding: var(--api-label-padding);
content: "static";
}
api__final::before {
color: var(--color-api-fg__final);
background-color: var(--color-api-bg__final);
border-radius: var(--api-label-border-radius);
padding: var(--api-label-padding);
content: "final";
}
api__abstract::before {
color: var(--color-api-fg__abstract);
background-color: var(--color-api-bg__abstract);
border-radius: var(--api-label-border-radius);
padding: var(--api-label-padding);
content: "abstract";
}
/* Annotations */
api__notnull::before {
color: var(--color-api-fg__annotation);
background-color: var(--color-api-bg__annotation);
border-radius: var(--api-label-border-radius);
padding: var(--api-label-padding);
content: "@NotNull";
}
api__nullable::before {
color: var(--color-api-fg__annotation);
background-color: var(--color-api-bg__annotation);
border-radius: var(--api-label-border-radius);
padding: var(--api-label-padding);
content: "@Nullable";
}
/* class types */
api__class::before {
color: var(--color-api-fg-type__primitive);
font-weight: bold;
content: "class";
}
api__interface::before {
color: var(--color-api-fg-type__primitive);
font-weight: bold;
content: "interface";
}
api__enum::before {
color: var(--color-api-fg-type__primitive);
font-weight: bold;
content: "enum";
}
api__record::before {
color: var(--color-api-fg-type__primitive);
font-weight: bold;
content: "record";
}
/* object types */
.api-type__object {
color: var(--color-api-fg-type__object);
font-weight: bold;
}
.api-type__primitive {
color: var(--color-api-fg-type__primitive);
font-weight: bold;
}
+4
View File
@@ -40,4 +40,8 @@
/* Override mkdocs-material styling */
.md-banner--warning {
background: rgba(187,128,9,0.15);
}
.md-source__repository .md-source__facts {
animation: facts .25s ease-in;
}
+12 -2
View File
@@ -1,3 +1,7 @@
---
icon: octicons/rel-file-path-24
---
# Commands
The plugin adds commands to use for various things related to the plugin itself.
@@ -17,12 +21,18 @@ The following subcommands are available (Subcommands are case-insensitive):
### help
**Permission:** `advancedserverlist.command.help`
Shows a list of all available [subcommands](#subcommands) for AdvancedServerList.
### reload
Reloads the plugin's `config.yml`, all available YAML files in the `profiles` folder and also clears the currently cached favicons and Players.
**Permission:** `advancedserverlist.command.reload`
Reloads the plugin's `config.yml` and all available YAML files in the `profiles` folder.
### clearCache
Clears the currently cached favicons and Players.
**Permission:** `advancedserverlist.command.clearcache`
Clears the currently cached favicons and players.
+23 -17
View File
@@ -1,3 +1,9 @@
---
icon: octicons/list-unordered-24
---
# Examples
## About
!!! warning "The below examples may only work in v1.10.0 or newer!"
@@ -9,14 +15,14 @@ Feel free to suggest additional examples on my [Discord Server](https://discord.
## Table of Contents
- [Versions](#versions)
- [Different List for outdated Clients](#different-list-for-outdated-clients)
- [Different MOTD for < 1.16](#different-motd-for-116)
- [Different List for outdated Clients](#different-list-for-outdated-clients)
- [Different MOTD for < 1.16](#different-motd-for-116)
- [Spigot/PaperMC](#spigotpapermc)
- [Different profile for banned Player](#different-profile-for-banned-player)
- [Different profile for banned Player](#different-profile-for-banned-player)
- [Other](#other)
- [Different profile for different host](#different-profile-for-different-host)
- [Different profile for known player](#different-profile-for-known-player)
- [Random MOTD but same hover](#random-motd-but-same-hover)
- [Different profile for different host](#different-profile-for-different-host)
- [Different profile for known player](#different-profile-for-known-player)
- [Random MOTD but same hover](#random-motd-but-same-hover)
----
## Versions
@@ -36,8 +42,8 @@ conditions:
- '${player protocol} < 760'
motd:
- <red>You are using an outdated client!
- <red>Please update to 1.19.1 to join.
- '<red>You are using an outdated client!'
- '<red>Please update to 1.19.1 to join.'
playerCount:
text: '<red>Outdated Client!'
@@ -55,8 +61,8 @@ conditions:
- '${player protocol} < 735'
motd:
- <grey>Welcome to <aqua>YourServer.com</aqua>!
- <grey>Enjoy your stay.
- '<grey>Welcome to <aqua>YourServer.com</aqua>!'
- '<grey>Enjoy your stay.'
```
----
@@ -77,8 +83,8 @@ conditions:
- '${player isBanned} = true'
motd:
- <red>You have been <bold>BANNED</bold>!
- <red>Go away.
- '<red>You have been <bold>BANNED</bold>!'
- '<red>Go away.'
# Don't show the player count to the banned player.
playerCount:
@@ -101,8 +107,8 @@ conditions:
- '${server host} = other.example.com'
motd:
- <grey>Please use <aqua>mc.example.com
- <grey>to join our server.
- '<grey>Please use <aqua>mc.example.com'
- '<grey>to join our server.'
```
### Different profile for known player
@@ -116,8 +122,8 @@ conditions:
- `${player name} != Anonymous` # "Anonymous" should be replaced with whatever you use in 'unknown_player'
motd:
- <grey>Hello there <aqua>${player name}</aqua>!
- <grey>It's nice to see you again.
- '<grey>Hello there <aqua>${player name}</aqua>!'
- '<grey>It's nice to see you again.'
playerCount:
hover:
@@ -147,4 +153,4 @@ playerCount:
- 'This player count hover always'
- 'stays the same, no matter what'
- 'MOTD is being used here.'
```
```
+53 -23
View File
@@ -1,41 +1,71 @@
---
icon: octicons/home-24
---
# AdvancedServerList Wiki
Welcome to the Wiki of AdvancedServerList!
On this site can you find the latest documentation for the plugin, including some useful examples.
If you're new to the plugin is it recommended to check out the [Profiles page](./profiles) for a quick start on how to use this plugin.
If you're new to the plugin is it recommended to check out the [Profiles page](profiles/index.md) for a quick start on how to use this plugin.
## Downloads
[![modrinth-img]{ width="260" loading="lazy" }][modrinth-download]{ target="_blank" rel="noreferrer nofollow noopener" }
[![hangar-img]{ width="260" loading="lazy" }][hangar-download]{ target="_blank" rel="noreferrer nofollow noopener" }
[modrinth-img]: https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact/available/modrinth_vector.svg "Available on Modrinth"
[hangar-img]: https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact/available/hangar_vector.svg "Available on Hangar"
[modrinth-download]: https://modrinth.com/plugin/advancedserverlist
[hangar-download]: https://hangar.papermc.io/Andre_601/AdvancedServerList
## Platforms
AdvancedServerList supports the following platforms:
[![spigot-img](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/spigot_vector.svg "Tested on Spigot"){ width=64 }][spigot]
[![paper-img](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/paper_vector.svg "Tested on Paper"){ width=64 }][paper]
[![bungeecord-img](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/bungeecord_vector.svg "Tested on BungeeCord"){ width=64 }][spigot]
[![waterfall](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/waterfall_vector.svg "Tested on Waterfall"){ width=64 }][paper]
[![velocity](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/velocity_vector.svg "Tested on Velocity"){ width=64 }][velocity]
[![spigot-img]{ width="64" loading="lazy" }][spigot]
[![paper-img]{ width="64" loading="lazy" }][paper]
[![bungeecord-img]{ width="64" loading="lazy" }][spigot]
[![waterfall-img]{ width="64" loading="lazy" }][paper]
[![velocity-img]{ width="64" loading="lazy" }][velocity]
## Dependencies
| Dependency | Platforms | Required? |
|------------------|---------------|-----------|
| [ProtocolLib] | Spigot | Yes |
| [PlaceholderAPI] | Spigot, Paper | No |
| [ViaVersion] | Spigot, Paper | No |
## Pages
- [Profiles](./profiles)
- [Formatting](./profiles/formatting)
- [Placeholders](./profiles/placeholders)
- [API](./api)
- [Examples](./examples)
- [PlaceholderAPI placeholders](./placeholderapi.md)
[spigot-img]: https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/spigot_vector.svg "Tested on Spigot"
[paper-img]: https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/paper_vector.svg "Tested on Paper"
[bungeecord-img]: https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/bungeecord_vector.svg "Tested on BungeeCord"
[waterfall-img]: https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/waterfall_vector.svg "Tested on Waterfall"
[velocity-img]: https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/velocity_vector.svg "Tested on Velocity"
[spigot]: https://www.spigotmc.org
[paper]: https://papermc.io
[velocity]: https://velocitypowered.com
## Dependencies
| Dependency | Platforms | Required? |
|-------------------------------------------------------------------------|----------------------|-----------|
| [ProtocolLib]{ target="_blank" rel="noreferrer nofollow noopener" } | Spigot | Yes |
| [PlaceholderAPI]{ target="_blank" rel="noreferrer nofollow noopener" } | Spigot, Paper | No |
| [ViaVersion]{ target="_blank" rel="noreferrer nofollow noopener" } | Spigot, Paper | No |
| [PAPIProxyBridge]{ target="_blank" rel="noreferrer nofollow noopener" } | BungeeCord, Velocity | No |
| [Maintenance]{ target="_blank" rel="noreferrer nofollow noopener" } | All | No |
[protocollib]: https://www.spigotmc.org/resources/1997/
[placeholderapi]: https://www.spigotmc.org/resources/6245/
[viaversion]: https://www.spigotmc.org/resources/19254/
[viaversion]: https://www.spigotmc.org/resources/19254/
[papiproxybridge]: https://hangar.papermc.io/William278/PAPIProxyBridge
[maintenance]: https://hangar.papermc.io/kennytv/Maintenance
## Pages
- [Profiles](profiles/index.md)
- [Formatting](profiles/formatting.md)
- [Placeholders](profiles/placeholders.md)
- [API](api/index.md)
- [Changelog](api/changelog.md)
- [Reference](api/reference/index.md)
- [Examples](examples/index.md)
- [Migration](migration/index.md)
- [v1.5.3 to v1.6.0](migration/v1_5_3-to-v1_6_0.md)
- [v1.9.0 to v1.10.0](migration/v1_9_0-to-v1_10_0.md)
- [PlaceholderAPI](placeholderapi/index.md)
+13
View File
@@ -0,0 +1,13 @@
---
icon: octicons/file-directory-symlink-24
---
# Migration
This page lists all migration guides for specific AdvancedServerList versions.
Note that these pages only cover server list profile files. The config.yml is automatically being migrated (Feature since v3.1.0).
## Pages
{nav}
+103
View File
@@ -0,0 +1,103 @@
---
icon: octicons/arrow-right-24
---
# v1.5.3 to v1.6.0
v1.6.0 has some structural changes to the server list profile that requires you to do some updates on your files.
## Migration
The migration should be fairly simple. [An example](#example) is available to look at.
- `playerCount` is no longer a String but has been turned into a section containing the `hidePlayers` option and the following renamed options:
- `players` -\> `hover`
- `playerCount` -\> `text`
- `xMore` has been removed. There is now a new section called `extraPlayers` in the `playerCount` section as a replacement.
It contains the following options:
- `enabled` - to enable/disable the feature.
- `amount` - This is the former `xMore` option. Difference is, that it also allows negative numbers.
## Example
Here is a before and after example to help visualize the change:
=== "Before"
```yaml
priority: 0
motd:
- 'Line 1'
- 'Line 2'
favicon: '${player name}'
hidePlayers: false
players:
- 'Line 1'
- 'Line 2'
- 'Line 3'
playerCount: '<grey>Hover Me!'
xMore: 1
```
=== "After"
```yaml
priority: 0
motd:
- 'Line 1'
- 'Line 2'
favicon: '${player name}'
playerCount:
hidePlayers: false
hover:
- 'Line 1'
- 'Line 2'
- 'Line 3'
text: '<grey>Hover Me!'
extraPlayers:
enabled: true
amount: 1
```
=== "Diff view"
```diff
priority: 0
motd:
- 'Line 1'
- 'Line 2'
favicon: '${player name}'
-hidePlayers: false
-
-players:
- - 'Line 1'
- - 'Line 2'
- - 'Line 3'
-
-playerCount: '<grey>Hover Me!'
-
-xMore: 1
+playerCount:
+ hidePlayers: false
+
+ hover:
+ - 'Line 1'
+ - 'Line 2'
+ - 'Line 3'
+
+ text: '<grey>Hover Me!'
+
+ extraPlayers:
+ enabled: true
+ amount: 1
```
+103
View File
@@ -0,0 +1,103 @@
---
icon: octicons/arrow-right-24
---
# v1.9.0 to v1.10.0
v1.9.0 introduced a `motds` option to define multiple MOTDs to use.
However, this option has been removed just one update later in v1.10.0, meaning any server list profile using the `motds` option will no longer work as expected.
## Migration
To migrate all you have to do is use the new `profiles` option and add separate List entries with a `motd` option.
## Example
Here is a before and after example to help visualize the change:
=== "Before"
```yaml
priority: 0
motds:
- |-
Line 1
Line 2
- |-
Line A
Line B
favicon: '${player name}'
playerCount:
hidePlayers: false
players:
- 'Line 1'
- 'Line 2'
- 'Line 3'
text: '<grey>Hover Me!'
extraPlayers:
enabled: false
amount: 0
```
=== "After"
```yaml
priority: 0
profiles:
# You can also use motd: ['Line 1', 'Line 2']
- motd:
- 'Line 1'
- 'Line 2'
# You can also use motd: ['Line A', 'Line B']
- motd:
- 'Line A'
- 'Line B'
favicon: '${player name}'
playerCount:
hidePlayers: false
players:
- 'Line 1'
- 'Line 2'
- 'Line 3'
text: '<grey>Hover Me!'
extraPlayers:
enabled: false
amount: 0
```
=== "Diff view"
```diff
priority: 0
-motds:
- - |-
- Line 1
- Line 2
- - |-
- Line A
- Line B
+profiles:
+ # You can also use motd: ['Line 1', 'Line 2']
+ - motd:
+ - 'Line 1'
+ - 'Line 2'
+ # You can also use motd: ['Line A', 'Line B']
+ - motd:
+ - 'Line A'
+ - 'Line B'
favicon: '${player name}'
playerCount:
hidePlayers: false
players:
- 'Line 1'
- 'Line 2'
- 'Line 3'
text: '<grey>Hover Me!'
extraPlayers:
enabled: false
amount: 0
```
-18
View File
@@ -1,18 +0,0 @@
# PlaceholderAPI Placeholders
The Spigot and Paper version of AdvancedServerList provide their own set of placeholders to use through [PlaceholderAPI].
## Placeholders
!!! note
AdvancedServerList will try to find a matching Profile for the player similar to when they ping the server when using any of the below placeholders.
| Placeholder | Description |
|---------------------------|-------------------------------------------------------------------------------|
| `%asl_favicon%` | Gives the value of `favicon` from a matching Profile. |
| `%asl_extra_players_max%` | Gives the value of `playerCount.extraPlayers.amount` from a matching Profile. |
| `%asl_motd%` | Gives the value of `motd` in the matching Profile. |
| `%asl_playercount_hover%` | Gives the value of `playerCount.hover` from a matching Profile. |
| `%asl_playercount_text%` | Gives the value of `playerCount.text` from a matching Profile. |
[placeholderapi]: https://www.spigotmc.org/resources/6245/
+36
View File
@@ -0,0 +1,36 @@
---
icon: material/percent
---
# PlaceholderAPI Placeholder support
AdvancedServerList provides support for [PlaceholderAPI] placeholders to be used, while also providing its own set of placeholders.
[placeholderapi]: https://www.spigotmc.org/resources/6245/
## Own placeholders
The following list of placeholders is available for use through PlaceholderAPI.
Please note that they are only available through the Bukkit version of AdvancedServerList.
Also note, that AdvancedServerList will try to find and use a [Server List profile](../profiles/index.md) that has maching conditions for the player, before returning any placeholder values.
This means that the output of a placeholder depends on what profile (if any) matches for the player.
| Placeholder | Description |
|---------------------------|-------------------------------------------------------------------------------|
| `%asl_favicon%` | Gives the value of `favicon` from a matching Profile. |
| `%asl_extra_players_max%` | Gives the value of `playerCount.extraPlayers.amount` from a matching Profile. |
| `%asl_motd%` | Gives the value of `motd` in the matching Profile. |
| `%asl_playercount_hover%` | Gives the value of `playerCount.hover` from a matching Profile. |
| `%asl_playercount_text%` | Gives the value of `playerCount.text` from a matching Profile. |
## Using Placeholders in Server List profiles
You can use any PlaceholderAPI placeholder in a server list profile, if the following conditions are met:
- The placeholder does not require the player to be online.
- [PAPIProxyBridge] is installed alongside AdvancedServerList, if used on a Proxy.
To use a placeholder, simply use its default `%identifier_parameters%` format.
[papiproxybridge]: https://hangar.papermc.io/William278/PAPIProxyBridge
+26 -20
View File
@@ -1,27 +1,32 @@
---
icon: octicons/pencil-24
---
# Formatting
All text options with exception of [`Conditions`](../#conditions) allow the usage of formatting options using [MiniMessage].
!!! warning "IMPORTANT"
Whenever your text starts with a colour or formatting code (`<aqua>`, `<blue>`, `<bold>`, `<italic>`, etc.) should it be surrounded with single or double quotes.
Not doing so will cause the YAML parses used - Configurate - to not see the value as a String, but something else, causing exceptions to appear.
```yaml title="Wrong formatting"
motd:
- <red>This will cause
- <red>Errors
```
```yaml title="Right formatting"
motd:
- '<green>This will be formatted'
- '<green>properly.'
```
All text options, with exception of [`Conditions`](../index.md#conditions), allow the usage of formatting options using [MiniMessage].
!!! info "Online Tool"
The devs of the Adventure library provide a handy online tool to create the right formatting codes to display the text properly.
You can find the tool at https://webui.advntr.dev/
## Before starting
Please make sure to surround your text with either single quotes (`'`) or double quotes (`"`) should they start with a color or formatting code.
Not surrounding these lines with (double) quotes will make the YAML parser Configurate treat them as something other than a String.
```yaml title="Wrong formatting"
motd:
- <red>This will cause
- <red>Errors
```
```yaml title="Right formatting"
motd:
- '<green>This will be formatted'
- '<green>properly.'
```
## Unsupported options
The following options are **not** supported, no matter what option they are used in:
@@ -32,10 +37,11 @@ The following options are **not** supported, no matter what option they are used
## Colors
Normal text colours such as `<aqua>` or `<red>` can be used in all text options.
Color options (`<aqua>`, `<red>`, `<gray>`, etc.) are available for all text options.
24-Bit HEX colors (`<#ff0000>`, `<#123abc>`, etc.) are only available for the [`Motd` option](../index.md#motd) for a 1.16+ Server/Proxy.
## HEX Colours
## Formatting
24-Bit HEX colours such as `<#ffffff>` can be used in the [`Motd`](../#motd) option on 1.16+ servers/proxies.
Formatting options (`<bold>`, `<italic>`, etc.) are available for all text options.
[MiniMessage]: https://docs.adventure.kyori.net/minimessage/index.html
+65 -17
View File
@@ -1,4 +1,8 @@
# Profiles
---
icon: octicons/note-24
---
# Profiles { #profiles-settings }
AdvancedServerList allows the creation of multiple profiles.
A profile is a single YAML file located in the plugin's `profiles` directory containing multiple settings including [Conditions](#conditions) and [Priority](#priority).
@@ -25,7 +29,7 @@ This means that a profile with no conditions and a priority of `1` will be used
## Conditions
A list of conditions can be set that need to be met in order to have this profile shown to the player.
[Placeholders](./formatting#placeholders) can be used to further customize the conditions (PlaceholderAPI placeholders are **not** supported).
[Placeholders](formatting.md#placeholders) can be used to further customize the conditions (PlaceholderAPI placeholders are **not** supported).
Only when **all** conditions defined return true will the profile be displayed.
@@ -48,13 +52,16 @@ The following operants are available and can be used in the conditions.
| `~=` | Checks if the left value is equal to the right one, ignoring case. |
| `!~` | Checks if the left value is not equal to the right one, ignoring case. |
[^1]: In the case of the provided value not being a number will the plugin instead use the text length to compare with.
[^1]:
Should the provided value not be a number, will AdvancedServerList use the text length to compare.
Example: `SomeString > String` would be translated to `10 > 6`.
## Profiles
The profiles option allows you to add multiple combinations of all the other options (Except for [`Priority`](#priority) and [`Conditions`](#conditions)) to have randomized MOTDs, player counts, etc.
!!! warning "Priority and Conditions are NOT supported!"
If an option is not present in an entry will AdvancedServerList try to use one defined in the file or use whatever default value would be for that option.
The `profiles` option allows you to set multiple MOTDs, player counts, etc. which the plugin would randomly choose from.
If an option such as motd is not present in an entry will it check the file for the option and use that if present.
??? example "Example"
```yaml title="YAML file"
@@ -75,8 +82,8 @@ If an option is not present in an entry will AdvancedServerList try to use one d
```
<div class="result">
![profiles-example-1](../assets/images/examples/profiles-example-1.jpg)
![profiles-example-2](../assets/images/examples/profiles-example-2.jpg)
![profiles-example-1](../assets/images/examples/profiles-example-1.jpg){ loading="lazy" }
![profiles-example-2](../assets/images/examples/profiles-example-2.jpg){ loading="lazy" }
</div>
@@ -97,7 +104,7 @@ If you want to display multiple MOTDs will you need to use the [`Profiles` optio
```
<div class="result">
![motd-example](../assets/images/examples/motd-example.jpg)
![motd-example](../assets/images/examples/motd-example.jpg){ loading="lazy" }
</div>
@@ -128,7 +135,7 @@ Please note that AdvancedServerList will rescale the image to be 64x64 pixels, s
```
<div class="result">
![hideplayers-example](../assets/images/examples/favicon-example.jpg)
![hideplayers-example](../assets/images/examples/favicon-example.jpg){ loading="lazy" }
</div>
@@ -155,7 +162,7 @@ Additionally will the [`Text`](#text) and [`Hover`](#hover) option be ignored.
```
<div class="result">
![hideplayers-example](../assets/images/examples/hideplayers-example.jpg)
![hideplayers-example](../assets/images/examples/hideplayers-example.jpg){ loading="lazy" }
</div>
@@ -182,14 +189,14 @@ You can either remove this option or set to an empty list (`hover: []`) to not o
```
<div class="result">
![hover-example](../assets/images/examples/hover-example.jpg)
![hover-example](../assets/images/examples/hover-example.jpg){ loading="lazy" }
</div>
### Text
This option allows to override the text usually displaying the online players and total players that can join.
Note that AdvancedServerList will not add the `<online>/<max>` text to the player count. Instead will you need to use [`${server playersOnline}`](./placeholders#server) and [`${server playersMax}`](./placeholders#server) respectively.
Note that AdvancedServerList will not add the `<online>/<max>` text to the player count. Instead will you need to use [`${server playersOnline}`](placeholders.md#server) and [`${server playersMax}`](placeholders.md#server)
!!! info "Note"
This feature works by changing the "outdated server" message followed by altering the protocol version of the server.
@@ -211,7 +218,7 @@ To not override the player count, remove this option or set it to an empty Strin
```
<div class="result">
![hover-example](../assets/images/examples/text-example.jpg)
![hover-example](../assets/images/examples/text-example.jpg){ loading="lazy" }
</div>
@@ -221,12 +228,12 @@ Contains options to modify how the `<max>` number in the player count should loo
!!! warning "Using this option will modify the `${server playersMax}` placeholder (Except in conditions)"
#### Enabled
#### Enabled { #extraplayers-enabled }
Boolean option to set whether the extra players feature should be used or not.
When set to `true` will the max amount of players be modified by taking the current amount of online players, add [`Amount`](#amount) more to it and use it.
#### Amount
#### Amount { #extraplayers-amount }
Sets the number to add to the current online players to then use as the new max players count.
@@ -248,6 +255,47 @@ As an example, setting this to `1` while `10` players are online will display `1
```
<div class="result">
![hover-example](../assets/images/examples/extraplayers-example.jpg)
![extraplayers-example](../assets/images/examples/extraplayers-example.jpg){ loading="lazy" }
</div>
</div>
### MaxPlayers
Contains options to set the max number of players allowed to join the server. This has only a visual effect and won't actually influence how many players can join your server.
Note that this feature is ignored should [`extraPlayers`](#extraplayers) be enabled.
In case [`hidePlayers`](#hideplayers) is enabled will the max player count not be displayed, but still changed by this option.
Should [`text`](#text) be set to a non-empty String will the max player count only be displayed when `${server playersMax}` is used.
!!! warning "Using this option will modify the `${server playersMax}` placeholder (Except in conditions)"
#### Enabled { #maxplayers-enabled }
Boolean option to set whether the max players feature should be used or not.
When set to `true` will the value usually displaying how many players can join be changed to what you've set in the [`amount`](#maxplayers-amount) option.
#### Amount { #maxplayers-amount }
Sets the number to display as the max number of players allowed to join your server.
Note that this will also affect the `${server playersMax}` placeholder, except when it is used inside conditions.
??? example "Example"
```yaml title="YAML file"
priority: 0
# We use just colour to hide the MOTD
motd:
- '<grey>'
- '<grey>'
playerCount:
maxPlayers:
enabled: true
amount: -1
```
<div class="result">
![maxplayes-example](../assets/images/examples/maxplayers-example.jpg){ loading="lazy" }
</div>
+15 -13
View File
@@ -1,7 +1,11 @@
---
icon: material/percent
---
# Placeholders
AdvancedServerList provides a set of pre-made placeholders using the `${<identifier> <placeholder>}` format adobted from BungeeTabListPlus.
It also has built-in [PlaceholderAPI support](#placeholderapi) for Spigot and Paper Servers and since v2 can even allow you to [add your own placeholders](#custom-placeholders) by using its [API](../../api).
It also has built-in [PlaceholderAPI support](#placeholderapi) for Spigot and Paper Servers and since v2 can even allow you to [add your own placeholders](#custom-placeholders) by using its [API](../api/index.md).
## Built-in Placeholders
@@ -31,32 +35,30 @@ These placeholders use the player who pinged the server, to return values. They
These placeholders use values given by the server/proxy AdvancedServerList runs on.
| Placeholder | Description |
|---------------------------|------------------------------------------------------------|
| `${server playersOnline}` | The number of players online on this proxy/server.[^4] |
| `${server playersMax}` | The total number of players that can join this server.[^5] |
| `${server host}` | The domain/IP the player pinged.[^6] |
| Placeholder | Description |
|------------------------------|-------------------------------------------------------------------------|
| `${server playersOnline}` | The number of players online on this proxy/server.[^4] |
| `${server playersMax}` | The total number of players that can join this server.[^5] |
| `${server host}` | The domain/IP the player pinged.[^6] |
| `${server whitelistEnabled}` | Whether the whitelist is enabled or not. Only available on Spigot/Paper |
[^4]:
An space-separated list of worlds (Spigot/Paper) or Servers (BungeeCord/Velocity) can be provided to display the number of players in these worlds/servers.
Example: `${server playersOnline lobby1 lobby2}` will display the numbers of players online on the servers `lobby1` and `lobby2`.
[^5]:
When the [`amount` option](../#amount) is used will this placeholder display the modified max players count.
The only exception is [`conditions`](../#conditions) where it uses the actual max players of the server/proxy.
When the [`amount` option](../index.md#amount) is used will this placeholder display the modified max players count.
The only exception is [`conditions`](../index.md#conditions) where it uses the actual max players of the server/proxy.
[^6]:
An optional server name can be provided to display the IP/Domain associated with that server. Only works on BungeeCord/Velocity.
Example: `${server host survival}` would display the IP/Domain associated with the `survival` server.
## PlaceholderAPI
The Spigot and Paper version of AdvancedServerList allow the usage of *any* placeholders provided by PlaceholderAPI by using the `%<identifier>_<values>%` placeholder format.
Depending on the placeholder used is a cached player required (i.e. `%player_name%`). AdvancedServerList will try to get a OfflinePlayer instance based on the cached UUID from the server to manage this.
!!! warning "PlaceholderAPI placeholders can NOT be used in Conditions!"
Please visit the [PlaceholderAPI page](../placeholderapi/index.md) for how AdvancedServerList works with PlaceholderAPI.
## Custom Placeholders
Since version 2 of AdvancedServerList are developers able to provide their own placeholders to be used in a server list profile.
The format follows the same one as the [built-in placeholders](#built-in-placeholders), meaning it is `${<identifier> <placeholder>}`.
If you're a developer and want to integrate your own placeholders into AdvancedServerList, read about it [here](../../api).
If you're a developer and want to integrate your own placeholders into AdvancedServerList, read about it [here](../api/index.md).
+1
View File
@@ -0,0 +1 @@
asl.andre601.ch
@@ -1,209 +0,0 @@
/*
* 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.hangaruploader;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import org.apache.hc.client5.http.classic.HttpClient;
import org.apache.hc.client5.http.classic.methods.HttpPost;
import org.apache.hc.client5.http.entity.mime.FileBody;
import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;
import org.apache.hc.client5.http.entity.mime.StringBody;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.HttpMessage;
import org.apache.hc.core5.http.ParseException;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
public class HangarUploader{
private static final Logger LOGGER = LoggerFactory.getLogger(HangarUploader.class);
private static final String API_URL = "https://hangar.papermc.io/api/v1/";
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
private final String apiKey;
private ActiveJWT activeJWT;
public HangarUploader(String apiKey){
this.apiKey = apiKey;
}
public static void main(String[] args) throws IOException{
LOGGER.info("Starting Jar file...");
final VersionUpload.Namespace project = new VersionUpload.Namespace("Andre_601", "AdvancedServerList");
if(args.length < 3){
throw new IllegalStateException("Application requires HANGAR_TOKEN, RELEASE_TAG, PRERELEASE and RELEASE_BODY to work");
}
String apiToken = args[0];
String version = args[1].startsWith("v") ? args[1].substring(1) : args[1];
boolean isPreRelease = args[2].equalsIgnoreCase("true");
String body = System.getenv("GITHUB_RELEASE_BODY");
LOGGER.info("Version: {}", version);
LOGGER.info("Is Prerelease: {}", isPreRelease);
LOGGER.info("Release Message: {}", body);
final List<Path> filePaths = List.of(
new File("bukkit/target/AdvancedServerList-Bukkit-" + version + ".jar").toPath(),
new File("bungeecord/target/AdvancedServerList-BungeeCord-" + version + ".jar").toPath(),
new File("velocity/target/AdvancedServerList-Velocity-" + version + ".jar").toPath()
);
final List<VersionUpload.PluginDependency> paperDependencies = List.of(
VersionUpload.PluginDependency.createWithHangarNamespace(
"ViaVersion",
false,
new VersionUpload.Namespace("ViaVersion", "ViaVersion")
),
VersionUpload.PluginDependency.createWithExternalUrl(
"PlaceholderAPI",
false,
"https://www.spigotmc.org/resources/6245/"
)
);
final List<VersionUpload.MultipartFileOrUrl> fileInfo = List.of(
new VersionUpload.MultipartFileOrUrl(List.of(VersionUpload.Platform.PAPER), null),
new VersionUpload.MultipartFileOrUrl(List.of(VersionUpload.Platform.WATERFALL), null),
new VersionUpload.MultipartFileOrUrl(List.of(VersionUpload.Platform.VELOCITY), null)
);
final VersionUpload versionUpload = new VersionUpload(
version,
Map.of(
VersionUpload.Platform.PAPER, paperDependencies,
VersionUpload.Platform.WATERFALL, List.of(),
VersionUpload.Platform.VELOCITY, List.of()
),
Map.of(
VersionUpload.Platform.PAPER, List.of("1.19.x", "1.20.x"),
VersionUpload.Platform.WATERFALL, List.of("1.19.x", "1.20.x"),
VersionUpload.Platform.VELOCITY, List.of("3.1")
),
body,
fileInfo,
isPreRelease ? "Beta" : "Release"
);
HangarUploader uploader = new HangarUploader(apiToken);
try(CloseableHttpClient client = HttpClients.createDefault()){
uploader.uploadVersion(client, project, versionUpload, filePaths);
}catch(ParseException ex){
LOGGER.error("Encountered ParseException while performing a request.", ex);
}
}
public void uploadVersion(HttpClient client, VersionUpload.Namespace namespace, VersionUpload versionUpload,
List<Path> filePaths) throws IOException, ParseException{
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.addPart("versionUpload", new StringBody(GSON.toJson(versionUpload), ContentType.APPLICATION_JSON));
for(Path path : filePaths){
builder.addPart("files", new FileBody(path.toFile(), ContentType.DEFAULT_BINARY));
}
HttpPost post = new HttpPost(API_URL + "projects/" + namespace + "/upload");
post.setEntity(builder.build());
this.addAuthHeader(client, post);
LOGGER.info("Uploading release...");
final boolean success = client.execute(post, response -> {
if(response.getCode() != 200){
LOGGER.error("Error while uploading version. Received response code {}: {}", response.getCode(), response.getReasonPhrase());
LOGGER.error("Body: {}", EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8));
return false;
}
return true;
});
if(!success){
throw new RuntimeException("Error uploading version!");
}
LOGGER.info("Upload complete!");
System.exit(0);
}
private synchronized void addAuthHeader(HttpClient client, HttpMessage message) throws IOException{
LOGGER.info("Applying Authorization Header...");
if(this.activeJWT != null && !this.activeJWT.hasExpired()){
message.addHeader("Authorization", this.activeJWT.jwt());
LOGGER.info("Authorization Header applied. Expires at {}", getDate(this.activeJWT.expiresAt()));
return;
}
LOGGER.info("Current JWT expired. Requesting new one...");
ActiveJWT jwt = client.execute(new HttpPost(API_URL + "authenticate?apiKey=" + this.apiKey), response -> {
if(response.getCode() == 400){
LOGGER.error("Bad JWT request; is the API-token valid?");
return null;
}else
if(response.getCode() != 200){
LOGGER.error("Received non-successful response code {}: {}", response.getCode(), response.getReasonPhrase());
return null;
}
final String json = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
final JsonObject jsonObject = GSON.fromJson(json, JsonObject.class);
final String token = jsonObject.getAsJsonPrimitive("token").getAsString();
final long expiresIn = jsonObject.getAsJsonPrimitive("expiresIn").getAsLong();
LOGGER.info("Received new JWT!");
return new ActiveJWT(token, System.currentTimeMillis() + expiresIn);
});
if(jwt == null){
throw new RuntimeException("Error getting JWT.");
}
this.activeJWT = jwt;
LOGGER.info("Authorization Header applied. Expires at {}", getDate(this.activeJWT.expiresAt()));
message.addHeader("Authorization", jwt.jwt());
}
private synchronized String getDate(long timestamp){
return timestamp + " (" + new Date(timestamp) + ")";
}
private record ActiveJWT(String jwt, long expiresAt){
public boolean hasExpired(){
return System.currentTimeMillis() < this.expiresAt + TimeUnit.SECONDS.toMillis(3);
}
}
}
@@ -1,66 +0,0 @@
/*
* 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.hangaruploader;
import java.util.List;
import java.util.Map;
public record VersionUpload(String version, Map<Platform, List<PluginDependency>> pluginDependencies,
Map<Platform, List<String>> platformDependencies, String description,
List<MultipartFileOrUrl> files, String channel){
public record Namespace(String owner, String slug){
@Override
public String toString(){
return this.owner + "/" + this.slug;
}
}
public record PluginDependency(String name, boolean required, Namespace namespace, String externalUrl){
public PluginDependency{
if(namespace == null && externalUrl == null)
throw new IllegalStateException("Either a Hangar Namespace or an external URL needs to be defined.");
}
public static PluginDependency createWithHangarNamespace(String name, boolean required, Namespace namespace){
return new PluginDependency(name, required, namespace, null);
}
public static PluginDependency createWithExternalUrl(String name, boolean required, String externalUrl){
return new PluginDependency(name, required, null, externalUrl);
}
}
public record MultipartFileOrUrl(List<Platform> platforms, String externalUrl){}
public enum Platform{
PAPER,
WATERFALL,
VELOCITY
}
}
+37 -36
View File
@@ -1,30 +1,23 @@
site_name: AdvancedServerList Wiki
site_description: 'Wiki for the AdvancedServerList plugin'
site_author: 'Andre_601'
site_url: 'https://www.andre601.ch/AdvancedServerList' # Uncomment to set a canonical URL
site_url: 'https://asl.andre601.ch'
copyright: |
&copy; Andre_601
Images &copy; Andre_601<br>
Docs licensed under <a href="https://codeberg.org/Andre601/AdvancedServerList/src/branch/master/LICENSE" target="_blank" rel="noopener noreferrer noopener">MIT</a>
docs_dir: docs/
repo_name: Andre601/AdvancedServerList
repo_url: https://github.com/Andre601/AdvancedServerList
repo_url: https://codeberg.org/Andre601/AdvancedServerList
nav:
- Home: index.md
- Profiles:
- profiles/index.md
- Formatting: profiles/formatting.md
- Placeholders: profiles/placeholders.md
- API:
- api/index.md
- Changelog: api/changelog.md
- Examples: examples.md
- PlaceholderAPI: placeholderapi.md
not_in_nav: |
api/reference/structure.md
theme:
name: 'material'
custom_dir: 'docs/.overrides'
favicon: 'assets/images/favicon.png'
logo: 'assets/images/favicon.png'
palette:
@@ -38,37 +31,44 @@ theme:
- content.code.copy
icon:
repo: 'octicons/mark-github-16'
repo: 'simple/codeberg'
admonition:
note: 'octicons/tag-16'
abstract: 'octicons/checklist-16'
info: 'octicons/info-16'
tip: 'octicons/squirrel-16'
success: 'octicons/check-16'
question: 'octicons/question-16'
warning: 'octicons/alert-16'
failure: 'octicons/x-circle-16'
danger: 'octicons/zap-16'
bug: 'octicons/bug-16'
example: 'octicons/beaker-16'
quote: 'octicons/quote-16'
note: 'octicons/tag-24'
abstract: 'octicons/checklist-24'
info: 'octicons/info-24'
tip: 'octicons/squirrel-24'
success: 'octicons/check-24'
question: 'octicons/question-24'
warning: 'octicons/alert-24'
failure: 'octicons/x-circle-24'
danger: 'octicons/zap-24'
bug: 'octicons/bug-24'
example: 'octicons/beaker-24'
quote: 'octicons/quote-24'
extra_css:
- assets/stylesheets/custom.css
- assets/stylesheets/api-docs.css
extra_javascript:
- assets/js/repo-stats.js
extra:
github_repository: !ENV [GITHUB_REPO_INSTANCE, False]
social:
- icon: 'fontawesome/brands/github'
link: 'https://github.com/Andre601/asl-wiki'
version:
provider: 'mike'
default:
- latest
- dev
- icon: 'simple/codeberg'
link: 'https://codeberg.org/Andre601/AdvancedServerList'
- icon: 'simple/modrinth'
link: 'https://modrinth.com/plugin/advancedserverlist'
- icon: 'fontawesome/solid/paper-plane'
link: 'https://hangar.papermc.io/Andre_601/AdvancedServerList'
plugins:
- search
- glightbox
- awesome-pages:
filename: .pages.yml
- pagenav-generator
markdown_extensions:
- markdown.extensions.admonition:
@@ -76,9 +76,10 @@ markdown_extensions:
permalink: true
- markdown.extensions.attr_list:
- markdown.extensions.footnotes:
- markdown.extensions.md_in_html:
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.highlight:
- pymdownx.magiclink:
- pymdownx.superfences:
+3 -17
View File
@@ -38,29 +38,15 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.commit/>
<plugin.version>3.2.0</plugin.version>
<plugin.version>3.5.0</plugin.version>
<plugin.description>Create multiple Server lists based on conditions.</plugin.description>
<api.version>v3.0.0</api.version>
<api.version>v3.1.0</api.version>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<profiles>
<profile>
<id>gh-actions</id>
<activation>
<property>
<name>env.COMMIT_SHA</name>
</property>
</activation>
<properties>
<project.build.commit>_${env.COMMIT_SHA}</project.build.commit>
</properties>
</profile>
</profiles>
<repositories>
<repository>
<id>jitpack</id>
@@ -73,6 +59,6 @@
<module>bungeecord</module>
<module>bukkit</module>
<module>velocity</module>
<module>hangar-uploader</module>
<module>version-uploader</module>
</modules>
</project>
+57
View File
@@ -0,0 +1,57 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"labels": ["PR Type/Dependency Update"],
"ignoreDeps": [
"ch.andre601.advancedserverlist:parent",
"ch.andre601.advancedserverlist:core"
],
"packageRules": [
{
"description": "Use a specific registry URL for specific dependencies",
"matchPackageNames": [
"ch.andre601.asl-api:platform-bukkit",
"ch.andre601.asl-api:platform-bungeecord",
"ch.andre601.asl-api:platform-velocity",
"ch.andre601.asl-api:api"
],
"registryUrls": [
"https://jitpack.io"
]
},
{
"description": "Apply label for Bukkit platform",
"matchFileNames": ["bukkit/pom.xml"],
"addLabels": ["PR Target/Bukkit"]
},
{
"description": "Apply label for BungeeCord platform",
"matchFileNames": ["bungeecord/pom.xml"],
"addLabels": ["PR Target/BungeeCord"]
},
{
"description": "Apply label for Core platform",
"matchFileNames": ["core/pom.xml"],
"addLabels": ["PR Target/Core"]
},
{
"description": "Apply label for Velocity platform",
"matchFileNames": ["velocity/pom.xml"],
"addLabels": ["PR Target/Velocity"]
},
{
"description": "Apply label for GitHub Actions",
"matchFileNames": [".github/workflows/*.yml"],
"addLabels": ["PR Target/GitHub Action"]
},
{
"description": "Apply label for MkDocs",
"matchFileNames": ["requirements.txt"],
"addLabels": ["PR Target/MkDocs"]
},
{
"description": "Apply label for Woodpecker-CI",
"matchFileNames": [".woodpecker/*.yml"],
"addLabels": ["PR Target/Woodpecker-CI"]
}
]
}
+4 -2
View File
@@ -1,2 +1,4 @@
mkdocs-material==9.1.16
mkdocs-glightbox==0.3.4
mkdocs-material==9.4.1
mkdocs-glightbox==0.3.4
mkdocs-awesome-pages-plugin==2.9.2
git+https://github.com/Andre601/mkdocs-pagenav-generator
+2 -2
View File
@@ -90,7 +90,7 @@
</dependencies>
<build>
<finalName>AdvancedServerList-Velocity-${plugin.version}${project.build.commit}</finalName>
<finalName>AdvancedServerList-Velocity-${plugin.version}</finalName>
<resources>
<resource>
<filtering>true</filtering>
@@ -106,7 +106,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
@@ -28,6 +28,7 @@ package ch.andre601.advancedserverlist.velocity.listeners;
import ch.andre601.advancedserverlist.api.events.GenericServerListEvent;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
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;
@@ -37,6 +38,7 @@ import ch.andre601.advancedserverlist.velocity.VelocityCore;
import ch.andre601.advancedserverlist.velocity.objects.VelocityPlayerImpl;
import ch.andre601.advancedserverlist.velocity.objects.VelocityProxyImpl;
import com.velocitypowered.api.event.proxy.ProxyPingEvent;
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.server.RegisteredServer;
import com.velocitypowered.api.proxy.server.ServerPing;
import com.velocitypowered.api.util.Favicon;
@@ -130,6 +132,14 @@ public class VelocityEventWrapper implements GenericEventWrapper<Favicon, Veloci
return protocol == null;
}
@Override
public boolean isMaintenanceModeActive(){
if(!plugin.getProxy().getPluginManager().isLoaded("maintenance"))
return false;
return PingEventHandler.getMaintenanceUtil().isMaintenanceEnabled();
}
@Override
public int getProtocolVersion(){
return protocol.getProtocol();
@@ -152,7 +162,25 @@ public class VelocityEventWrapper implements GenericEventWrapper<Favicon, Veloci
@Override
public String parsePAPIPlaceholders(String text, VelocityPlayerImpl player){
return text;
if(!plugin.getProxy().getPluginManager().isLoaded("papiproxybridge"))
return text;
if(!PingEventHandler.getPAPIUtil().isCompatible())
return text;
String server = PingEventHandler.getPAPIUtil().getServer();
if(server == null || server.isEmpty())
return text;
RegisteredServer registeredServer = plugin.getProxy().getServer(server).orElse(null);
if(registeredServer == null || registeredServer.getPlayersConnected().isEmpty())
return text;
Player carrier = PingEventHandler.getPAPIUtil().getPlayer(registeredServer.getPlayersConnected());
if(carrier == null)
return text;
return PingEventHandler.getPAPIUtil().parse(text, carrier.getUniqueId(), player.getUUID());
}
@Override
@@ -6,5 +6,15 @@
"authors": [
"Andre_601"
],
"dependencies": [
{
"id": "papiproxybridge",
"optional": true
},
{
"id": "maintenance",
"optional": true
}
],
"main": "ch.andre601.advancedserverlist.velocity.VelocityCore"
}
Loaded 100 of 114 files, more files were not shown because too many files have changed in this diff. Show more