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 |
No files matched your search
@@ -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'
|
||||
@@ -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@v4
|
||||
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@v4
|
||||
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,16 +6,31 @@ 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@v4
|
||||
- name: Set up Python 3.7
|
||||
@@ -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@v4
|
||||
- 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,125 +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@v4
|
||||
- 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
|
||||
dependencies: 'papiproxybridge@1.3(optional)'
|
||||
- platforms: Spigot, Paper, Folia
|
||||
directory: bukkit
|
||||
loaders: |
|
||||
spigot
|
||||
paper
|
||||
folia
|
||||
dependencies: ''
|
||||
- platforms: Velocity
|
||||
directory: velocity
|
||||
loaders: velocity
|
||||
dependencies: 'papiproxybridge@1.3(optional)'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- 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
|
||||
dependencies: ${{ matrix.dependencies }}
|
||||
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
|
||||
dependencies: ${{ matrix.dependencies }}
|
||||
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 }}
|
||||
@@ -5,54 +5,31 @@ when:
|
||||
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
|
||||
#uploadFiles:
|
||||
# image: badouralix/curl-jq
|
||||
# secrets:
|
||||
# - cb_token
|
||||
# commands:
|
||||
# # Get release info and setup env vars.
|
||||
# - |-
|
||||
# export JSON=`curl --location "https://codeberg.org/api/v1/repos/Andre601/AdvancedServerList/releases?limit=10" \
|
||||
# --header 'Authorization: token $CB_TOKEN' \
|
||||
# --header 'Accept: application/json' -s -S \
|
||||
# --fail-with-body | jq ".[] | select (.tag_name==\"$CI_COMMIT_TAG\").")`
|
||||
# - export PLUGIN_CHANGELOG=$( echo $JSON | jq -r '.body' )
|
||||
# - export PLUGIN_PRE_RELEASE=$( echo $JSON | jq -r '.prerelease' )
|
||||
# - export RELEASE_ID=$( echo $JSON | jq -r '.id' )
|
||||
# # Upload release assets to Codeberg release
|
||||
# - |-
|
||||
# curl -X POST --location "https://codeberg.org/api/v1/repos/Andre601/AdvancedServerList/releases/$RELEASE_ID/assets" \
|
||||
# --header "Authorization: token $CB_TOKEN" \
|
||||
# --header "Content-Type: multipart/form-data" -s -S \
|
||||
# --form "attachment=@bukkit/target/AdvancedServerList-Bukkit-${CI_COMMIT_TAG##v}.jar;type=application/octet-stream" \
|
||||
# --fail-with-body
|
||||
# - |-
|
||||
# curl -X POST --location "https://codeberg.org/api/v1/repos/Andre601/AdvancedServerList/releases/$RELEASE_ID/assets" \
|
||||
# --header "Authorization: token $CB_TOKEN" \
|
||||
# --header "Content-Type: multipart/form-data" -s -S \
|
||||
# --form "attachment=@bungeecord/target/AdvancedServerList-BungeeCord-${CI_COMMIT_TAG##v}.jar;type=application/octet-stream" \
|
||||
# --fail-with-body
|
||||
# - |-
|
||||
# curl -X POST --location "https://codeberg.org/api/v1/repos/Andre601/AdvancedServerList/releases/$RELEASE_ID/assets" \
|
||||
# --header "Authorization: token $CB_TOKEN" \
|
||||
# --header "Content-Type: multipart/form-data" -s -S \
|
||||
# --form "attachment=@velocity/target/AdvancedServerList-Velocity-${CI_COMMIT_TAG##v}.jar;type=application/octet-stream" \
|
||||
# --fail-with-body
|
||||
uploadToModrinthAndMaven:
|
||||
image: eclipse-temurin
|
||||
secrets:
|
||||
- cb_token
|
||||
- modrinth_api_token
|
||||
- hangar_api_token
|
||||
commands:
|
||||
# Move VersionUploader.jar
|
||||
# Move VersionUploader jar file
|
||||
- cd version-uploader/target/
|
||||
- mv VersionUploader.jar ../../
|
||||
- cd ../../
|
||||
# Create Modrinth releases
|
||||
- java -jar VersionUploader.jar --modrinth
|
||||
# Create Hangar release
|
||||
- java -jar VersionUploader.jar --hangar
|
||||
# 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,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
|
||||
@@ -60,13 +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 |
|
||||
| [PAPIProxyBridge] | Spigot, Paper, BungeeCord, Velocity | No |
|
||||
| [Maintenance] | Spigot, Paper, BungeeCord, Velocity | No |
|
||||
| Dependency | Platforms | Required? |
|
||||
|-------------------|----------------------|-----------|
|
||||
| [ProtocolLib] | Spigot | Yes |
|
||||
| [PlaceholderAPI] | Spigot, Paper | No |
|
||||
| [ViaVersion] | Spigot, Paper | No |
|
||||
| [PAPIProxyBridge] | BungeeCord, Velocity | No |
|
||||
| [Maintenance] | All | No |
|
||||
|
||||
## Statistics
|
||||
|
||||
|
||||
+2
-2
@@ -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,7 +118,7 @@
|
||||
<dependency>
|
||||
<groupId>com.viaversion</groupId>
|
||||
<artifactId>viaversion-api</artifactId>
|
||||
<version>4.7.0</version>
|
||||
<version>4.8.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -8,6 +8,8 @@ loader: 'ch.andre601.advancedserverlist.paper.ASLLoader'
|
||||
|
||||
api-version: '1.19'
|
||||
|
||||
folia-supported: true
|
||||
|
||||
dependencies:
|
||||
server:
|
||||
PlaceholderAPI:
|
||||
|
||||
+7
-7
@@ -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,7 +111,7 @@
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.10.0</version>
|
||||
<version>4.11.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -72,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())){
|
||||
|
||||
+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());
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -33,7 +33,9 @@
|
||||
{% endif %}
|
||||
|
||||
{% set desc = "" %}
|
||||
{% if summary.description %}
|
||||
{% 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 %}
|
||||
|
||||
@@ -53,7 +55,7 @@
|
||||
{% set final_name.name = final_name.name ~ ")" %}
|
||||
{% endif %}
|
||||
|
||||
{% if details_type and details_type == "method" %}
|
||||
{% if details_type and details_type == "method" %}
|
||||
{% if modifiers.name %}
|
||||
<td><code>{{ modifiers.name }}</code></td>
|
||||
{% else %}
|
||||
@@ -124,6 +126,10 @@
|
||||
{% 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 %}
|
||||
@@ -142,6 +148,15 @@
|
||||
<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 }}
|
||||
|
||||
@@ -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" %}
|
||||
@@ -1,17 +0,0 @@
|
||||
<a
|
||||
href="{{ config.repo_url}}"
|
||||
title="{{ lang.t('source') }}"
|
||||
class="md-source"
|
||||
target="_blank"
|
||||
rel="nofollow noreferral noopener"
|
||||
>
|
||||
<div class="md-source__icon md-icon">
|
||||
{% set icon = config.theme.icon.repo or "fontawesome/brands/git-alt" %}
|
||||
{% include ".icons/" ~ icon ~ ".svg" %}
|
||||
</div>
|
||||
<div class="md-source__repository">
|
||||
{{ config.repo_name }}
|
||||
<ul class="md-source__facts" data-md-component="codeberg-stats">
|
||||
</ul>
|
||||
</div>
|
||||
</a>
|
||||
+3
-4
@@ -1,9 +1,8 @@
|
||||
nav:
|
||||
- Home:
|
||||
- index.md
|
||||
- commands.md
|
||||
- Home: index.md
|
||||
- commands
|
||||
- profiles
|
||||
- examples
|
||||
- migration
|
||||
- api
|
||||
- placeholderapi
|
||||
- PlaceholderAPI: placeholderapi
|
||||
@@ -7,6 +7,24 @@ icon: octicons/log-24
|
||||
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 }
|
||||
@@ -25,6 +43,8 @@ They are ordered newest to oldest.
|
||||
|
||||
- All previously deprecated `getX()` methods from the `ProfileEntry` record
|
||||
|
||||
----
|
||||
|
||||
## v2.1.0
|
||||
|
||||
### :octicons-pencil-24:{ .changelog-changed title="Changed" } Changed { #v2.1.0-changed }
|
||||
@@ -32,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 }
|
||||
@@ -61,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 }
|
||||
@@ -78,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 }
|
||||
|
||||
-->
|
||||
+54
-3
@@ -112,16 +112,67 @@ methods:
|
||||
type:
|
||||
name: 'Builder'
|
||||
type: 'object'
|
||||
- name: 'setExtraPlayers'
|
||||
- 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>.<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 use.'
|
||||
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
|
||||
|
||||
+31
-2
@@ -37,11 +37,21 @@ constructors:
|
||||
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/'
|
||||
@@ -61,9 +71,11 @@ methods:
|
||||
<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/"><code>NullBool.NOT_SET</code></a></li>
|
||||
<li><a href="#extraplayersenabled()"><code>extraPlayersEnabled</code></a>: <a href="../../objects/nullbool/"><code>NullBool.NOT_SET</code></a></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:
|
||||
@@ -142,6 +154,15 @@ methods:
|
||||
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.'
|
||||
@@ -150,6 +171,14 @@ methods:
|
||||
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>
|
||||
|
||||
@@ -5,6 +5,8 @@ The Reference docs follow a specific mixture of manually created and auto-genera
|
||||
A page may look something like this:
|
||||
```markdown
|
||||
---
|
||||
template: api-doc.html
|
||||
|
||||
constructors:
|
||||
- name: 'Constructor'
|
||||
description: 'Creates a new instance of this class.'
|
||||
@@ -36,6 +38,7 @@ Below is a list of all custom tags. Note that these tags only render on the actu
|
||||
- `<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:
|
||||
|
||||
@@ -67,10 +70,11 @@ constructors:
|
||||
type: '<string>'
|
||||
attributes:
|
||||
- '<string>'
|
||||
deprecated: '<string>'
|
||||
throws:
|
||||
- name: '<string>'
|
||||
description: '<string>'
|
||||
seealos:
|
||||
seealso:
|
||||
- name: '<string>'
|
||||
link: '<string>'
|
||||
```
|
||||
@@ -84,6 +88,7 @@ constructors:
|
||||
- `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.
|
||||
@@ -115,6 +120,7 @@ enums:
|
||||
- name: '<string>'
|
||||
description: '<string>'
|
||||
type: '<string>'
|
||||
deprecated: '<string>'
|
||||
seealso:
|
||||
- name: '<string>'
|
||||
link: '<string>'
|
||||
@@ -125,6 +131,7 @@ enums:
|
||||
- `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.
|
||||
@@ -148,6 +155,7 @@ methods:
|
||||
attributes:
|
||||
- '<string>'
|
||||
returns: '<string>'
|
||||
deprecated: '<string>'
|
||||
throws:
|
||||
- name: '<string>'
|
||||
description: '<string>'
|
||||
@@ -171,6 +179,7 @@ methods:
|
||||
- `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.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -1,16 +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');
|
||||
|
||||
const [release, repo] = await Promise.all([
|
||||
fetch(`${url}/latest-release`).then(_ => _.json()),
|
||||
fetch(`${url}/stats`).then(_ => _.json()),
|
||||
]);
|
||||
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);
|
||||
}
|
||||
|
||||
const list = document.querySelectorAll('ul[data-md-component="codeberg-stats"]');
|
||||
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);
|
||||
}
|
||||
|
||||
list.forEach((entry) => {
|
||||
entry.innerHTML = `<li class="md-source__fact md-source__fact--version">${release.name}</li>
|
||||
<li class="md-source__fact md-source__fact--stars">${repo.stars}</li>
|
||||
<li class="md-source__fact md-source__fact--forks">${repo.forks}</li>`
|
||||
})
|
||||
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();
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
--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;
|
||||
@@ -43,6 +46,16 @@
|
||||
|
||||
/* 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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
File renamed without changes.
@@ -2,6 +2,8 @@
|
||||
icon: octicons/list-unordered-24
|
||||
---
|
||||
|
||||
# Examples
|
||||
|
||||
## About
|
||||
|
||||
!!! warning "The below examples may only work in v1.10.0 or newer!"
|
||||
|
||||
+40
-19
@@ -9,23 +9,52 @@ 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/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]
|
||||
|
||||
[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] | Spigot | Yes |
|
||||
| [PlaceholderAPI] | Spigot, Paper | No |
|
||||
| [ViaVersion] | Spigot, Paper | No |
|
||||
| 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/
|
||||
[papiproxybridge]: https://hangar.papermc.io/William278/PAPIProxyBridge
|
||||
[maintenance]: https://hangar.papermc.io/kennytv/Maintenance
|
||||
|
||||
## Pages
|
||||
|
||||
@@ -39,12 +68,4 @@ AdvancedServerList supports the following platforms:
|
||||
- [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)
|
||||
|
||||
[spigot]: https://www.spigotmc.org
|
||||
[paper]: https://papermc.io
|
||||
[velocity]: https://velocitypowered.com
|
||||
|
||||
[protocollib]: https://www.spigotmc.org/resources/1997/
|
||||
[placeholderapi]: https://www.spigotmc.org/resources/6245/
|
||||
[viaversion]: https://www.spigotmc.org/resources/19254/
|
||||
- [PlaceholderAPI](placeholderapi/index.md)
|
||||
@@ -2,14 +2,19 @@
|
||||
icon: material/percent
|
||||
---
|
||||
|
||||
# PlaceholderAPI Placeholders
|
||||
# PlaceholderAPI Placeholder support
|
||||
|
||||
The Spigot and Paper version of AdvancedServerList provide their own set of placeholders to use through [PlaceholderAPI].
|
||||
AdvancedServerList provides support for [PlaceholderAPI] placeholders to be used, while also providing its own set of placeholders.
|
||||
|
||||
## Placeholders
|
||||
[placeholderapi]: https://www.spigotmc.org/resources/6245/
|
||||
|
||||
!!! 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.
|
||||
## 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 |
|
||||
|---------------------------|-------------------------------------------------------------------------------|
|
||||
@@ -19,4 +24,13 @@ The Spigot and Paper version of AdvancedServerList provide their own set of plac
|
||||
| `%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/
|
||||
## 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
|
||||
+52
-11
@@ -2,7 +2,7 @@
|
||||
icon: octicons/note-24
|
||||
---
|
||||
|
||||
# Profiles
|
||||
# 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).
|
||||
@@ -82,8 +82,8 @@ If an option such as motd is not present in an entry will it check the file for
|
||||
```
|
||||
<div class="result">
|
||||
|
||||

|
||||

|
||||
{ loading="lazy" }
|
||||
{ loading="lazy" }
|
||||
|
||||
</div>
|
||||
|
||||
@@ -104,7 +104,7 @@ If you want to display multiple MOTDs will you need to use the [`Profiles` optio
|
||||
```
|
||||
<div class="result">
|
||||
|
||||

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

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

|
||||
{ loading="lazy" }
|
||||
|
||||
</div>
|
||||
|
||||
@@ -189,7 +189,7 @@ You can either remove this option or set to an empty list (`hover: []`) to not o
|
||||
```
|
||||
<div class="result">
|
||||
|
||||

|
||||
{ loading="lazy" }
|
||||
|
||||
</div>
|
||||
|
||||
@@ -218,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>
|
||||
|
||||
@@ -228,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.
|
||||
|
||||
@@ -255,6 +255,47 @@ As an example, setting this to `1` while `10` players are online will display `1
|
||||
```
|
||||
<div class="result">
|
||||
|
||||

|
||||
{ loading="lazy" }
|
||||
|
||||
</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>
|
||||
@@ -54,10 +54,7 @@ These placeholders use values given by the server/proxy AdvancedServerList runs
|
||||
|
||||
## 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
|
||||
|
||||
|
||||
+9
-60
@@ -12,64 +12,8 @@ docs_dir: docs/
|
||||
repo_name: Andre601/AdvancedServerList
|
||||
repo_url: https://codeberg.org/Andre601/AdvancedServerList
|
||||
|
||||
not_in_nav: api/reference/structure.md
|
||||
|
||||
#nav:
|
||||
# - Home:
|
||||
# - index.md
|
||||
# - Commands: commands.md
|
||||
# - 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
|
||||
# - api:
|
||||
# - api/reference/api/index.md
|
||||
# - events:
|
||||
# - GenericServerListEvent: api/reference/api/events/genericserverlistevent.md
|
||||
# - exceptions:
|
||||
# - InvalidPlaceholderProviderException: api/reference/api/exceptions/invalidplaceholderproviderexception.md
|
||||
# - objects:
|
||||
# - GenericPlayer: api/reference/api/objects/genericplayer.md
|
||||
# - GenericServer: api/reference/api/objects/genericserver.md
|
||||
# - NullBool: api/reference/api/objects/nullbool.md
|
||||
# - profiles:
|
||||
# - ProfileEntry:
|
||||
# - api/reference/api/profiles/profileentry/index.md
|
||||
# - Builder: api/reference/api/profiles/profileentry/builder.md
|
||||
# - AdvancedServerListAPI: api/reference/api/advancedserverlistapi.md
|
||||
# - PlaceholderProvider: api/reference/api/placeholderprovider.md
|
||||
# - platform-bukkit:
|
||||
# - api/reference/platform-bukkit/index.md
|
||||
# - events:
|
||||
# - PreServerListSetEvent: api/reference/platform-bukkit/events/preserverlistsetevent.md
|
||||
# - objects:
|
||||
# - BukkitPlayer: api/reference/platform-bukkit/objects/bukkitplayer.md
|
||||
# - BukkitServer: api/reference/platform-bukkit/objects/bukkitserver.md
|
||||
# - platform-bungeecord:
|
||||
# - api/reference/platform-bungeecord/index.md
|
||||
# - events:
|
||||
# - PreServerListSetEvent: api/reference/platform-bungeecord/events/preserverlistsetevent.md
|
||||
# - objects:
|
||||
# - BungeePlayer: api/reference/platform-bungeecord/objects/bungeeplayer.md
|
||||
# - BungeeProxy: api/reference/platform-bungeecord/objects/bungeeproxy.md
|
||||
# - platform-velocity:
|
||||
# - api/reference/platform-velocity/index.md
|
||||
# - events:
|
||||
# - PreServerListSetEvent: api/reference/platform-velocity/events/preserverlistsetevent.md
|
||||
# - objects:
|
||||
# - VelocityPlayer: api/reference/platform-velocity/objects/velocityplayer.md
|
||||
# - VelocityProxy: api/reference/platform-velocity/objects/velocityproxy.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
|
||||
# - Examples: examples/index.md
|
||||
# - PlaceholderAPI: placeholderapi/index.md
|
||||
not_in_nav: |
|
||||
api/reference/structure.md
|
||||
|
||||
theme:
|
||||
name: 'material'
|
||||
@@ -110,9 +54,14 @@ extra_javascript:
|
||||
- assets/js/repo-stats.js
|
||||
|
||||
extra:
|
||||
github_repository: !ENV [GITHUB_REPO_INSTANCE, False]
|
||||
social:
|
||||
- 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
|
||||
@@ -129,8 +78,8 @@ markdown_extensions:
|
||||
- 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,10 +38,10 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.build.commit/>
|
||||
|
||||
<plugin.version>3.4.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>
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
mkdocs-material==9.2.8
|
||||
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
|
||||
@@ -52,7 +52,7 @@
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.4.6</version>
|
||||
<version>1.4.11</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -61,22 +61,28 @@
|
||||
<version>5.2.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dev.masecla</groupId>
|
||||
<artifactId>Modrinth4J</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.11.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dev.masecla</groupId>
|
||||
<artifactId>Modrinth4J</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>VersionUploader</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -89,7 +95,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
@@ -103,7 +109,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>
|
||||
</configuration>
|
||||
|
||||
+13
-4
@@ -30,26 +30,35 @@ import java.util.List;
|
||||
public enum PlatformInfo{
|
||||
|
||||
BUKKIT(
|
||||
"bukkit",
|
||||
"bukkit/target/AdvancedServerList-Bukkit-{{version}}.jar",
|
||||
"Spigot", "Paper", "Folia"
|
||||
"spigot", "paper", "folia"
|
||||
),
|
||||
BUNGEECORD(
|
||||
"bungeecord",
|
||||
"bungeecord/target/AdvancedServerList-BungeeCord-{{version}}.jar",
|
||||
"BungeeCord", "Waterfall"
|
||||
"bungeecord", "waterfall"
|
||||
),
|
||||
VELOCITY(
|
||||
"velocity",
|
||||
"velocity/target/AdvancedServerList-Velocity-{{version}}.jar",
|
||||
"Velocity"
|
||||
"velocity"
|
||||
);
|
||||
|
||||
private final String platform;
|
||||
private final String filePath;
|
||||
private final List<String> loaders;
|
||||
|
||||
PlatformInfo(String filePath, String... loaders){
|
||||
PlatformInfo(String platform, String filePath, String... loaders){
|
||||
this.platform = platform;
|
||||
this.filePath = filePath;
|
||||
this.loaders = List.of(loaders);
|
||||
}
|
||||
|
||||
public String getPlatform(){
|
||||
return platform;
|
||||
}
|
||||
|
||||
public String getFilePath(){
|
||||
return filePath;
|
||||
}
|
||||
|
||||
+71
-24
@@ -25,11 +25,19 @@
|
||||
|
||||
package ch.andre601.advancedserverlist.versionuploader;
|
||||
|
||||
import ch.andre601.advancedserverlist.versionuploader.data.CodebergRelease;
|
||||
import ch.andre601.advancedserverlist.versionuploader.data.CodebergReleaseFetcher;
|
||||
import ch.andre601.advancedserverlist.versionuploader.hangar.HangarVersionUploader;
|
||||
import ch.andre601.advancedserverlist.versionuploader.modrinth.ModrinthVersionUploader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class VersionUploader{
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(VersionUploader.class);
|
||||
@@ -37,37 +45,76 @@ public class VersionUploader{
|
||||
public static void main(String[] args) {
|
||||
LOGGER.info("Starting release uploader...");
|
||||
|
||||
CodebergRelease release = CodebergReleaseFetcher.fetchRelease();
|
||||
if(args.length == 0){
|
||||
LOGGER.warn("MISSING ARGUMENT!");
|
||||
LOGGER.warn("COMMAND USAGE: java -jar VersionUploader.jar [--all|--modrinth|--hangar]");
|
||||
System.exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
CodebergRelease release = CodebergReleaseFetcher.fetch();
|
||||
|
||||
if(release == null){
|
||||
LOGGER.warn("Non-successful attempt at fetching a release from Codeberg! Aborting upload");
|
||||
LOGGER.warn("Couldn't fetch Codeberg Release information!");
|
||||
System.exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
if(release.tagName() == null || release.tagName().isEmpty()){
|
||||
LOGGER.info("Received invalid Release Structure. Tag name was null/empty.");
|
||||
System.exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
// Gson uses 0 for nummerics by default
|
||||
if(release.id() == 0){
|
||||
LOGGER.info("Received invalid Release Structure. ID was 0.");
|
||||
System.exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
LOGGER.info("Successfully obtained release info: [ID: {}, Tag: {}, Prerelease: {}]", release.id(), release.tagName(), release.prerelease());
|
||||
|
||||
for(String arg : args){
|
||||
if(arg.equalsIgnoreCase("--modrinth")){
|
||||
new ModrinthVersionUploader().performUploads(release);
|
||||
break;
|
||||
CompletableFuture<?> future;
|
||||
switch(args[0].toLowerCase(Locale.ROOT)){
|
||||
case "--modrinth" -> future = new ModrinthVersionUploader().performUpload(release, false);
|
||||
case "--hangar" -> future = new HangarVersionUploader().performUpload(release, false);
|
||||
case "--all" -> future = CompletableFuture.allOf(
|
||||
new ModrinthVersionUploader().performUpload(release, false),
|
||||
new HangarVersionUploader().performUpload(release, false)
|
||||
);
|
||||
case "--dryrun" -> {
|
||||
LOGGER.info("Performing Dry-run for Modrinth and Hangar...");
|
||||
future = CompletableFuture.allOf(
|
||||
new ModrinthVersionUploader().performUpload(release, true),
|
||||
new HangarVersionUploader().performUpload(release, true)
|
||||
);
|
||||
|
||||
try{
|
||||
future.join();
|
||||
}catch(Exception ex){
|
||||
LOGGER.warn("Exception while waiting for CompletableFutures to end...", ex);
|
||||
}
|
||||
|
||||
LOGGER.info("Dry-run completed!");
|
||||
return;
|
||||
}
|
||||
if(arg.equalsIgnoreCase("--hangar")){
|
||||
new HangarVersionUploader().performUpload(release);
|
||||
break;
|
||||
default -> {
|
||||
LOGGER.warn("Unknown argument '{}' provided. Supported are '--all', '--modrinth' and '--hangar'", args[0]);
|
||||
System.exit(1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(future == null){
|
||||
LOGGER.warn("Issue while performing upload. Received CompletableFuture is null.");
|
||||
System.exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
future.join();
|
||||
LOGGER.info("Upload completed!");
|
||||
}catch(Exception ex){
|
||||
LOGGER.warn("Upload was not successful! Encountered an Exception!", ex);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static String retrieveVersion(){
|
||||
try(InputStream is = VersionUploader.class.getResourceAsStream("/version.properties")){
|
||||
Properties properties = new Properties();
|
||||
|
||||
properties.load(is);
|
||||
|
||||
return properties.getProperty("version");
|
||||
}catch(IOException ex){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package ch.andre601.advancedserverlist.versionuploader;
|
||||
package ch.andre601.advancedserverlist.versionuploader.data;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
+24
-29
@@ -23,10 +23,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package ch.andre601.advancedserverlist.versionuploader;
|
||||
package ch.andre601.advancedserverlist.versionuploader.data;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
@@ -35,66 +34,62 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class CodebergReleaseFetcher{
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(CodebergReleaseFetcher.class);
|
||||
|
||||
private static final Gson GSON = new Gson();
|
||||
private static final Type LIST_TYPE = new TypeToken<ArrayList<CodebergRelease>>(){}.getType();
|
||||
|
||||
private static final OkHttpClient CLIENT = new OkHttpClient();
|
||||
private static final OkHttpClient CLIENT = new OkHttpClient.Builder()
|
||||
.callTimeout(30, TimeUnit.SECONDS)
|
||||
.connectTimeout(30, TimeUnit.SECONDS)
|
||||
.readTimeout(30, TimeUnit.SECONDS)
|
||||
.build();
|
||||
|
||||
public static CodebergRelease fetchRelease(){
|
||||
public static CodebergRelease fetch(){
|
||||
String tag = System.getenv("CI_COMMIT_TAG");
|
||||
String authToken = System.getenv("CB_TOKEN");
|
||||
String codbergToken = System.getenv("CODEBERG_API_TOKEN");
|
||||
|
||||
if(tag == null || authToken == null || tag.isEmpty() || authToken.isEmpty()){
|
||||
LOGGER.warn("Cannot fetch release data. Either CI_COMMIT_TAG or CB_TOKEN was null or empty.");
|
||||
if(tag == null || codbergToken == null || tag.isEmpty() || codbergToken.isEmpty()){
|
||||
LOGGER.warn("Cannot fetch release data. Either Tag or Codeberg token was null/empty.");
|
||||
return null;
|
||||
}
|
||||
|
||||
String url = "https://codeberg.org/api/v1/repos/Andre601/AdvancedServerList/releases/tags/" + tag;
|
||||
LOGGER.info("Fetching Release data from {}...", url);
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url("https://codeberg.org/api/v1/repos/Andre601/AdvancedServerList/releases?limit=10")
|
||||
.header("User-Agent", "VersionUploader-CodebergFetcher/${plugin.version}")
|
||||
.url(url)
|
||||
.header("User-Agent", "VersionUploader-CodebergReleaseFetcher/v1.0.0")
|
||||
.header("Accept", "application/json")
|
||||
.header("Authorization", "token " + authToken)
|
||||
.header("Authorization", "token " + codbergToken)
|
||||
.build();
|
||||
|
||||
try(Response response = CLIENT.newCall(request).execute()){
|
||||
if(!response.isSuccessful()){
|
||||
LOGGER.warn("Cannot fetch releases. Received non-successful response-code: {}", response.code());
|
||||
LOGGER.warn("Message: {}", response.message());
|
||||
LOGGER.warn("Received non-successful response code from Codeberg API:");
|
||||
LOGGER.warn("Response Code: {}", response.code());
|
||||
LOGGER.warn("Response Message: {}", response.message());
|
||||
return null;
|
||||
}
|
||||
|
||||
ResponseBody body = response.body();
|
||||
if(body == null){
|
||||
LOGGER.warn("Cannot fetch release info. Retrieved Response body was null");
|
||||
LOGGER.warn("Received null response body while fetching Codeberg Release.");
|
||||
return null;
|
||||
}
|
||||
|
||||
String bodyString = body.string();
|
||||
if(bodyString.isEmpty()){
|
||||
LOGGER.warn("Cannot fetch release info. Retrieved Response body was null");
|
||||
LOGGER.warn("Received empty response body while fetching Codeberg Release.");
|
||||
return null;
|
||||
}
|
||||
|
||||
List<CodebergRelease> releases = GSON.fromJson(bodyString, LIST_TYPE);
|
||||
|
||||
CodebergRelease release = null;
|
||||
for(CodebergRelease tmp : releases){
|
||||
if(tmp.tagName().equals(tag)){
|
||||
release = tmp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return release;
|
||||
return GSON.fromJson(bodyString, CodebergRelease.class);
|
||||
}catch(IOException ex){
|
||||
LOGGER.warn("Encountered an IOException while fetching Codeberg Release data.", ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+53
-35
@@ -25,8 +25,9 @@
|
||||
|
||||
package ch.andre601.advancedserverlist.versionuploader.hangar;
|
||||
|
||||
import ch.andre601.advancedserverlist.versionuploader.CodebergRelease;
|
||||
import ch.andre601.advancedserverlist.versionuploader.PlatformInfo;
|
||||
import ch.andre601.advancedserverlist.versionuploader.VersionUploader;
|
||||
import ch.andre601.advancedserverlist.versionuploader.data.CodebergRelease;
|
||||
import ch.andre601.advancedserverlist.versionuploader.hangar.version.*;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -54,6 +55,7 @@ import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class HangarVersionUploader{
|
||||
@@ -69,26 +71,31 @@ public class HangarVersionUploader{
|
||||
this.apiKey = System.getenv("HANGAR_API_TOKEN");
|
||||
}
|
||||
|
||||
public void performUpload(CodebergRelease release){
|
||||
public CompletableFuture<?> performUpload(CodebergRelease release, boolean dryrun){
|
||||
LOGGER.info("Starting HangarVersionUploader...");
|
||||
|
||||
if(apiKey == null || apiKey.isEmpty()){
|
||||
if((apiKey == null || apiKey.isEmpty()) && !dryrun){
|
||||
LOGGER.warn("Received a null/empty API key!");
|
||||
System.exit(1);
|
||||
return;
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
|
||||
final Namespace project = new Namespace("Andre_601", "AdvancedServerList");
|
||||
|
||||
final String version = release.tagName().startsWith("v") ? release.tagName().substring(1) : release.tagName();
|
||||
final String releaseVersion = release.tagName().startsWith("v") ? release.tagName().substring(1) : release.tagName();
|
||||
final String pluginVersion = VersionUploader.retrieveVersion();
|
||||
|
||||
if(pluginVersion == null || pluginVersion.isEmpty()){
|
||||
LOGGER.warn("Retrieved null/empty plugin version.");
|
||||
return CompletableFuture.completedFuture(false);
|
||||
}
|
||||
|
||||
final String changelog = release.body();
|
||||
boolean preRelease = release.prerelease();
|
||||
|
||||
final List<Path> filePaths = List.of(
|
||||
new File(PlatformInfo.BUKKIT.getFilePath().replace("{{version}}", version)).toPath(),
|
||||
new File(PlatformInfo.BUNGEECORD.getFilePath().replace("{{version}}", version)).toPath(),
|
||||
new File(PlatformInfo.VELOCITY.getFilePath().replace("{{version}}", version)).toPath()
|
||||
new File(PlatformInfo.BUKKIT.getFilePath().replace("{{version}}", pluginVersion)).toPath(),
|
||||
new File(PlatformInfo.BUNGEECORD.getFilePath().replace("{{version}}", pluginVersion)).toPath(),
|
||||
new File(PlatformInfo.VELOCITY.getFilePath().replace("{{version}}", pluginVersion)).toPath()
|
||||
);
|
||||
|
||||
final List<Dependency> bukkitDependencies = List.of(
|
||||
@@ -112,7 +119,7 @@ public class HangarVersionUploader{
|
||||
);
|
||||
|
||||
final Version versionUpload = new Version(
|
||||
version,
|
||||
releaseVersion,
|
||||
Map.of(
|
||||
Platform.PAPER, bukkitDependencies,
|
||||
Platform.WATERFALL, bungeeDependencies,
|
||||
@@ -128,40 +135,51 @@ public class HangarVersionUploader{
|
||||
preRelease ? "Beta" : "Release"
|
||||
);
|
||||
|
||||
if(dryrun){
|
||||
String json = GSON.toJson(versionUpload);
|
||||
|
||||
LOGGER.info("Namespace: {}", project);
|
||||
LOGGER.info("JSON: {}", json);
|
||||
|
||||
return CompletableFuture.completedFuture(json);
|
||||
}
|
||||
|
||||
try(CloseableHttpClient client = HttpClients.createDefault()){
|
||||
uploadVersion(client, project, versionUpload, filePaths);
|
||||
return uploadVersion(client, project, versionUpload, filePaths);
|
||||
}catch(ParseException | IOException ex){
|
||||
LOGGER.warn("Unable to upload to Hangar! Encountered an exception.", ex);
|
||||
System.exit(1);
|
||||
return CompletableFuture.failedFuture(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void uploadVersion(HttpClient client, Namespace namespace, Version 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));
|
||||
private CompletableFuture<?> uploadVersion(HttpClient client, Namespace namespace, Version versionUpload, List<Path> filePaths) throws IOException, ParseException{
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
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());
|
||||
try{
|
||||
this.addAuthHeader(client, post);
|
||||
|
||||
LOGGER.info("Uploading release...");
|
||||
return client.execute(post, response -> {
|
||||
if(response.getCode() != 200){
|
||||
throw new RuntimeException(String.format(
|
||||
"Received non-successful response while uploading release. Code: %d, Message: %s", response.getCode(), response.getReasonPhrase()
|
||||
));
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}catch(IOException ex){
|
||||
LOGGER.warn("Encountered IOException while perfoming upload.", ex);
|
||||
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{
|
||||
|
||||
+58
-30
@@ -25,8 +25,11 @@
|
||||
|
||||
package ch.andre601.advancedserverlist.versionuploader.modrinth;
|
||||
|
||||
import ch.andre601.advancedserverlist.versionuploader.CodebergRelease;
|
||||
import ch.andre601.advancedserverlist.versionuploader.PlatformInfo;
|
||||
import ch.andre601.advancedserverlist.versionuploader.VersionUploader;
|
||||
import ch.andre601.advancedserverlist.versionuploader.data.CodebergRelease;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import masecla.modrinth4j.client.agent.UserAgent;
|
||||
import masecla.modrinth4j.endpoints.version.CreateVersion;
|
||||
import masecla.modrinth4j.main.ModrinthAPI;
|
||||
@@ -35,17 +38,20 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModrinthVersionUploader{
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ModrinthVersionUploader.class);
|
||||
|
||||
private final List<PlatformInfo> platforms = List.of(
|
||||
PlatformInfo.BUKKIT,
|
||||
PlatformInfo.BUNGEECORD,
|
||||
PlatformInfo.VELOCITY
|
||||
);
|
||||
private final List<String> versions = List.of("1.19.4", "1.20", "1.20.1");
|
||||
private final List<String> versions = List.of("1.19.4", "1.20", "1.20.1", "1.20.2");
|
||||
|
||||
private final ModrinthAPI api;
|
||||
|
||||
@@ -53,66 +59,88 @@ public class ModrinthVersionUploader{
|
||||
this.api = createClient();
|
||||
}
|
||||
|
||||
public void performUploads(CodebergRelease release){
|
||||
public CompletableFuture<?> performUpload(CodebergRelease release, boolean dryrun){
|
||||
LOGGER.info("Starting ModrinthVersionUploader...");
|
||||
|
||||
if(api == null){
|
||||
LOGGER.warn("Unable to obtain ModrinthAPI instance!");
|
||||
System.exit(1);
|
||||
return;
|
||||
LOGGER.warn("Cannot create updates on Modrinth. API instance is null.");
|
||||
return CompletableFuture.completedFuture(false);
|
||||
}
|
||||
|
||||
final String version = release.tagName().startsWith("v") ? release.tagName().substring(1) : release.tagName();
|
||||
final String releaseVersion = release.tagName().startsWith("v") ? release.tagName().substring(1) : release.tagName();
|
||||
final String pluginVersion = VersionUploader.retrieveVersion();
|
||||
|
||||
if(pluginVersion == null || pluginVersion.isEmpty()){
|
||||
LOGGER.warn("Retrieved null/empty plugin version.");
|
||||
return CompletableFuture.completedFuture(false);
|
||||
}
|
||||
|
||||
final String changelog = release.body();
|
||||
final boolean preRelease = release.prerelease();
|
||||
final boolean prerelease = release.prerelease();
|
||||
|
||||
for(PlatformInfo platform : platforms){
|
||||
File file = new File(platform.getFilePath().replace("{{version}}", version));
|
||||
CompletableFuture<?>[] futures = new CompletableFuture[platforms.size()];
|
||||
for(int i = 0; i < platforms.size(); i++){
|
||||
LOGGER.info("Creating release for platform {}...", platforms.get(i).getPlatform());
|
||||
|
||||
File file = new File(platforms.get(i).getFilePath().replace("{{version}}", pluginVersion));
|
||||
|
||||
List<ProjectVersion.ProjectDependency> dependencies = new ArrayList<>();
|
||||
// Maintenance plugin
|
||||
dependencies.add(new ProjectVersion.ProjectDependency(null, "VCAqN1ln", null, ProjectVersion.ProjectDependencyType.OPTIONAL));
|
||||
if(!platforms.get(i).getPlatform().equalsIgnoreCase("bukkit")){
|
||||
// PAPIProxyBridge plugin
|
||||
dependencies.add(new ProjectVersion.ProjectDependency(null, "bEIUEGTX", null, ProjectVersion.ProjectDependencyType.OPTIONAL));
|
||||
}
|
||||
|
||||
CreateVersion.CreateVersionRequest request = CreateVersion.CreateVersionRequest.builder()
|
||||
.projectId("xss83sOY")
|
||||
.name(String.format("v%s (%s)", version, String.join(", ", platform.getLoaders())))
|
||||
.versionNumber(version)
|
||||
.changelog(changelog)
|
||||
.name(String.format("v%s (%s)", releaseVersion, String.join(", ", platforms.get(i).getLoaders())))
|
||||
.versionNumber(releaseVersion)
|
||||
.changelog(changelog.replaceAll("\r\n", "\n"))
|
||||
.featured(false)
|
||||
.files(file)
|
||||
.gameVersions(versions)
|
||||
.loaders(platform.getLoaders())
|
||||
.versionType(preRelease ? ProjectVersion.VersionType.BETA : ProjectVersion.VersionType.RELEASE)
|
||||
.dependencies(List.of(
|
||||
new ProjectVersion.ProjectDependency(null, "papiproxabridge", null, ProjectVersion.ProjectDependencyType.OPTIONAL),
|
||||
new ProjectVersion.ProjectDependency(null, "maintenance", null, ProjectVersion.ProjectDependencyType.OPTIONAL)
|
||||
))
|
||||
.loaders(platforms.get(i).getLoaders())
|
||||
.versionType(prerelease ? ProjectVersion.VersionType.BETA : ProjectVersion.VersionType.RELEASE)
|
||||
.dependencies(dependencies)
|
||||
.build();
|
||||
|
||||
api.versions().createProjectVersion(request).whenComplete((project, throwable) -> {
|
||||
if(dryrun){
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String json = gson.toJson(request);
|
||||
|
||||
LOGGER.info("JSON Data to send: {}", json);
|
||||
|
||||
futures[i] = CompletableFuture.completedFuture(json);
|
||||
continue;
|
||||
}
|
||||
|
||||
futures[i] = api.versions().createProjectVersion(request).whenComplete(((projectVersion, throwable) -> {
|
||||
if(throwable != null){
|
||||
LOGGER.warn("Encountered error while creating a release on Modrinth!", throwable);
|
||||
LOGGER.warn("Encountered an exception while uploading a new release to Modrinth!", throwable);
|
||||
return;
|
||||
}
|
||||
|
||||
LOGGER.info("Successfully uploaded new Modrinth release!");
|
||||
LOGGER.info("https://modrinth.com/plugin/advancedserverlist/version/{}", project.getId());
|
||||
});
|
||||
LOGGER.info("Created new release!");
|
||||
LOGGER.info("Link: https://modrinth.com/plugin/advancedserverlist/version/{}", projectVersion.getId());
|
||||
}));
|
||||
}
|
||||
|
||||
LOGGER.info("Upload task completed! Shutting down jar...");
|
||||
System.exit(0);
|
||||
return CompletableFuture.allOf(futures);
|
||||
}
|
||||
|
||||
private ModrinthAPI createClient(){
|
||||
String apiToken = System.getenv("MODRINTH_API_TOKEN");
|
||||
if(apiToken == null || apiToken.isEmpty())
|
||||
String token = System.getenv("MODRINTH_API_TOKEN");
|
||||
if(token == null || token.isEmpty())
|
||||
return null;
|
||||
|
||||
UserAgent agent = UserAgent.builder()
|
||||
.authorUsername("Andre_601")
|
||||
.projectVersion("${plugin.version}")
|
||||
.projectVersion("v1.0.0")
|
||||
.projectName("ModrinthVersionUploader")
|
||||
.contact("github@andre601.ch")
|
||||
.build();
|
||||
|
||||
return ModrinthAPI.rateLimited(agent, apiToken);
|
||||
return ModrinthAPI.rateLimited(agent, token);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
|
||||
version=${plugin.version}
|
||||
Reference in new issue
Block a user