mirror of
https://codeberg.org/Andre601/AdvancedServerList.git
synced 2026-11-05 17:02:34 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fc0ad97fc | ||
|
|
3ae02167b9 | ||
|
|
e407b38565 | ||
|
|
c98d52ed46 | ||
|
|
266913e4b4 | ||
|
|
a3d4a009a5 | ||
|
|
18e00d082e | ||
|
|
6a3979743b | ||
|
|
3a29ad54ca | ||
|
|
987c520160 | ||
|
|
4b6197f6e0 | ||
|
|
01611d4130 | ||
|
|
531aa65fcc | ||
|
|
fb101c4a14 | ||
|
|
7bd97f5f5a | ||
|
|
52c3edd0ea | ||
|
|
368e544051 | ||
|
|
12b2f5a208 | ||
|
|
adc88a8640 | ||
|
|
817db44492 | ||
|
|
f74f7dfa6b | ||
|
|
e9c8730090 | ||
|
|
861ada0396 | ||
|
|
a2fb9c3d81 | ||
|
|
f747461018 | ||
|
|
f408146d57 | ||
|
|
c684001fcf | ||
|
|
6dc53c8c4f | ||
|
|
64ab958c67 | ||
|
|
7a66c9a0c9 | ||
|
|
0ff658632a | ||
|
|
ee32347bd0 | ||
|
|
9e11038e98 | ||
|
|
008ddbb98a | ||
|
|
f084c17d76 | ||
|
|
9dd73aec9d | ||
|
|
3ebf151f3a | ||
|
|
872c194a62 | ||
|
|
d122603c70 | ||
|
|
489fce2031 | ||
|
|
1651151f26 | ||
|
|
aa61ea826f | ||
|
|
0877eb4187 | ||
|
|
6e89cdb3cc | ||
|
|
1eb0b30356 | ||
|
|
417f5dc5d0 | ||
|
|
01a73b9ea3 | ||
|
|
c06788a55c | ||
|
|
fd924107bc | ||
|
|
dce90b91f0 | ||
|
|
aa968b7d25 | ||
|
|
137d089e4a | ||
|
|
bfa27f92e1 | ||
|
|
b405706b50 | ||
|
|
89f44d7bec | ||
|
|
28e9b6ed96 | ||
|
|
19b3eec401 | ||
|
|
c712b3b715 | ||
|
|
5c379c3b13 | ||
|
|
f6f48708d9 | ||
|
|
83890fa5cb | ||
|
|
d7653a6a6f | ||
|
|
676c4c8f1f | ||
|
|
b66870c942 | ||
|
|
af97a0dac2 | ||
|
|
d43ef090ef | ||
|
|
e7451ae567 | ||
|
|
cf4f095624 | ||
|
|
9280809ab0 | ||
|
|
875ae4d43d | ||
|
|
dbd45ac65e | ||
|
|
7c15778ebc | ||
|
|
2699856a75 | ||
|
|
b49c105620 | ||
|
|
2ffbfeec48 | ||
|
|
bd885e25e2 | ||
|
|
e2c6eb142c | ||
|
|
db11e42c6d | ||
|
|
36e5829943 | ||
|
|
7bbb2bbfa7 | ||
|
|
6acd536f43 | ||
|
|
64d1440ad2 | ||
|
|
6f1dd78aa7 | ||
|
|
4330978816 | ||
|
|
935603b852 | ||
|
|
9671938a66 | ||
|
|
5cc974eb9c | ||
|
|
e526cc6750 | ||
|
|
34fea78b01 | ||
|
|
072547005c | ||
|
|
cdb5852e8b | ||
|
|
050477c19f | ||
|
|
52b24bb3e9 | ||
|
|
df8a063369 | ||
|
|
3fc4a788b8 | ||
|
|
15e5108ec7 | ||
|
|
b8fa694e26 | ||
|
|
f1b55cba79 | ||
|
|
e76dd78cd5 | ||
|
|
09a668493b | ||
|
|
1ef466d2a4 | ||
|
|
e15ddbf2d4 | ||
|
|
1c0ce073e5 | ||
|
|
5964be18ed | ||
|
|
06ad4f106b | ||
|
|
adf343468f | ||
|
|
5a0bb3ce03 | ||
|
|
b3edb2833e | ||
|
|
83c2017544 | ||
|
|
42ecf8ec2a | ||
|
|
fe53c28f77 | ||
|
|
44e8b395f5 | ||
|
|
13828897a2 | ||
|
|
965a9898ca | ||
|
|
d3c9d1e7e2 | ||
|
|
ff3df14a90 | ||
|
|
374f477645 | ||
|
|
11bcbc7918 | ||
|
|
f91f77dba0 | ||
|
|
ac36bc7c6c | ||
|
|
184aa7cd83 | ||
|
|
e20a80b410 | ||
|
|
43f5cbdcf1 | ||
|
|
7c8d6067f5 | ||
|
|
5500239146 | ||
|
|
62844f3111 | ||
|
|
37df1c6376 | ||
|
|
abe1dea027 | ||
|
|
66500050fe | ||
|
|
2bc2f11fb1 | ||
|
|
4b88c78036 | ||
|
|
5a98301b7d | ||
|
|
2cf7fd4ffc | ||
|
|
83349e1c37 | ||
|
|
d928991ca5 | ||
|
|
8b3cd0fcee | ||
|
|
2afd7483df | ||
|
|
ae108d1bed | ||
|
|
37e343e92e | ||
|
|
8b01a12ef9 | ||
|
|
91ea80fbde | ||
|
|
deec676180 | ||
|
|
5fb22a505f | ||
|
|
539a1300d2 | ||
|
|
915fe7b134 | ||
|
|
da393a66c1 | ||
|
|
6563b93721 | ||
|
|
c8e51ab82e | ||
|
|
435fbe721d | ||
|
|
3677e90ad1 | ||
|
|
cd96a87028 | ||
|
|
3b1e5244e4 | ||
|
|
07a1baff36 | ||
|
|
c87f6d5a0d | ||
|
|
36f6c41059 | ||
|
|
fa0170fa16 | ||
|
|
c66936861f | ||
|
|
8933c39ce0 | ||
|
|
34865b5bb8 | ||
|
|
271ebed7b6 | ||
|
|
08e7eca34f | ||
|
|
0162bcdaaf | ||
|
|
39e76862d5 | ||
|
|
a7aeffa52a | ||
|
|
9f847ca1db | ||
|
|
6f4a429123 | ||
|
|
60db6eb445 | ||
|
|
5c06fec00a | ||
|
|
12eb80d4d7 | ||
|
|
c371bf323c | ||
|
|
8dca20c73d | ||
|
|
aabfb5273e | ||
|
|
a282382402 | ||
|
|
e86733052b | ||
|
|
a112036c2e | ||
|
|
6c07bfb5a3 | ||
|
|
7668a3e881 | ||
|
|
f53f2c724d | ||
|
|
5ea6f9307c | ||
|
|
8bdaa232ca | ||
|
|
1ad945a1a9 | ||
|
|
85d11e7896 | ||
|
|
bcd940d808 | ||
|
|
dd837b96e8 | ||
|
|
57295756fc | ||
|
|
9f1307f559 | ||
|
|
c489764b06 | ||
|
|
845b1b2022 | ||
|
|
3662a66ec9 | ||
|
|
e1e0083633 | ||
|
|
58e4624cf5 | ||
|
|
df069ebcdc | ||
|
|
82f2c476d8 | ||
|
|
3545cac908 | ||
|
|
cb95b833e6 | ||
|
|
e2c1c44537 | ||
|
|
aeb0587263 | ||
|
|
3471876687 | ||
|
|
82d58564ee | ||
|
|
d3918a487a | ||
|
|
a25232be6a | ||
|
|
bfa05f943a | ||
|
|
dc40a54999 | ||
|
|
682621e196 | ||
|
|
41fa678591 | ||
|
|
e7557da944 | ||
|
|
c7c9885e18 | ||
|
|
62c665a598 | ||
|
|
6d687d391d | ||
|
|
2ac6b89368 | ||
|
|
b8d4829e02 | ||
|
|
a9b4355ebf | ||
|
|
b7f3ecdc5d | ||
|
|
0428280480 | ||
|
|
31e7fb9a22 | ||
|
|
b3fc768ea7 | ||
|
|
7b990e798d | ||
|
|
7e1e00d246 | ||
|
|
15677e948d | ||
|
|
457f85d697 | ||
|
|
f3a3df648f | ||
|
|
000f3dd680 | ||
|
|
db3b0e39b5 | ||
|
|
e5a5cf9f7e | ||
|
|
0c3853de2b | ||
|
|
0146e594de | ||
|
|
1a790bca41 | ||
|
|
fc039ebe93 | ||
|
|
22561f6848 | ||
|
|
8a7ccc07ae | ||
|
|
b43f7b9f31 | ||
|
|
69b3086c65 | ||
|
|
e5b05b5859 | ||
|
|
a07994adb1 | ||
|
|
8d83b45657 | ||
|
|
22371715c5 | ||
|
|
8a7d042476 | ||
|
|
26205cdd67 | ||
|
|
ccb9cd5522 | ||
|
|
2383214b7e | ||
|
|
a82b6bf0e9 | ||
|
|
3e541e65ed | ||
|
|
314becdc45 | ||
|
|
8f662ced5c | ||
|
|
3ff782e128 | ||
|
|
6a6a708ee7 | ||
|
|
1751a77e6f | ||
|
|
3069244f21 | ||
|
|
99d4232304 | ||
|
|
ec408316bd | ||
|
|
eee5271966 | ||
|
|
34e4816517 | ||
|
|
7bde6dedb5 | ||
|
|
6864f57917 | ||
|
|
0b705ca897 | ||
|
|
4661d72f8c | ||
|
|
2b7053c724 | ||
|
|
8d81367354 | ||
|
|
facb358404 | ||
|
|
fd49e101ca | ||
|
|
a55e19bb4a | ||
|
|
07c1893895 | ||
|
|
eed3c37bcb | ||
|
|
42d9a54668 | ||
|
|
51811452fd | ||
|
|
0b21958826 | ||
|
|
f3fdc68dce | ||
|
|
3b76a2abdd | ||
|
|
87964d42a7 | ||
|
|
2529195097 | ||
|
|
62e54fe9ea | ||
|
|
ad49a0659e | ||
|
|
a703fba542 | ||
|
|
bc57b549d5 | ||
|
|
eed64e0f60 | ||
|
|
a673050489 | ||
|
|
d07890112d | ||
|
|
9cbd7fb6b7 | ||
|
|
5055c89cde | ||
|
|
eb04cab549 | ||
|
|
db2e56a382 | ||
|
|
71313afb01 | ||
|
|
039f2f7b8a | ||
|
|
b34c7b3cec | ||
|
|
40e1fb1f02 | ||
|
|
9292a46a86 | ||
|
|
fbb7e0f103 | ||
|
|
c6b6187fe8 | ||
|
|
937929c3c5 | ||
|
|
04534e18c3 | ||
|
|
6a3adee315 | ||
|
|
dddea9c022 | ||
|
|
a5029f22ad | ||
|
|
e425ae4ce3 | ||
|
|
48163610a4 | ||
|
|
78fc37c2d7 |
No files matched your search
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
@@ -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:
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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'
|
||||
@@ -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/**"]
|
||||
@@ -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 }}
|
||||
@@ -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
|
||||
@@ -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 }}
|
||||
@@ -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 }}
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
@@ -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>
|
||||
|
||||
+9
@@ -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();
|
||||
|
||||
+9
@@ -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,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:
|
||||
|
||||
@@ -20,6 +20,7 @@ libraries:
|
||||
softdepend:
|
||||
- 'ProtocolLib'
|
||||
- 'PlaceholderAPI'
|
||||
- 'Maintenance'
|
||||
|
||||
commands:
|
||||
advancedserverlist:
|
||||
|
||||
+8
-8
@@ -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>
|
||||
|
||||
+29
-1
@@ -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
|
||||
|
||||
@@ -3,4 +3,8 @@ author: 'Andre_601'
|
||||
version: '${plugin.version}'
|
||||
description: '${plugin.description}'
|
||||
|
||||
softDepends:
|
||||
- PAPIProxyBridge
|
||||
- Maintenance
|
||||
|
||||
main: 'ch.andre601.advancedserverlist.bungeecord.BungeeCordCore'
|
||||
+23
-3
@@ -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();
|
||||
|
||||
+6
-12
@@ -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;
|
||||
|
||||
+42
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
+28
-3
@@ -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());
|
||||
}
|
||||
}
|
||||
+2
@@ -59,6 +59,8 @@ public interface GenericEventWrapper<F, P extends GenericPlayer>{
|
||||
|
||||
boolean isInvalidProtocol();
|
||||
|
||||
boolean isMaintenanceModeActive();
|
||||
|
||||
int getProtocolVersion();
|
||||
|
||||
int getOnlinePlayers();
|
||||
|
||||
+28
-15
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
+12
-6
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
+28
-7
@@ -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();
|
||||
}
|
||||
}
|
||||
+5
-3
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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 %}
|
||||
@@ -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" %}
|
||||
@@ -0,0 +1,8 @@
|
||||
nav:
|
||||
- Home: index.md
|
||||
- commands
|
||||
- profiles
|
||||
- examples
|
||||
- migration
|
||||
- api
|
||||
- PlaceholderAPI: placeholderapi
|
||||
@@ -0,0 +1,2 @@
|
||||
nav:
|
||||
- ...
|
||||
+34
-5
@@ -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
@@ -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
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
nav:
|
||||
- index.md
|
||||
- api: api
|
||||
- platform-bukkit: platform-bukkit
|
||||
- platform-bungeecord: platform-bungeecord
|
||||
- platform-velocity: platform-velocity
|
||||
@@ -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.
|
||||
+45
@@ -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.
|
||||
+13
@@ -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>${<identifier> <placeholder>}</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.
|
||||
+193
@@ -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).
|
||||
+204
@@ -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.
|
||||
@@ -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}
|
||||
@@ -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
|
||||
+36
@@ -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.
|
||||
+50
@@ -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).
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
---
|
||||
template: api-doc.html
|
||||
|
||||
methods:
|
||||
- name: 'getWorlds'
|
||||
description: 'Returns a <code>Map<String, World></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
|
||||
+24
@@ -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.
|
||||
+17
@@ -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).
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
---
|
||||
template: api-doc.html
|
||||
|
||||
methods:
|
||||
- name: 'getServers'
|
||||
description: 'Returns a <code>Map<String, ServerInfo></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
|
||||
+23
@@ -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.
|
||||
+26
@@ -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).
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
---
|
||||
template: api-doc.html
|
||||
|
||||
methods:
|
||||
- name: 'getServers'
|
||||
description: 'Returns a <code>Map<String, RegisteredServer></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}
|
||||
@@ -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}`
|
||||
@@ -0,0 +1 @@
|
||||
hide: true
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -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();
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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.
|
||||
@@ -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
@@ -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:
|
||||
|
||||
[{ width=64 }][spigot]
|
||||
[{ width=64 }][paper]
|
||||
[{ width=64 }][spigot]
|
||||
[{ width=64 }][paper]
|
||||
[{ 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)
|
||||
@@ -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}
|
||||
@@ -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
|
||||
```
|
||||
@@ -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
|
||||
```
|
||||
@@ -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/
|
||||
@@ -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
@@ -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
@@ -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">
|
||||
|
||||

|
||||

|
||||
{ loading="lazy" }
|
||||
{ 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">
|
||||
|
||||

|
||||
{ loading="lazy" }
|
||||
|
||||
</div>
|
||||
|
||||
@@ -128,7 +135,7 @@ Please note that AdvancedServerList will rescale the image to be 64x64 pixels, s
|
||||
```
|
||||
<div class="result">
|
||||
|
||||

|
||||
{ loading="lazy" }
|
||||
|
||||
</div>
|
||||
|
||||
@@ -155,7 +162,7 @@ Additionally will the [`Text`](#text) and [`Hover`](#hover) option be ignored.
|
||||
```
|
||||
<div class="result">
|
||||
|
||||

|
||||
{ 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">
|
||||
|
||||

|
||||
{ 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">
|
||||
|
||||

|
||||
{ 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">
|
||||
|
||||

|
||||
{ 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">
|
||||
|
||||
{ loading="lazy" }
|
||||
|
||||
</div>
|
||||
@@ -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).
|
||||
-209
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
-66
@@ -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
@@ -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: |
|
||||
© Andre_601
|
||||
Images © 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:
|
||||
|
||||
@@ -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>
|
||||
@@ -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
@@ -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
@@ -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>
|
||||
|
||||
+29
-1
@@ -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
Reference in new issue
Block a user