Compare commits

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-10 16:07:29 +00:00
Andre_601 856be1e32e Update index.md 2023-02-03 22:33:28 +01:00
Andre601 5303bb00a0 More docs corrections 2023-02-01 15:55:19 +01:00
Andre601 9b43428e5d Another fix for changelog... 2023-02-01 15:47:18 +01:00
Andre601 d34d926f9a Fix wrong version in api changelog 2023-02-01 15:46:57 +01:00
Andre601 844279b32d Rename the other Placeholder classes too. 2023-02-01 15:38:00 +01:00
Andre601 5916e9b495 Version was already bumped... whoops 2023-02-01 15:31:56 +01:00
Andre_601 72384488d8 Merge pull request #45 from Andre601/feature/events
Add PreServerListSetEvent
2023-02-01 15:29:38 +01:00
Andre601 11a8b07f32 Bump version 2023-02-01 15:24:13 +01:00
Andre601 cd7dfc9c15 Rename to resolve 2023-01-31 18:12:43 +01:00
Andre601 c715ed6163 Make values of Expression final 2023-01-31 18:12:21 +01:00
Andre601 5a35ebbef4 Trim left and right string to avoid comparison issues 2023-01-31 17:17:10 +01:00
Andre601 830eee5da3 Fix missing favicon from resolver. 2023-01-28 23:22:08 +01:00
Andre601 09b845e86e Changes 2023-01-28 23:13:41 +01:00
Andre601 a2bdd5c4e5 Add changelog file 2023-01-27 14:59:12 +01:00
Andre601 a72c0d326a Update to latest API changes 2023-01-27 00:59:29 +01:00
Andre601 40ef2e35d4 Make GenericPlayer.getVersion VelocityPlayer only 2023-01-25 22:13:39 +01:00
Andre601 8422d6d2de Minor doc improvements 2023-01-25 16:19:43 +01:00
Andre601 4683dab513 limit motd in ProfileEntry.Builder directly 2023-01-25 16:15:07 +01:00
Andre601 d5947b20e5 Update docs 2023-01-25 01:11:45 +01:00
Andre601 147f01dd1b Rename GenericProfileEntryEvent to GenericServerListEvent 2023-01-25 00:29:07 +01:00
Andre601 a6eddb3828 Remove unused method in ComponentParser 2023-01-25 00:05:09 +01:00
Andre601 41e11f79cc Move ProfileEntry completely. 2023-01-25 00:01:51 +01:00
Andre601 66597ce7fa Add PreServerListSetEvent 2023-01-24 23:38:23 +01:00
Andre_601 77f17b202c Update MODRINTH.md 2023-01-23 21:28:57 +01:00
Andre_601 d3673a79af Update README.md 2023-01-23 20:59:26 +01:00
Andre_601 29c6930ce1 Merge pull request #38 from Andre601/feature/add-api
Start with an API for custom placeholder support
2023-01-23 20:54:03 +01:00
Andre601 125e9c0918 Add missing files to git 2023-01-23 20:53:21 +01:00
Andre601 2ac6931f26 Remove unused files and add workflow 2023-01-23 20:52:37 +01:00
Andre601 e301ef38f0 Bump version + Docs 2023-01-23 20:36:28 +01:00
Andre_601 3f6ada4599 Create api_support.yml 2023-01-23 14:27:41 +01:00
Andre601 45d3f17faa Use a Constructor for PlaceholderProvider 2023-01-22 15:00:01 +01:00
Andre601 d8fca2ca03 Improve Javadocs and rename getUuid to getUUID 2023-01-21 00:14:06 +01:00
Andre601 730b2e3aa8 Get rid of <T> nonsense for GenericPlayer 2023-01-21 00:03:55 +01:00
Andre601 e4e3543b9b Check for null/empty before lowercasing identifier 2023-01-20 23:18:59 +01:00
Andre_601 a955109db5 Merge pull request #44 from Andre601/dependabot/maven/core/com.unascribed-flexver-java-1.1.0
Bump flexver-java from 1.0.2 to 1.1.0 in /core
2023-01-17 16:55:01 +01:00
dependabot[bot] d399c7df63 Bump flexver-java from 1.0.2 to 1.1.0 in /core
Bumps flexver-java from 1.0.2 to 1.1.0.

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-17 15:11:31 +00:00
Andre601 973620925d fix wrong char position 2023-01-16 15:22:42 +01:00
Andre601 697e9e265d Update javadoc 2023-01-11 23:14:28 +01:00
Andre601 cabed6aa65 Update missing copyright headers 2023-01-11 23:10:00 +01:00
Andre601 b408658026 Apply fixes 2023-01-11 23:08:41 +01:00
Andre601 15f611445c Merge branch 'master' into feature/add-api
# Conflicts:
#	api/src/main/java/ch/andre601/advancedserverlist/api/exceptions/InvalidPlaceholderProviderException.java
#	bungeecord/src/main/java/ch/andre601/advancedserverlist/bungeecord/events/BungeeEventWrapper.java
#	core/src/main/java/ch/andre601/advancedserverlist/core/events/PingEventHandler.java
#	core/src/main/java/ch/andre601/advancedserverlist/core/interfaces/events/GenericEventWrapper.java
#	paper/src/main/java/ch/andre601/advancedserverlist/paper/events/PaperEventWrapper.java
#	paper/src/main/java/ch/andre601/advancedserverlist/paper/objects/PaperPlayer.java
#	paper/src/main/java/ch/andre601/advancedserverlist/paper/objects/PlayerPlaceholders.java
#	spigot/src/main/java/ch/andre601/advancedserverlist/spigot/events/ProtocolLibEventWrapper.java
#	spigot/src/main/java/ch/andre601/advancedserverlist/spigot/objects/SpigotPlayer.java
#	velocity/src/main/java/ch/andre601/advancedserverlist/velocity/events/VelocityEventWrapper.java
#	velocity/src/main/java/ch/andre601/advancedserverlist/velocity/objects/VelocityPlayer.java
2023-01-11 22:45:43 +01:00
Andre_601 3859f2970f Merge pull request #41 from Andre601/feature/uuid-usage
Improve player caching behaviour
2023-01-10 20:36:34 +01:00
Andre601 71079bf9d8 Bump version 2023-01-09 20:47:46 +01:00
Andre601 4fa7e92264 Make CachedPlayer its own class 2023-01-09 20:46:46 +01:00
Andre_601 828d907371 Merge branch 'master' into feature/uuid-usage 2023-01-09 20:37:36 +01:00
Andre601 986c36a334 tiny typo fix 2023-01-09 20:36:08 +01:00
Andre_601 8f9ae4a835 Merge pull request #43 from Andre601/fix/nullpointerexceptions
Fix some NullPointerExceptions
2023-01-09 20:32:01 +01:00
Andre601 0dccdaf7e4 Add a comment 2023-01-09 20:31:31 +01:00
Andre601 ec0dec8e7d Try to fix errors with OkHttpClient 2023-01-09 17:59:23 +01:00
Andre601 f399ed6886 Fix some NullPointerExceptions 2023-01-09 17:42:54 +01:00
Andre_601 f2737f2b19 Merge pull request #42 from Andre601/dependabot/maven/core/com.google.code.gson-gson-2.10.1
Bump gson from 2.10 to 2.10.1 in /core
2023-01-09 16:20:46 +01:00
dependabot[bot] 504e669ce7 Bump gson from 2.10 to 2.10.1 in /core
Bumps [gson](https://github.com/google/gson) from 2.10 to 2.10.1.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.10...gson-parent-2.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-09 15:16:41 +00:00
Andre601 0cae58c9b6 Update Copyright 2023-01-01 00:33:39 +01:00
Andre_601 a8d6fc48bf Merge branch 'master' into feature/add-api 2022-12-31 23:06:26 +01:00
Andre601 91dcb49e81 Update log messages 2022-12-31 16:40:57 +01:00
Andre601 c8a1224f53 Fix broken logic and make ${player uuid} always available 2022-12-31 16:21:26 +01:00
Andre601 5722700d20 Improve player caching behaviour 2022-12-31 01:25:57 +01:00
Andre_601 1effc2574a Update release.yml 2022-12-28 20:15:16 +01:00
Andre_601 eb7a7fa6c7 Delete prerelease.yml 2022-12-28 20:15:07 +01:00
Andre601 9f6bdea168 Add better Version check (+ tests) 2022-12-28 16:58:23 +01:00
Andre601 c964c942dc Implement latest changes from v1.10.0 2022-12-28 14:00:19 +01:00
Andre601 27c591d92c Merge branch 'master' into feature/add-api
# Conflicts:
#	core/src/main/java/ch/andre601/advancedserverlist/core/events/PingEventHandler.java
#	core/src/main/java/ch/andre601/advancedserverlist/core/profiles/ProfileManager.java
#	core/src/main/java/ch/andre601/advancedserverlist/core/profiles/ServerListProfile.java
2022-12-28 13:47:46 +01:00
Andre_601 d247d832e6 Update prerelease.yml 2022-12-27 22:02:32 +01:00
Andre_601 708037bb6b Update release.yml 2022-12-27 22:02:05 +01:00
Andre_601 7da88771b6 Update prerelease.yml 2022-12-27 21:27:01 +01:00
Andre_601 9ccfd4674c Add workflow for beta-releases 2022-12-27 21:26:16 +01:00
Andre_601 9054ebdb0c Merge pull request #40 from Andre601/feature/multi-profiles
Implement system for multiple profiles in profiles
2022-12-27 21:22:25 +01:00
Andre601 edfd77e891 Fix wrong hidePlayersEnabled call. 2022-12-27 21:19:01 +01:00
Andre601 94391a8aed Make booleans and int nullable + version bump 2022-12-27 21:16:23 +01:00
Andre601 5a1f343cc2 Update config.yml 2022-12-27 18:03:07 +01:00
Andre601 e718a5c766 Improve descriptions 2022-12-27 18:01:40 +01:00
Andre601 565644ccd5 Add profiles example 2022-12-27 17:51:07 +01:00
Andre601 9531af1fdd Don't use random on a single entry 2022-12-27 16:56:50 +01:00
Andre601 7c1d7aadbc Try a system with fallback to def profile 2022-12-27 16:46:02 +01:00
Andre601 f26f2ba269 Implement system for multiple profiles in profiles 2022-12-27 16:03:01 +01:00
Andre601 de2d43f01c fix methods and imports 2022-12-20 23:48:03 +01:00
Andre_601 3fde989eb5 Merge branch 'master' into feature/add-api 2022-12-20 23:44:28 +01:00
Andre_601 f5d2fd1534 Merge pull request #39 from Andre601/feature/multiple-motds
Add option to have multiple MOTDs.
2022-12-20 22:22:49 +01:00
Andre601 90537eb004 Bump Version for release 2022-12-20 22:22:14 +01:00
Andre601 ce6a9e3b0b Use a Builder class to make ServerListProfile immutable... I guess? 2022-12-18 21:32:35 +01:00
Andre601 4d29f9e45e Add option to have multiple MOTDs. 2022-12-18 17:45:38 +01:00
Andre601 c1fa8d0df1 Add maven-compiler-plugin + throws docs 2022-12-16 17:05:06 +01:00
Andre601 f0446fe8f4 Move API to own module 2022-12-16 16:55:21 +01:00
Andre601 5509fb4380 Add and improve javadoc comments 2022-12-11 23:46:26 +01:00
Andre601 d0f7bf9897 Start with an API for custom placeholder support 2022-12-11 23:26:54 +01:00
Andre601 bf49636d6a Update workflow 2022-12-09 22:27:44 +01:00
Andre601 4a6c9a55d4 Update required libraries 2022-12-09 22:26:44 +01:00
Andre601 a5bfc0b6e3 Smaller format correction + version bump 2022-12-09 22:23:24 +01:00
Andre_601 dff332a83a Merge pull request #37 from Andre601/dependabot/maven/spigot/net.kyori-adventure-platform-bukkit-4.2.0
Bump adventure-platform-bukkit from 4.1.2 to 4.2.0 in /spigot
2022-12-09 16:10:29 +01:00
dependabot[bot] 58a16baaab Bump adventure-platform-bukkit from 4.1.2 to 4.2.0 in /spigot
Bumps [adventure-platform-bukkit](https://github.com/KyoriPowered/adventure-platform) from 4.1.2 to 4.2.0.
- [Release notes](https://github.com/KyoriPowered/adventure-platform/releases)
- [Commits](https://github.com/KyoriPowered/adventure-platform/compare/v4.1.2...v4.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-09 15:08:40 +00:00
Andre_601 c8acb4d90a Merge pull request #36 from Andre601/feature/unified-eventhandler
Create unified EventHandler
2022-12-08 21:56:48 +01:00
Andre_601 5575243a79 Merge pull request #35 from Andre601/dependabot/maven/core/com.google.code.gson-gson-2.10
Bump gson from 2.9.1 to 2.10 in /core
2022-12-08 16:43:13 +01:00
Andre601 4cd4aeb12a Move Favicon creation and logging to PingEventHandler 2022-12-08 16:42:23 +01:00
Andre601 5922b2235e Bump version 2022-12-07 21:19:23 +01:00
Andre601 2fcef08f5a Wrap up (no pun intended) remaining platform events 2022-12-07 16:28:39 +01:00
Andre601 30c28b07a4 Smaller changes 2022-12-06 21:32:16 +01:00
Andre601 08b4f1029c Make Protocol and ServerPing final 2022-12-06 21:27:09 +01:00
Andre601 f5051022aa Create unified EventHandler 2022-12-06 21:24:43 +01:00
dependabot[bot] fe51e78764 Bump gson from 2.9.1 to 2.10 in /core
Bumps [gson](https://github.com/google/gson) from 2.9.1 to 2.10.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.9.1...gson-parent-2.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 15:11:07 +00:00
Andre_601 5b2d9d910f Use env variables 2022-12-06 14:17:34 +01:00
Andre_601 6f06c47de7 Merge pull request #34 from Andre601/feature/update-checker
Add Update Checker
2022-12-06 14:03:25 +01:00
Andre601 ad3ba0c8b3 Update config description 2022-12-06 00:49:52 +01:00
Andre601 12d8d930dd Use a ScheduledExecutorService instead of Timer 2022-12-06 00:26:55 +01:00
Andre601 9a30a6b679 Add info line 2022-12-06 00:01:24 +01:00
Andre601 b82cf69d43 Simplify more. 2022-12-05 23:58:05 +01:00
Andre601 fb6d93b455 Init timer only when UpdateChecker is used. 2022-12-05 23:55:54 +01:00
Andre601 a1276da68f Fix exceptions 2022-12-05 23:13:21 +01:00
Andre601 25c053d495 Use timer class from Java 2022-12-05 22:24:19 +01:00
Andre601 39c1fb5452 Better version comparison. 2022-12-05 21:26:24 +01:00
Andre601 48edebc043 Add config option 2022-12-03 20:29:45 +01:00
Andre601 3a672378ff Add Update Checker 2022-12-03 20:23:21 +01:00
Andre_601 9db9f2be7f Merge pull request #33 from Andre601/dependabot/maven/core/net.kyori-adventure-api-4.12.0
Bump adventure-api from 4.11.0 to 4.12.0 in /core
2022-11-28 16:31:53 +01:00
Andre_601 2cf47e351b Merge pull request #32 from Andre601/dependabot/maven/core/net.kyori-adventure-text-minimessage-4.12.0
Bump adventure-text-minimessage from 4.11.0 to 4.12.0 in /core
2022-11-28 16:31:39 +01:00
Andre_601 36abdb83cd Merge pull request #31 from Andre601/dependabot/maven/core/net.kyori-adventure-text-serializer-legacy-4.12.0
Bump adventure-text-serializer-legacy from 4.11.0 to 4.12.0 in /core
2022-11-28 16:31:21 +01:00
dependabot[bot] ad950bf330 Bump adventure-api from 4.11.0 to 4.12.0 in /core
Bumps [adventure-api](https://github.com/KyoriPowered/adventure) from 4.11.0 to 4.12.0.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.11.0...v4.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 15:12:17 +00:00
dependabot[bot] 143753d309 Bump adventure-text-minimessage from 4.11.0 to 4.12.0 in /core
Bumps [adventure-text-minimessage](https://github.com/KyoriPowered/adventure) from 4.11.0 to 4.12.0.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.11.0...v4.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 15:12:10 +00:00
dependabot[bot] 0c37c21650 Bump adventure-text-serializer-legacy from 4.11.0 to 4.12.0 in /core
Bumps [adventure-text-serializer-legacy](https://github.com/KyoriPowered/adventure) from 4.11.0 to 4.12.0.
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.11.0...v4.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 15:12:04 +00:00
Andre_601 40a6b4f059 Merge pull request #30 from Andre601/dependabot/maven/core/com.github.ben-manes.caffeine-caffeine-3.1.2
Bump caffeine from 3.1.1 to 3.1.2 in /core
2022-11-24 16:24:36 +01:00
dependabot[bot] 965e87d71b Bump caffeine from 3.1.1 to 3.1.2 in /core
Bumps [caffeine](https://github.com/ben-manes/caffeine) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/ben-manes/caffeine/releases)
- [Commits](https://github.com/ben-manes/caffeine/compare/v3.1.1...v3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-24 15:08:34 +00:00
Andre_601 202a22f33a Update README.md 2022-11-21 15:20:02 +01:00
Andre_601 a4b2a6c350 Update MODRINTH.md 2022-11-21 15:03:28 +01:00
Andre601 ba55f5299b Bump version 2022-11-07 22:29:04 +01:00
Andre_601 24fdf798cf Merge pull request #29 from Andre601/feature/disable-cache-option
Add option to disable Cache
2022-11-07 22:28:16 +01:00
Andre601 e208d181b7 Add option to disable Cache 2022-11-07 22:14:50 +01:00
Andre_601 6c15c7b259 Merge pull request #28 from Andre601/dependabot/maven/paper/org.apache.maven.plugins-maven-shade-plugin-3.4.1
Bump maven-shade-plugin from 3.4.0 to 3.4.1 in /paper
2022-10-27 17:55:21 +02:00
Andre_601 dcd76a43f5 Merge pull request #27 from Andre601/dependabot/maven/bungeecord/org.apache.maven.plugins-maven-shade-plugin-3.4.1
Bump maven-shade-plugin from 3.4.0 to 3.4.1 in /bungeecord
2022-10-27 17:55:10 +02:00
Andre_601 adc2060499 Merge pull request #26 from Andre601/dependabot/maven/velocity/org.apache.maven.plugins-maven-shade-plugin-3.4.1
Bump maven-shade-plugin from 3.4.0 to 3.4.1 in /velocity
2022-10-27 17:55:01 +02:00
Andre_601 4d6befc857 Merge pull request #25 from Andre601/dependabot/maven/core/org.apache.maven.plugins-maven-shade-plugin-3.4.1
Bump maven-shade-plugin from 3.4.0 to 3.4.1 in /core
2022-10-27 17:54:52 +02:00
dependabot[bot] 7cfb792471 Bump maven-shade-plugin from 3.4.0 to 3.4.1 in /paper
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.4.0...maven-shade-plugin-3.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-27 15:41:21 +00:00
dependabot[bot] d46245eefa Bump maven-shade-plugin from 3.4.0 to 3.4.1 in /bungeecord
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.4.0...maven-shade-plugin-3.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-27 15:41:17 +00:00
dependabot[bot] d5e0fd3d7a Bump maven-shade-plugin from 3.4.0 to 3.4.1 in /velocity
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.4.0...maven-shade-plugin-3.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-27 15:41:11 +00:00
dependabot[bot] 496e246b9e Bump maven-shade-plugin from 3.4.0 to 3.4.1 in /core
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.4.0...maven-shade-plugin-3.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-27 15:41:11 +00:00
Andre_601 e263a45f1c width and not height 2022-10-05 17:40:40 +02:00
Andre_601 edfc977730 Update MODRINTH.md 2022-10-05 17:40:01 +02:00
Andre_601 5910c26b4b Add waterfall badge 2022-10-03 23:49:07 +02:00
Andre_601 5b9c506a89 Use jsdelivr url 2022-09-26 00:17:47 +02:00
Andre_601 913ddd7834 Create MODRINTH.md 2022-09-22 13:41:05 +02:00
Andre_601 397c7ea59a Merge pull request #23 from Andre601/feature/readme-new-badges
Prepare readme for new badges
2022-09-21 01:48:30 +02:00
Andre_601 6e7b2541e1 Update README.md 2022-09-21 01:48:22 +02:00
Andre_601 241c15a452 Update README.md 2022-09-20 22:07:40 +02:00
Andre_601 62c5d13aa2 Prepare readme for new badges 2022-09-20 22:05:33 +02:00
Andre601 3a73c5ce6b Fix wrong open-perms for certain OS 2022-09-20 00:41:33 +02:00
Andre_601 bf54e8eb0b Yes I update the README a lot today... 2022-09-18 01:45:46 +02:00
Andre_601 aa2cabedbf Update README.md 2022-09-18 01:09:01 +02:00
Andre_601 66878626e1 Update README.md 2022-09-17 23:35:34 +02:00
Andre_601 f6f3f3d8b6 Update README.md 2022-09-17 23:25:48 +02:00
Andre601 85e41b6c7e Fix wrong formatted messages in /asl reload 2022-09-17 22:51:33 +02:00
Andre_601 a220efc624 Update README.md 2022-09-17 17:58:49 +02:00
Andre_601 ea8871ce8f Update README.md 2022-09-17 17:50:32 +02:00
Andre_601 ea0fdc3798 Update README.md 2022-09-17 17:50:06 +02:00
Andre_601 1188ab0c9c Create config.yml 2022-09-15 01:52:30 +02:00
Andre_601 aaefd4c928 Create feature_request.yml 2022-09-15 01:50:28 +02:00
Andre_601 940bf2fb9d fix typo 2022-09-15 01:20:23 +02:00
Andre_601 0c24bf8d24 Update bug_report.yml 2022-09-15 01:19:36 +02:00
Andre_601 564ce7a820 Create bug_report.yml 2022-09-15 01:18:54 +02:00
Andre_601 bb8cd21b86 Merge pull request #22 from Andre601/dependabot/maven/velocity/org.apache.maven.plugins-maven-shade-plugin-3.4.0
Bump maven-shade-plugin from 3.3.0 to 3.4.0 in /velocity
2022-09-14 18:33:57 +02:00
Andre_601 2d2d8a6175 Merge pull request #20 from Andre601/dependabot/maven/bungeecord/org.apache.maven.plugins-maven-shade-plugin-3.4.0
Bump maven-shade-plugin from 3.3.0 to 3.4.0 in /bungeecord
2022-09-14 18:33:48 +02:00
Andre_601 fcd4bdbe14 Merge pull request #19 from Andre601/dependabot/maven/paper/org.apache.maven.plugins-maven-shade-plugin-3.4.0
Bump maven-shade-plugin from 3.3.0 to 3.4.0 in /paper
2022-09-14 18:33:37 +02:00
Andre_601 3a9b2a7c5a Merge pull request #18 from Andre601/dependabot/maven/core/org.apache.maven.plugins-maven-shade-plugin-3.4.0
Bump maven-shade-plugin from 3.3.0 to 3.4.0 in /core
2022-09-14 18:33:27 +02:00
dependabot[bot] 3b3793ab9a Bump maven-shade-plugin from 3.3.0 to 3.4.0 in /velocity
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.3.0...maven-shade-plugin-3.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-14 16:33:17 +00:00
Andre_601 d679694d6e Merge pull request #21 from Andre601/dependabot/maven/spigot/org.apache.maven.plugins-maven-shade-plugin-3.4.0
Bump maven-shade-plugin from 3.3.0 to 3.4.0 in /spigot
2022-09-14 18:33:09 +02:00
dependabot[bot] 47405f7492 Bump maven-shade-plugin from 3.3.0 to 3.4.0 in /spigot
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.3.0...maven-shade-plugin-3.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-14 16:31:57 +00:00
dependabot[bot] af7408dcd5 Bump maven-shade-plugin from 3.3.0 to 3.4.0 in /bungeecord
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.3.0...maven-shade-plugin-3.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-14 16:31:30 +00:00
dependabot[bot] 17d0930195 Bump maven-shade-plugin from 3.3.0 to 3.4.0 in /paper
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.3.0...maven-shade-plugin-3.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-14 16:31:28 +00:00
dependabot[bot] 91cd3b6032 Bump maven-shade-plugin from 3.3.0 to 3.4.0 in /core
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.3.0...maven-shade-plugin-3.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-14 16:31:26 +00:00
Andre601 2d67145ae5 Bump version 2022-09-09 23:33:22 +02:00
Andre601 ba1dd8a70d Fix clearFaviconCache() + expression error 2022-09-09 23:33:00 +02:00
Andre_601 4ea77f2907 Update README.md 2022-09-09 15:11:42 +02:00
Andre_601 7fdc23baa1 Update release.yml 2022-09-09 14:52:13 +02:00
Andre601 d630b472ca Simplify validation check 2022-09-09 01:39:15 +02:00
130 changed files with 6414 additions and 1782 deletions

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
name: API support
description: Ask for help with the API.
body:
- type: markdown
attributes:
value: |-
## Before opening
Please make sure you've checked the following things first:
- You're using the latest release of AdvancedServerList [[Download from Modrinth](https://modrinth.com/plugin/advancedserverlist)] and the right API version.
- You're using a supported Proxy/Server version. As of right now is only 1.19.x supported.
- The Feature you suggest hasn't been suggested before.
- type: dropdown
attributes:
label: Platforms
description: On what platform(s) are you using the API?
multiple: true
options:
- Proxy (BungeeCord, Waterfall, ...)
- Proxy (Velocity)
- Server (Spigot, Paper, ...)
validations:
required: true
- type: textarea
attributes:
label: Description
description: |-
Give a detailed description of what exactly you try to do, what steps you did and what you need help with.
placeholder: I tried to...
validations:
required: true
- type: textarea
attributes:
label: Code
description: |-
Provide code-snippets to help us better understand what you tried.
The code is automatically parsed as Java Code.
render: java
validations:
required: true
+62
View File
@@ -0,0 +1,62 @@
name: Bug Report
description: Report an issue with the plugin
body:
- type: markdown
attributes:
value: |-
## Before opening
Please make sure you've checked the following things first:
- You're using the latest release of AdvancedServerList [[Download from Modrinth](https://modrinth.com/plugin/advancedserverlist)]
- You're using a supported Proxy/Server version. As of right now is only 1.19.x supported.
- The issue happens with just AdvancedServerList installed.
- type: dropdown
attributes:
label: Platform
description: On what platform do you use the plugin?
options:
- BungeeCord
- Other (Please specify)
- Paper
- Purpur
- Spigot
- Velocity
- Waterfall
validations:
required: true
- type: input
attributes:
label: Other platform
description: |-
Please provide the name of the platform (Proxy/Server) you use, if you selected `Other (Please specify)` in the above section.
Leave empty otherwise.
placeholder: SomeProxy
- type: textarea
attributes:
label: What happened?
description: |-
Give a detailed description of what exactly happened.
You can provide screenshots to further explain the issues.
When sharing errors, make sure to use a site such as https://paste.helpch.at to do so.
placeholder: When I do ... does ... happen.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: Provide a detailed step-by-step explanation on how to reproduce this issue.
placeholder: |-
1. Do this
2. ...
3. Profit!
validations:
required: true
- type: textarea
attributes:
label: Server List Profiles
description: |-
**Optional**
Provide any Server List Profiles you use, if you believe those to be the cause of the issue.
This text field will automatically render the text as YAML code.
render: yaml
+8
View File
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Discord Server
about: Ask questions about the plugin in the `#advancedserverlist` channel.
url: https://discord.gg/6dazXp6
- name: Wiki
about: Check the Wiki for explanations about the features and examples.
url: https://github.com/Andre601/AdvancedServerList/wiki
@@ -0,0 +1,34 @@
name: Feature Request
description: Suggest a new feature for the plugin
body:
- type: markdown
attributes:
value: |-
## Before opening
Please make sure you've checked the following things first:
- You're using the latest release of AdvancedServerList [[Download from Modrinth](https://modrinth.com/plugin/advancedserverlist)]
- You're using a supported Proxy/Server version. As of right now is only 1.19.x supported.
- The Feature you suggest hasn't been suggested before.
- type: dropdown
attributes:
label: Platforms
description: What platforms should this feature be usable on
multiple: true
options:
- Proxy (BungeeCord, Waterfall, ...)
- Proxy (Velocity)
- Server (Spigot, Paper, ...)
validations:
required: true
- type: textarea
attributes:
label: Feature
description: |-
Give a detailed description of what exactly should be added and/or changed in AdvancedServerList.
You can provide screenshots to further explain the idea.
When sharing code snippets, make sure to use a site such as https://paste.helpch.at to do so.
placeholder: AdvancedServerList should get ... because ...
validations:
required: true
+108
View File
@@ -0,0 +1,108 @@
# AdvancedServerList
AdvancedServerList is a plugin that allowys you to customize your server's MOTD, favicon, Player count text and player count hover displayed in a player's multiplayer server list based on conditions and priorities.
## Supported Platforms
<a href="https://www.spigotmc.org" target="_blank">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/spigot_vector.svg&w=64 alt="platform-spigot" title="Tested on Spigot">
</a>
<a href="https://papermc.io" target="_blank">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/paper_vector.svg&w=64 alt="platform-paper" title="Tested on Paper">
</a>
<a href="https://www.spigotmc.org" target="_blank">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/bungeecord_vector.svg&w=64 alt="platform-bungeecord" title="Tested on BungeeCord">
</a>
<a href="https://www.papermc.io" target="_blank">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/waterfall_vector.svg&w=64 alt="platform-waterfall" title="Tested on Waterfall">
</a>
<a href="https://velocitypowered.com" target="_blank">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/supported/velocity_vector.svg&w=64 alt="platform-velocity" title="Tested on Velocity">
</a>
## What is a Server List Profile?
A Server List Profile refers to a YAML file located in the plugin's `profiles` directory.
It allows you to configure specific aspects of the server display in the MC-Client's multiplayer server list, such as the MOTD, player count text, player count hover or Favicon.
> [*Read More*][profiles]
### Conditions
Thanks to conditions can you determine when a profile should be displayed in the player’s server list, to allow displaying specific text (i.e. a warning when they are using an outdated version).
When multiple profiles exist that have valid conditions will the one with the highest priority (Higher number = higher priority) be selected. Having no conditions makes the profile automatically return true.
> [*Read More*][conditions]
### Placeholders
Placeholders can be used within conditions to further customize them. They can also be used in any other text option (motd, playerCount and players) to display their respective values.
The format is `${<target> <identifier>}` which was adopted from BungeeTabListPlus. Depending on what platform you use the plugin on are only specific placeholders available.
When using the SpigotMC/PaperMC version can you also use placeholders from [PlaceholderAPI][placeholderapi] using its `%<identifier>_<values>%` placeholder format. PlaceholderAPI needs to be installed for that.
> [*Read More*][placeholders]
### Formatting
The plugin uses the MiniMessage format for a consistent, easy way of formatting your text.
Only certain options are usable for each option. As an example does motd support HEX colours and gradients, while the other options only support default colour codes.
> [*Read More*][minimessage]
## Dependencies
| Dependency | Platforms | Required? |
|------------------|---------------|-----------|
| [ProtocolLib] | Spigot | Yes |
| [PlaceholderAPI] | Spigot, Paper | No |
| [ViaVersion] | Spigot, Paper | No |
## Statistics
This plugin sends statistics to [bStats] to display.
You can disable this in the global bStats config file located in `/plugins/bstats/`
- [BungeeCord][bstats-bungee]
- [Paper/Spigot][bstats-spigot]
- [Velocity][bstats-velocity]
## Videos
Do you have your own video to share? Contact me and I will add it to this section.
<details><summary>Click to Show/Hide Videos</summary>
Spanish Video by Ajneb97
<iframe width="560" height="auto" src="https://www.youtube.com/embed/rIbljm_4HVI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</details>
## Screenshots
<a href="https://modrinth.com/plugin/advancedserverlist/gallery" target="_blank">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/documentation/modrinth-gallery_vector.svg&w=208" alt="gallery" title="Check out the Gallery">
</a>
## Support
<a href="https://discord.gg/6dazXp6" target="_blank">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/social/discord-singular_vector.svg&w=64" alt="discord" title="Join my Discord Server">
</a>
<a href="https://app.revolt.chat/invite/74TpERXA" target="_blank">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/social/revolt-singular_vector.svg&w=64" alt="revolt" title="Join my Revolt Server">
</a>
<a href="https://blobfox.coffee/@andre_601" target="_blank">
<img src="https://wsrv.nl/?url=https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact-minimal/social/mastodon-singular_vector.svg&w=64" alt="revolt" title="Chat with me on Mastodon">
</a>
<!-- Links -->
[profiles]: https://andre601.ch/AdvancedServerList/latest/profiles
[conditions]: https://andre601.ch/AdvancedServerList/latest/profiles/#conditions
[placeholders]: https://andre601.ch/AdvancedServerList/latest/profiles/placeholders
[minimessage]: https://andre601.ch/AdvancedServerList/latest/profiles/formatting
[protocollib]: https://www.spigotmc.org/resources/1997/
[placeholderapi]: https://www.spigotmc.org/resources/6245/
[viaversion]: https://www.spigotmc.org/resources/19254/
[bstats]: https://bstats.org
[bstats-bungee]: https://bstats.org/plugin/bungeecord/AdvancedServerList/15585
[bstats-spigot]: https://bstats.org/plugin/bukkit/AdvancedServerList/15584
[bstats-velocity]: https://bstats.org/plugin/velocity/AdvancedServerList/15587
[gallery]: https://modrinth.com/mod/advancedserverlist/gallery
+7
View File
@@ -0,0 +1,7 @@
<!-- pr-build comment -->
![badge]
Building jar file from Pull request. Please wait...
[badge]: https://img.shields.io/badge/Building...-0d1117?style=for-the-badge&labelColor=7a8490&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNNC43NSAyaDE0LjVhLjc1Ljc1IDAgMCAxIDAgMS41aC0uNzV2Mi45ODJhNC43NSA0Ljc1IDAgMCAxLTIuMjE1IDQuMDE3bC0yLjA0NCAxLjI5YS4yNS4yNSAwIDAgMCAwIC40MjJsMi4wNDQgMS4yOWE0Ljc1IDQuNzUgMCAwIDEgMi4yMTUgNC4wMTdWMjAuNWguNzVhLjc1Ljc1IDAgMCAxIDAgMS41SDQuNzVhLjc1Ljc1IDAgMCAxIDAtMS41aC43NXYtMi45ODJhNC43NSA0Ljc1IDAgMCAxIDIuMjE1LTQuMDE3bDIuMDQ0LTEuMjlhLjI1LjI1IDAgMCAwIDAtLjQyMmwtMi4wNDQtMS4yOUE0Ljc1IDQuNzUgMCAwIDEgNS41IDYuNDgyVjMuNWgtLjc1YS43NS43NSAwIDAgMSAwLTEuNVpNMTcgMy41SDd2Mi45ODJBMy4yNSAzLjI1IDAgMCAwIDguNTE2IDkuMjNsMi4wNDQgMS4yOWExLjc1IDEuNzUgMCAwIDEgMCAyLjk2bC0yLjA0NCAxLjI5QTMuMjUgMy4yNSAwIDAgMCA3IDE3LjUxOFYyMC41aDEwdi0yLjk4MmEzLjI1IDMuMjUgMCAwIDAtMS41MTYtMi43NDhsLTIuMDQ0LTEuMjlhMS43NSAxLjc1IDAgMCAxIDAtMi45NmwyLjA0NC0xLjI5QTMuMjUgMy4yNSAwIDAgMCAxNyA2LjQ4MloiPjwvcGF0aD48L3N2Zz4=
+12
View File
@@ -0,0 +1,12 @@
<!-- pr-build comment -->
![badge]
**Compiling of jar files failed!**
Please check the logs below for any errors.
| Name | Link |
| ------ | -------------------------------- |
| Commit | {{ .commit }} |
| Logs | {{ .logs | mdlink "View Logs" }} |
[badge]: https://img.shields.io/badge/Build_Failure!-0d1117?style=for-the-badge&labelColor=f85149&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNNS43MiA1LjcyYS43NS43NSAwIDAgMSAxLjA2IDBMMTIgMTAuOTRsNS4yMi01LjIyYS43NDkuNzQ5IDAgMCAxIDEuMjc1LjMyNi43NDkuNzQ5IDAgMCAxLS4yMTUuNzM0TDEzLjA2IDEybDUuMjIgNS4yMmEuNzQ5Ljc0OSAwIDAgMS0uMzI2IDEuMjc1Ljc0OS43NDkgMCAwIDEtLjczNC0uMjE1TDEyIDEzLjA2bC01LjIyIDUuMjJhLjc1MS43NTEgMCAwIDEtMS4wNDItLjAxOC43NTEuNzUxIDAgMCAxLS4wMTgtMS4wNDJMMTAuOTQgMTIgNS43MiA2Ljc4YS43NS43NSAwIDAgMSAwLTEuMDZaIj48L3BhdGg+PC9zdmc+
+15
View File
@@ -0,0 +1,15 @@
<!-- pr-build comment -->
![badge]
The compiling of the jar files was successful!
You can find a direct download for the artifact below.
File expires: `{{ .expire | date "02 Jan 2006 15:04 MST" }}`
| Name | Link |
| -------- | -------------------------------------------- |
| Commit | {{ .commit }} |
| Logs | {{ .logs | mdlink "View Logs" }} |
| Download | {{ .download | mdlink "Download Artifact" }} |
[badge]: https://img.shields.io/badge/Build_Success!-0d1117?style=for-the-badge&labelColor=3fb950&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNMjEuMDMgNS43MmEuNzUuNzUgMCAwIDEgMCAxLjA2bC0xMS41IDExLjVhLjc0Ny43NDcgMCAwIDEtMS4wNzItLjAxMmwtNS41LTUuNzVhLjc1Ljc1IDAgMSAxIDEuMDg0LTEuMDM2bDQuOTcgNS4xOTVMMTkuOTcgNS43MmEuNzUuNzUgMCAwIDEgMS4wNiAwWiI+PC9wYXRoPjwvc3ZnPg==
+10 -10
View File
@@ -17,21 +17,13 @@ updates:
- 'Type: Update Dependency'
- 'Target: Core'
- package-ecosystem: maven
directory: "/paper"
directory: "/bukkit"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- 'Type: Update Dependency'
- 'Target: PaperMC'
- package-ecosystem: maven
directory: "/spigot"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- 'Type: Update Dependency'
- 'Target: Spigot'
- 'Target: Bukkit'
- package-ecosystem: maven
directory: "/velocity"
schedule:
@@ -48,3 +40,11 @@ updates:
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'
+100
View File
@@ -0,0 +1,100 @@
name: Create PR Artifacts
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
branches:
- master
paths-ignore:
- '.github/**'
- 'docs/**'
- '.gitignore'
- 'LICENSE'
- 'README.md'
- 'mkdocs.yml'
- 'requirements.txt'
concurrency:
group: '${{ github.workflow }}-${{ github.head_ref }}'
cancel-in-progress: false
permissions:
issues: write
pull-requests: write
jobs:
buildArtifacts:
runs-on: ubuntu-latest
outputs:
comment_id: ${{ steps.comment.outputs.comment-id }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Find Comment
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- pr-build comment -->'
- name: Print Comment info
run: |
echo "Comment ID: ${{ steps.find-comment.outputs.comment-id }}"
echo "Comment Author: ${{ steps.find-comment.outputs.comment-author }}"
echo "Comment created at: ${{ steps.find-comment.outputs.comment-created-at }}"
- name: Post/Update Comment
uses: peter-evans/create-or-update-comment@v3
id: comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body-path: .github/assets/pr-comments/building.md
- name: Set up JDK 1.16
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '16'
cache: 'maven'
- name: Obtain short Commit SHA
id: get-commit
run: 'echo "sha_short=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})" >> $GITHUB_OUTPUT'
- name: Build Jar files
run: mvn clean install
env:
COMMIT_SHA: ${{ steps.get-commit.outputs.sha_short }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: AdvancedServerList-Artifacts
path: '*/target/AdvancedServerList-*.jar'
if-no-files-found: error
commentOnFail:
needs: [buildArtifacts]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Render Markdown Template
id: render
uses: chuhlomin/render-template@v1.7
with:
template: './.github/assets/pr-comments/failed.md'
vars: |
commit: ${{ github.event.pull_request.head.sha }}
logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Update Comment (Failure)
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ needs.buildArtifacts.outputs.comment_id }}
edit-mode: replace
body: ${{ steps.render.outputs.result }}
+35
View File
@@ -0,0 +1,35 @@
name: 'Deploy Site (Push)'
on:
workflow_dispatch:
push:
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'mkdocs-theme/**'
- 'requirements.txt'
branches:
- master
tags-ignore:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Create/Get Cache
uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements.txt
- name: Deploy Files
run: mkdocs gh-deploy --force
+99
View File
@@ -0,0 +1,99 @@
name: Comment on Pull request
on:
workflow_run:
types:
- completed
workflows:
- 'Create PR Artifacts'
permissions:
issues: write
pull-requests: write
jobs:
comment:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get Artifact and Pull request info
env:
GITHUB_TOKEN: ${{ github.token }} # Needs to be set as env variable so that 'gh api' can be used.
WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
run: |
PREVIOUS_JOB_ID=$(jq -r '.id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Previous Job ID: $PREVIOUS_JOB_ID"
echo "PREVIOUS_JOB_ID=$PREVIOUS_JOB_ID" >> "$GITHUB_ENV"
SUITE_ID=$(jq -r '.check_suite_id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Previous Suite ID: $SUITE_ID"
echo "SUITE_ID=$SUITE_ID" >> "$GITHUB_ENV"
ARTIFACT_ID=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
--jq ".artifacts.[] |
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
select(.expired==false) |
.id")
echo "Artifact ID: $ARTIFACT_ID"
echo "ARTIFACT_ID=$ARTIFACT_ID" >> "$GITHUB_ENV"
ARTIFACT_EXPIRE_DATE=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
--jq ".artifacts.[] |
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
select(.expired==false) |
.expires_at")
echo "Artifact Expire Date: $ARTIFACT_EXPIRE_DATE"
echo "ARTIFACT_EXPIRE_DATE=$ARTIFACT_EXPIRE_DATE" >> "$GITHUB_ENV"
PR_NUMBER=$(jq -r '.pull_requests[0].number' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Pull request Number: $PR_NUMBER"
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV"
HEAD_SHA=$(jq -r '.pull_requests[0].head.sha' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Head SHA: $HEAD_SHA"
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_ENV"
- name: Find Comment
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ env.PR_NUMBER }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- pr-build comment -->'
- name: Print Comment info
run: |
echo "Comment ID: ${{ steps.find-comment.outputs.comment-id }}"
echo "Comment Author: ${{ steps.find-comment.outputs.comment-author }}"
echo "Comment created at: ${{ steps.find-comment.outputs.comment-created-at }}"
- name: Render Markdown Template
id: render
uses: chuhlomin/render-template@v1.7
env:
JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ env.PREVIOUS_JOB_ID }}"
ARTIFACT_URL: "https://nightly.link/${{ github.repository }}/suites/${{ env.SUITE_ID }}/artifacts/${{ env.ARTIFACT_ID }}"
ARTIFACT_EXPIRE_DATE: "${{ env.ARTIFACT_EXPIRE_DATE }}"
HEAD_SHA: "${{ env.HEAD_SHA }}"
with:
template: './.github/assets/pr-comments/success.md'
timezone: Europe/Zurich
vars: |
commit: ${{ env.HEAD_SHA }}
logs: ${{ env.JOB_PATH }}
download: ${{ env.ARTIFACT_URL }}
expire: ${{ env.ARTIFACT_EXPIRE_DATE }}
- name: Update Comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ env.PR_NUMBER }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body: ${{ steps.render.outputs.result }}
+69 -49
View File
@@ -7,13 +7,22 @@ name: Publish Assets
on:
release:
types: [published]
types:
- published
jobs:
buildJars:
runs-on: ubuntu-latest
outputs:
plugin_release: ${{ steps.github-release.outputs.PLUGIN_RELEASE }}
steps:
- uses: actions/checkout@v3
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get Version from Release
id: github-release
run: |
version=$(echo ${{ github.event.release.tag_name }} | cut -d'v' -f2)
echo "PLUGIN_RELEASE=$version" >> $GITHUB_OUTPUT
- name: Set up JDK 1.16
uses: actions/setup-java@v3
with:
@@ -22,32 +31,13 @@ jobs:
cache: 'maven'
- name: Build Jar files
run: mvn clean install
- name: Save BungeeCord Jar file
- name: Save All files
uses: actions/upload-artifact@v3
with:
name: asl-bungeecord
path: bungeecord/target/AdvancedServerList-*.jar
if-no-files-found: error
retention-days: 1
- name: Save Paper Jar file
uses: actions/upload-artifact@v3
with:
name: asl-paper
path: paper/target/AdvancedServerList-*.jar
if-no-files-found: error
retention-days: 1
- name: Save Spigot Jar file
uses: actions/upload-artifact@v3
with:
name: asl-spigot
path: spigot/target/AdvancedServerList-*.jar
if-no-files-found: error
retention-days: 1
- name: Save Velocity Jar file
uses: actions/upload-artifact@v3
with:
name: asl-velocity
path: velocity/target/AdvancedServerList-*.jar
name: asl-files
path: |
*/target/AdvancedServerList-*.jar
hangar-uploader/target/HangarUploader.jar
if-no-files-found: error
retention-days: 1
publish:
@@ -55,15 +45,18 @@ jobs:
strategy:
matrix:
include:
- directory: bungeecord
- platforms: BungeeCord, Waterfall
directory: bungeecord
loaders: |
bungeecord
waterfall
- directory: paper
loaders: paper
- directory: spigot
loaders: spigot
- directory: velocity
- platforms: Spigot, Paper
directory: bukkit
loaders: |
spigot
paper
- platforms: Velocity
directory: velocity
loaders: velocity
runs-on: ubuntu-latest
steps:
@@ -71,29 +64,56 @@ jobs:
- name: Get Jar files
uses: actions/download-artifact@v3
with:
name: asl-${{ matrix.directory }}
path: ${{ matrix.directory }}/target
- name: Get Version
id: github-release
run: |
version=$(echo ${{ github.event.release.tag_name }} | cut -d'v' -f2)
echo "::set-output name=version::$version"
- name: Upload AdvancedServerList (${{ matrix.loaders }}) to GitHub and Modrinth
uses: Kir-Antipov/mc-publish@v3.2
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.name }}
version: ${{ steps.github-release.outputs.version }}
name: ${{ github.event.release.tag_name }} (${{ matrix.platforms }})
version: ${{ needs.buildJars.outputs.plugin_release }}
version-type: release
files: ${{ matrix.directory}}/target/AdvancedServerList-*.jar
files-secondary: ""
loaders: ${{ matrix.loaders }}
version-resolver: releases
game-versions: |
1.19
1.19.1
1.19.2
game-version-filter: releases
game-versions: '>=1.19'
java: 16
modrinth-id: xss83sOY
modrinth-featured: false
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload AdvancedServerList v${{ needs.buildJars.outputs.plugin_release }} (${{ matrix.loaders }}) to GitHub and Modrinth [Pre-Release]
if: 'github.event.release.prerelease'
uses: Kir-Antipov/mc-publish@v3.3
with:
name: ${{ github.event.release.tag_name }} (${{ matrix.platforms }})
version: ${{ needs.buildJars.outputs.plugin_release }}
version-type: beta
files: ${{ matrix.directory }}/target/AdvancedServerList-*.jar
loaders: ${{ matrix.loaders }}
game-version-filter: releases
game-versions: '>=1.19'
java: 16
modrinth-id: xss83sOY
modrinth-featured: false
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
publishHangar:
needs: [buildJars]
runs-on: ubuntu-latest
steps:
- name: Set up JDK 1.16
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '16'
- name: Download Release Assets
uses: actions/download-artifact@v3
with:
name: asl-files
- name: Move HangarUploader.jar
working-directory: hangar-uploader/target/
run: mv HangarUploader.jar ../../
- name: Execute HangarUploader.jar
run: java -jar HangarUploader.jar ${{ secrets.HANGAR_TOKEN }} ${{ needs.buildJars.outputs.plugin_release }} ${{ github.event.release.prerelease }}
env:
GITHUB_RELEASE_BODY: ${{ github.event.release.body }}
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2022 Andre_601
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
+55 -29
View File
@@ -1,7 +1,37 @@
# AdvancedServerList
![platform] ![tested]
AdvancedServerList is a plugin made for SpigotMC, PaperMC, BungeeCord/Waterfall and Velocity. It allows you to create server list profiles to display based on priority and conditions.
AdvancedServerList is a plugin that allowys you to customize your server's MOTD, favicon, Player count text and player count hover displayed in a player's multiplayer server list based on conditions and priorities.
## Downloads
<a href="https://modrinth.com/plugin/advancedserverlist" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact/available/modrinth_vector.svg" height="46" alt="modrinth" title="Available on Modrinth">
</a>
<br>
<a href="https://hangar.papermc.io/Andre_601/AdvancedServerList" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact/available/hangar_vector.svg" height="46" alt="hangar" title="Available on Hangar">
</a>
<br>
<a href="https://www.spigotmc.org/resources/102910" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@b9ff12b/assets/compact/available/spigot_vector.svg" height="46" alt="spigot" title="Available on SpigotMC">
</a>
## Supported Platforms
<a href="https://www.spigotmc.org" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/spigot_vector.svg" height="64" alt="platform-spigot" title="Tested on Spigot">
</a>
<a href="https://papermc.io" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/paper_vector.svg" height="64" alt="platform-paper" title="Tested on Paper">
</a>
<a href="https://www.spigotmc.org" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/bungeecord_vector.svg" height="64" alt="platform-bungeecord" title="Tested on BungeeCord">
</a>
<a href="https://www.papermc.io" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/waterfall_vector.svg" height="64" alt="platform-waterfall" title="Tested on Waterfall">
</a>
<a href="https://velocitypowered.com" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/velocity_vector.svg" height="64" alt="platform-velocity" title="Tested on Velocity">
</a>
## What is a Server List Profile?
A Server List Profile refers to a YAML file located in the plugin's `profiles` directory.
@@ -22,6 +52,8 @@ The format is `${<target> <identifier>}` which was adopted from BungeeTabListPlu
When using the SpigotMC/PaperMC version can you also use placeholders from [PlaceholderAPI][placeholderapi] using its `%<identifier>_<values>%` placeholder format. PlaceholderAPI needs to be installed for that.
If you're a plugin dev can you even add your own custom placeholders through AdvancedServerList's own API.
> [*Read More*][placeholders]
### Formatting
@@ -30,17 +62,13 @@ Only certain options are usable for each option. As an example does motd support
> [*Read More*][minimessage]
## Downloads
AdvancedServerList can be downloaded from the following places:
[![dl-modrinth]][modrinth] [![dl-spigot]][spigot] [![dl-hangar]][hangar]
## Dependencies
| Dependency | Platforms | Required? |
| ---------------- | ------------- | --------- |
|------------------|---------------|-----------|
| [ProtocolLib] | Spigot | Yes |
| [PlaceholderAPI] | Spigot, Paper | No |
| [ViaVersion] | Spigot, Paper | No |
## Statistics
@@ -53,23 +81,32 @@ You can disable this in the global bStats config file located in `/plugins/bstat
## Screenshots
Please see the [Gallery Tab][gallery] for some previews.
If you have any own screenshots, feel free to share them with me. I may add them to the Gallery if they are good.
<a href="https://modrinth.com/plugin/advancedserverlist/gallery" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/documentation/modrinth-gallery_vector.svg" height="64" alt="gallery" title="Check out the Gallery">
</a>
## Support
<a href="https://discord.gg/6dazXp6" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/social/discord-singular_vector.svg" height="64" alt="discord" title="Join my Discord Server">
</a>
<a href="https://app.revolt.chat/invite/74TpERXA" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/social/revolt-singular_vector.svg" height="64" alt="revolt" title="Join my Revolt Server">
</a>
<a href="https://blobfox.coffee/@andre_601" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/social/mastodon-singular_vector.svg" height="64" alt="mastodon" title="Chat with me on Mastodon">
</a>
<!-- Links -->
[profiles]: https://github.com/Andre601/AdvancedServerList/wiki/Profiles
[conditions]: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#conditions
[placeholders]: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#placeholders
[minimessage]: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#minimessage
[placeholderapi]: https://www.spigotmc.org/resources/6245/
[profiles]: https://www.andre601.ch/AdvancedServerList/profiles/
[conditions]: https://www.andre601.ch/AdvancedServerList/profiles/#conditions
[placeholders]: https://www.andre601.ch/AdvancedServerList/profiles/placeholders/
[minimessage]: https://www.andre601.ch/AdvancedServerList/profiles/formatting/
[modrinth]: https://modrinth.com/plugin/advancedserverlist
[spigot]: https://www.spigotmc.org/resources/102910/
[hangar]: https://hangar.benndorf.dev/Andre_601/AdvancedServerList
[protocollib]: https://www.spigotmc.org/resources/1997/
[placeholderapi]: https://www.spigotmc.org/resources/6245/
[viaversion]: https://www.spigotmc.org/resources/19254/
[bstats]: https://bstats.org
[bstats-bungee]: https://bstats.org/plugin/bungeecord/AdvancedServerList/15585
@@ -77,14 +114,3 @@ If you have any own screenshots, feel free to share them with me. I may add them
[bstats-velocity]: https://bstats.org/plugin/velocity/AdvancedServerList/15587
[gallery]: https://modrinth.com/mod/advancedserverlist/gallery
<!-- Badges -->
[platform]: https://img.shields.io/badge/Platforms-Spigot%20%7C%20Paper%20%7C%20BungeeCord%20%7C%20Velocity-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuMDYzIDEuNDU2YTEuNzUgMS43NSAwIDAxMS44NzQgMGw4LjM4MyA1LjMxNmExLjc1IDEuNzUgMCAwMTAgMi45NTZsLTguMzgzIDUuMzE2YTEuNzUgMS43NSAwIDAxLTEuODc0IDBMMi42OCA5LjcyOGExLjc1IDEuNzUgMCAwMTAtMi45NTZsOC4zODMtNS4zMTZ6bTEuMDcxIDEuMjY3YS4yNS4yNSAwIDAwLS4yNjggMEwzLjQ4MyA4LjAzOWEuMjUuMjUgMCAwMDAgLjQyMmw4LjM4MyA1LjMxNmEuMjUuMjUgMCAwMC4yNjggMGw4LjM4My01LjMxNmEuMjUuMjUgMCAwMDAtLjQyMmwtOC4zODMtNS4zMTZ6Ij48L3BhdGg+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMS44NjcgMTIuMzI0YS43NS43NSAwIDAxMS4wMzUtLjIzMmw4Ljk2NCA1LjY4NWEuMjUuMjUgMCAwMC4yNjggMGw4Ljk2NC01LjY4NWEuNzUuNzUgMCAwMS44MDQgMS4yNjdsLTguOTY1IDUuNjg1YTEuNzUgMS43NSAwIDAxLTEuODc0IDBsLTguOTY1LTUuNjg1YS43NS43NSAwIDAxLS4yMzEtMS4wMzV6Ij48L3BhdGg+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMS44NjcgMTYuMzI0YS43NS43NSAwIDAxMS4wMzUtLjIzMmw4Ljk2NCA1LjY4NWEuMjUuMjUgMCAwMC4yNjggMGw4Ljk2NC01LjY4NWEuNzUuNzUgMCAwMS44MDQgMS4yNjdsLTguOTY1IDUuNjg1YTEuNzUgMS43NSAwIDAxLTEuODc0IDBsLTguOTY1LTUuNjg1YS43NS43NSAwIDAxLS4yMzEtMS4wMzV6Ij48L3BhdGg+PC9zdmc+
[tested]: https://img.shields.io/badge/Tested%20Versions-1.19%20%7C%201.19.1%20%7C%201.19.2-blue?style=for-the-badge&logo=image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSI+PHBhdGggZD0iTTE3LjI4IDkuMjhhLjc1Ljc1IDAgMDAtMS4wNi0xLjA2bC01Ljk3IDUuOTctMi40Ny0yLjQ3YS43NS43NSAwIDAwLTEuMDYgMS4wNmwzIDNhLjc1Ljc1IDAgMDAxLjA2IDBsNi41LTYuNXoiPjwvcGF0aD48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjc1IDJBMS43NSAxLjc1IDAgMDAyIDMuNzV2MTYuNWMwIC45NjYuNzg0IDEuNzUgMS43NSAxLjc1aDE2LjVBMS43NSAxLjc1IDAgMDAyMiAyMC4yNVYzLjc1QTEuNzUgMS43NSAwIDAwMjAuMjUgMkgzLjc1ek0zLjUgMy43NWEuMjUuMjUgMCAwMS4yNS0uMjVoMTYuNWEuMjUuMjUgMCAwMS4yNS4yNXYxNi41YS4yNS4yNSAwIDAxLS4yNS4yNUgzLjc1YS4yNS4yNSAwIDAxLS4yNS0uMjVWMy43NXoiPjwvcGF0aD48L3N2Zz4=
[dl-modrinth]: https://img.shields.io/badge/Modrinth-30b27b?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEuNSIgY2xpcC1ydWxlPSJldmVub2RkIiB2aWV3Qm94PSIwIDAgNjggNjgiPjxwYXRoIGZpbGw9Im5vbmUiIGQ9Ik0uMDUgMGg2NnY2NmgtNjZ6Ii8+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBkPSJNLjA1IDBoNjZ2NjZoLTY2eiIvPjwvY2xpcFBhdGg+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48Y2xpcFBhdGggaWQ9ImIiPjxjaXJjbGUgY3g9IjMzLjA1IiBjeT0iMzMiIHI9IjMzIi8+PC9jbGlwUGF0aD48ZyBjbGlwLXBhdGg9InVybCgjYikiPjxjbGlwUGF0aCBpZD0iYyI+PHBhdGggZD0iTTgzLjA1LTE3aC0xMDBWODNoMTAwVi0xN1pNMjkuMDUxIDMyLjI5NWwuMDc3IDEuNzU3IDguODI5IDMyLjk2MyA3Ljg0NC0yLjEwMi04LjU5Ny0zMi4wOTRMNDMuMDA5LS4xMTNsLTcuOTk3LTEuNDEtNS45NjEgMzMuODE4WiIvPjwvY2xpcFBhdGg+PGcgY2xpcC1wYXRoPSJ1cmwoI2MpIj48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMzMuMDUgMGMxOC4yMDYgMCAzMi45ODggMTQuNzg3IDMyLjk4OCAzM1M1MS4yNTYgNjYgMzMuMDUgNjZDMTQuODQzIDY2IC4wNjEgNTEuMjEzLjA2MSAzM1MxNC44NDMgMCAzMy4wNSAwWm0wIDljMTMuMjQgMCAyMy45ODggMTAuNzU1IDIzLjk4OCAyNFM0Ni4yOSA1NyAzMy4wNSA1N0MxOS44MDkgNTcgOS4wNjEgNDYuMjQ1IDkuMDYxIDMzUzE5LjgwOSA5IDMzLjA1IDlaIi8+PC9nPjxjbGlwUGF0aCBpZD0iZCI+PHBhdGggZD0iTS0xNi45NS0xN3Y0Nmg1MGwxLjM2OC4yNDFMODIuMDUgNDYuNTc4bC0yLjczNyA3LjUxN0wzMi4zNDQgMzdILTE2Ljk1djQ2aDEwMFYtMTdoLTEwMFoiLz48L2NsaXBQYXRoPjxnIGNsaXAtcGF0aD0idXJsKCNkKSI+PHBhdGggZmlsbD0iI0ZGRiIgZD0iTTMzLjA1LTE3YzI3LjU5NSAwIDUwIDIyLjQwNCA1MCA1MHMtMjIuNDA1IDUwLTUwIDUwYy0yNy41OTYgMC01MC0yMi40MDQtNTAtNTBzMjIuNDA0LTUwIDUwLTUwWm0wIDljMjIuNjI4IDAgNDEgMTguMzcxIDQxIDQxcy0xOC4zNzIgNDEtNDEgNDFjLTIyLjYyOSAwLTQxLTE4LjM3MS00MS00MXMxOC4zNzEtNDEgNDEtNDFaIi8+PC9nPjxjbGlwUGF0aCBpZD0iZSI+PHBhdGggZD0iTTMzLjA1LTE3YzI3LjU5NSAwIDUwIDIyLjQwNCA1MCA1MHMtMjIuNDA1IDUwLTUwIDUwYy0yNy41OTYgMC01MC0yMi40MDQtNTAtNTBzMjIuNDA0LTUwIDUwLTUwWm0wIDM5LjU0OWM1Ljc2NyAwIDEwLjQ1IDQuNjgzIDEwLjQ1IDEwLjQ1MSAwIDUuNzY4LTQuNjgzIDEwLjQ1MS0xMC40NSAxMC40NTEtNS43NjggMC0xMC40NTEtNC42ODMtMTAuNDUxLTEwLjQ1MSAwLTUuNzY4IDQuNjgzLTEwLjQ1MSAxMC40NTEtMTAuNDUxWiIvPjwvY2xpcFBhdGg+PGcgY2xpcC1wYXRoPSJ1cmwoI2UpIj48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNGRkYiIHN0cm9rZS13aWR0aD0iOSIgZD0ibTMzLjA1IDMzLTQ0LjgyOSAyNS44ODIiLz48L2c+PGNsaXBQYXRoIGlkPSJmIj48cGF0aCBkPSJNMzMuMDUtMTdjMjcuNTk1IDAgNTAgMjIuNDA0IDUwIDUwcy0yMi40MDUgNTAtNTAgNTBjLTI3LjU5NiAwLTUwLTIyLjQwNC01MC01MHMyMi40MDQtNTAgNTAtNTBabTAgMjUuMzZjMTMuNTk5IDAgMjQuNjQgMTEuMDQxIDI0LjY0IDI0LjY0UzQ2LjY0OSA1Ny42NCAzMy4wNSA1Ny42NEMxOS40NSA1Ny42NCA4LjQwOSA0Ni41OTkgOC40MDkgMzNTMTkuNDUgOC4zNiAzMy4wNSA4LjM2WiIvPjwvY2xpcFBhdGg+PGcgY2xpcC1wYXRoPSJ1cmwoI2YpIj48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNGRkYiIHN0cm9rZS13aWR0aD0iOSIgZD0ibTMzLjA1IDMzIDUwLTEzLjM5NyIvPjwvZz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMjAuMjkzIDM1Ljc0NiAxOC4wNSAyOGw4LTkgMTEtMyA0IDQtNiA2LTQgMS0zIDQgMS4xMiA0LjI0IDMuMTEyIDMuMDkgNC45NjQtLjU5OCAyLjg2Ni0yLjk2NCA4LjE5Ni0yLjE5NiAxLjQ2NCA1LjQ2NC04LjA5OCA4LjAyNkwyOS44OCA0OC40OWwtNS41ODctNS44MTUtNC02LjkyOVoiLz48L2c+PC9nPjwvc3ZnPg==
[dl-spigot]: https://img.shields.io/badge/Spigot-ed8106?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBmaWxsPSIjRkZGIj48cGF0aCBkPSJNNDE2IDQ4MGMwIDE3LjYyIDE0LjM4IDMyIDMyIDMyczMyLTE0LjM4IDMyLTMycy0zMi02NC0zMi02NFM0MTYgNDYyLjQgNDE2IDQ4MHpNMzUyIDE5MmgtMzguNTRDMjk3LjcgMTc4LjUgMjc3LjkgMTY4LjkgMjU2IDE2NFYxMTYuNUwyMjQgMTEzTDE5MiAxMTYuNVYxNjRDMTcwLjEgMTY5IDE1MC4zIDE3OC42IDEzNC41IDE5MkgxNkM3LjEyNSAxOTIgMCAxOTkuMSAwIDIwOHY5NkMwIDMxMi45IDcuMTI1IDMyMCAxNiAzMjBoOTIuNzhDMTI5LjQgMzU3LjggMTczIDM4NCAyMjQgMzg0czk0LjU5LTI2LjI1IDExNS4yLTY0SDM1MmMxNy42MiAwIDMyIDE0LjI5IDMyIDMxLjkxUzM5OC40IDM4NCA0MTYgMzg0aDY0YzE3LjYyIDAgMzItMTQuMzggMzItMzJDNTEyIDI2My42IDQ0MC40IDE5MiAzNTIgMTkyek04MS42MyA5NS44OEwyMjQgODAuODhsMTQyLjQgMTVDMzc1LjkgOTYuODggMzg0IDg5LjEyIDM4NCA3OS4xMlY0OC44OWMwLTEwLTguMTI1LTE3Ljc0LTE3LjYyLTE2Ljc0TDI1NiA0My43NVYxNkMyNTYgNy4xMjUgMjQ4LjkgMCAyNDAgMGgtMzJDMTk5LjEgMCAxOTIgNy4xMjUgMTkyIDE2djI3Ljc1TDgxLjYzIDMyLjE0QzcyLjEzIDMxLjE0IDY0IDM4Ljg5IDY0IDQ4Ljg5Vjc5LjEyQzY0IDg5LjEyIDcyLjEzIDk2Ljg4IDgxLjYzIDk1Ljg4eiIvPjwvc3ZnPg==
[dl-hangar]: https://img.shields.io/badge/Hangar%20(Beta)-444?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNDEgMjI0LjUiPjxkZWZzPjxzdHlsZT4uYXtmaWxsOm5vbmU7fS5iLC5se2ZpbGw6I2ZmZjt9LmIsLmMsLmQsLmUsLmYsLmcsLmgsLmksLmp7ZmlsbC1ydWxlOmV2ZW5vZGQ7fS5je2ZpbGw6I2ZhMDt9LmR7ZmlsbDojYWFhO30uZXtmaWxsOiM1NWY7fS5me2ZpbGw6IzVmNTt9Lmd7ZmlsbDojNjdjYmRmO30uaHtmaWxsOiNmNTU7fS5pe2ZpbGw6I2Y1Zjt9Lmp7ZmlsbDojZmY1O30ua3tmaWxsOiM0NDQ7fTwvc3R5bGU+PC9kZWZzPjxyZWN0IGNsYXNzPSJhIiB4PSIyMS4yIiB5PSIxMy42IiB3aWR0aD0iMjE0LjciIGhlaWdodD0iMTk5Ljk0Ii8+PHBhdGggY2xhc3M9ImIiIGQ9Ik01NTAuOCwzOTkuNSwzOTEuMiw0NzUuMyw0NzIuNSw2MjRsMTU5LjYtNzUuOEw1NTAuOCwzOTkuNVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zOTEuMiAtMzk5LjUpIi8+PHBhdGggY2xhc3M9ImMiIGQ9Ik01NTcsNDAxLjYsMzkzLjQsNDY5LjVsNzIuOCwxNTIuNEw2MjkuOSw1NTRaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzkxLjIgLTM5OS41KSIvPjxwYXRoIGNsYXNzPSJkIiBkPSJNNTYzLjIsNDA0LDM5NS45LDQ2My44bDY0LjIsMTU1LjgsMTY3LjMtNTkuOFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zOTEuMiAtMzk5LjUpIi8+PHBhdGggY2xhc3M9ImUiIGQ9Ik01NjkuMiw0MDYuNiwzOTguOCw0NTguMmw1NS4zLDE1OC43LDE3MC40LTUxLjZMNTY5LjIsNDA2LjZaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzkxLjIgLTM5OS41KSIvPjxwYXRoIGNsYXNzPSJmIiBkPSJNNTc1LDQwOS42LDQwMiw0NTIuOGw0Ni4zLDE2MS4xLDE3My4xLTQzLjFaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzkxLjIgLTM5OS41KSIvPjxwYXRoIGNsYXNzPSJnIiBkPSJNNTgxLjEsNDEyLjVsLTE3NS41LDM1TDQ0My4yLDYxMWwxNzUuNS0zNUw1ODEuMSw0MTIuNVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zOTEuMiAtMzk5LjUpIi8+PHBhdGggY2xhc3M9ImgiIGQ9Ik01ODYuMSw0MTYuMyw0MDkuMiw0NDIuNGwyOCwxNjQuOCwxNzYuOS0yNi4xLTI4LTE2NC44WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM5MS4yIC0zOTkuNSkiLz48cGF0aCBjbGFzcz0iaSIgZD0iTTU5MS40LDQyMC4xLDQxMy4yLDQzNy41bDE4LjcsMTY2TDYxMC4xLDU4Niw1OTEuNCw0MjAuMVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zOTEuMiAtMzk5LjUpIi8+PHBhdGggY2xhc3M9ImoiIGQ9Ik01OTYuNCw0MjQuMWwtMTc4LjksOC43LDkuNCwxNjYuNiwxNzguOS04LjctOS40LTE2Ni42WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM5MS4yIC0zOTkuNSkiLz48cmVjdCBjbGFzcz0iayIgeD0iMzAuOSIgeT0iMjguOCIgd2lkdGg9IjE3OS4yIiBoZWlnaHQ9IjE2Ni44OCIvPjxwYXRoIGNsYXNzPSJsIiBkPSJNNTU0LjcsNTAyLjdjLTkuNy0zLjYtMjQsMTAuMi0zMSwzMS40YTgzLjksODMuOSwwLDAsMC0zLjUsMzUuOWwtNC41LTEuOWMtOC42LTI2LjctMy44LTU1LjksMTEuMS03N1oiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zOTEuMiAtMzk5LjUpIi8+PHBhdGggY2xhc3M9ImwiIGQ9Ik01NjEsNTQ4LjNsLTMzLjItMTMuN2M2LjEtMTguNSwxNy40LTI5LjYsMjQuNy0yOS42YTcuOCw3LjgsMCwwLDEsMi4yLjRsLjYuM2MyLjYsMS4yLDEwLjUsOCw1LjcsNDIuNiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM5MS4yIC0zOTkuNSkiLz48cGF0aCBjbGFzcz0ibCIgZD0iTTU0OS4xLDQ2Ni4yYTczLjQsNzMuNCwwLDAsMC0yNS44LDIzLjRjLTE0LjYsMjEuMi0xOS42LDQ5LjktMTIsNzYuN2E4Mi4yLDgyLjIsMCwwLDAsMy4zLDkuNWwtNDQuNS0xOC40Yy0xNi44LTQxLjItMS40LTkwLjMsMzQuNS0xMDkuN1oiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zOTEuMiAtMzk5LjUpIi8+PC9zdmc+Cg==
+37 -14
View File
@@ -2,7 +2,7 @@
<!--
~ MIT License
~
~ Copyright (c) 2022 Andre_601
~ 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
@@ -34,7 +34,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spigot</artifactId>
<artifactId>bukkit</artifactId>
<packaging>jar</packaging>
<version>${plugin.version}</version>
@@ -44,6 +44,10 @@
</properties>
<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
<repository>
<id>spigot</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
@@ -56,6 +60,10 @@
<id>placeholderapi-repo</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<repository>
<id>viaversion</id>
<url>https://repo.viaversion.com/</url>
</repository>
</repositories>
<dependencies>
@@ -65,6 +73,18 @@
<version>${plugin.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>platform-bukkit</artifactId>
<version>${api.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
@@ -74,30 +94,37 @@
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<version>4.1.2</version>
<version>4.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.8.0</version>
<version>5.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.0</version>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.2</version>
<version>2.11.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.viaversion</groupId>
<artifactId>viaversion-api</artifactId>
<version>4.7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>AdvancedServerList-Spigot-${plugin.version}</finalName>
<finalName>AdvancedServerList-Bukkit-${plugin.version}${project.build.commit}</finalName>
<resources>
<resource>
<filtering>true</filtering>
@@ -108,7 +135,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.11.0</version>
<configuration>
<release>16</release>
</configuration>
@@ -116,7 +143,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
@@ -124,10 +151,6 @@
<pattern>org.bstats</pattern>
<shadedPattern>ch.andre601.advancedserverlist.spigot.depends.bstats</shadedPattern>
</relocation>
<relocation>
<pattern>com.github.benmanes.caffeine</pattern>
<shadedPattern>ch.andre601.advancedserverlist.spigot.depends.caffeine</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
@@ -151,4 +174,4 @@
</plugins>
</build>
</project>
</project>
@@ -0,0 +1,39 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bukkit;
import ch.andre601.advancedserverlist.bukkit.objects.WorldCache;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
import org.bukkit.plugin.java.JavaPlugin;
/*
* Small convenience class to "merge" the PluginCore and JavaPlugin classes.
* Allows me to have BukkitCore<?> for whenever I also need a JavaPlugin (i.e. registering events).
* See JoinEvent class for an example.
*/
public abstract class BukkitCore<F> extends JavaPlugin implements PluginCore<F>{
public abstract WorldCache getWorldCache();
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,29 +23,53 @@
*
*/
package ch.andre601.advancedserverlist.spigot.commands;
package ch.andre601.advancedserverlist.bukkit.commands;
import ch.andre601.advancedserverlist.spigot.SpigotCore;
import ch.andre601.advancedserverlist.core.interfaces.commands.CmdSender;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
import ch.andre601.advancedserverlist.paper.commands.PaperCmdSender;
import ch.andre601.advancedserverlist.spigot.commands.SpigotCmdSender;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
public class CmdAdvancedServerList implements CommandExecutor{
import java.util.Collections;
public class CmdAdvancedServerList extends Command implements CommandExecutor{
SpigotCore plugin;
BukkitAudiences bukkitAudiences;
private final PluginCore<?> plugin;
private final BukkitAudiences audiences;
public CmdAdvancedServerList(SpigotCore plugin){
public CmdAdvancedServerList(PluginCore<?> plugin){
this(plugin, null);
}
public CmdAdvancedServerList(PluginCore<?> plugin, BukkitAudiences audiences){
super(
"advancedserverlist",
"Main command of the plugin",
"/asl [reload|help|clearCache]",
Collections.singletonList("asl")
);
this.plugin = plugin;
bukkitAudiences = BukkitAudiences.create(plugin);
this.audiences = audiences;
}
public boolean execute(@NotNull CommandSender sender, @NotNull String s, @NotNull String[] args){
plugin.getCore().getCommandHandler().handle(getSender(sender), args);
return true;
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, @NotNull String[] args){
plugin.getCore().getCommandHandler().handle(new SpigotCmdSender(sender, bukkitAudiences), args);
plugin.getCore().getCommandHandler().handle(getSender(sender), args);
return true;
}
private CmdSender getSender(CommandSender sender){
return audiences == null ? new PaperCmdSender(sender) : new SpigotCmdSender(sender, audiences);
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,21 +23,28 @@
*
*/
package ch.andre601.advancedserverlist.spigot.events;
package ch.andre601.advancedserverlist.bukkit.listeners;
import ch.andre601.advancedserverlist.spigot.SpigotCore;
import ch.andre601.advancedserverlist.bukkit.BukkitCore;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import java.net.InetSocketAddress;
public class JoinEvent implements Listener{
public class JoinEvent<F> implements Listener{
private final SpigotCore plugin;
private final BukkitCore<F> plugin;
public JoinEvent(SpigotCore plugin){
private JoinEvent(BukkitCore<F> plugin){
this.plugin = plugin;
Bukkit.getPluginManager().registerEvents(this, plugin);
}
public static <F> void init(BukkitCore<F> plugin){
new JoinEvent<>(plugin);
}
@EventHandler
@@ -46,6 +53,7 @@ public class JoinEvent implements Listener{
if(address == null)
return;
plugin.getCore().getPlayerHandler().addPlayer(event.getPlayer().getName(), address.getHostString());
Player player = event.getPlayer();
plugin.getCore().getPlayerHandler().addPlayer(address.getHostString(), player.getName(), player.getUniqueId());
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,36 +23,52 @@
*
*/
package ch.andre601.advancedserverlist.spigot.events;
package ch.andre601.advancedserverlist.bukkit.listeners;
import ch.andre601.advancedserverlist.bukkit.BukkitCore;
import ch.andre601.advancedserverlist.bukkit.objects.placeholders.PAPIPlaceholders;
import ch.andre601.advancedserverlist.spigot.SpigotCore;
import ch.andre601.advancedserverlist.spigot.listeners.ProtocolLibEvents;
import com.comphenix.protocol.ProtocolLibrary;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.server.ServerLoadEvent;
import org.bukkit.plugin.PluginManager;
public class LoadEvent implements Listener{
private final SpigotCore plugin;
private final BukkitCore<?> plugin;
public LoadEvent(SpigotCore plugin){
private LoadEvent(BukkitCore<?> plugin){
this.plugin = plugin;
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
public static void init(BukkitCore<?> plugin){
new LoadEvent(plugin);
}
@EventHandler
public void onServerLoad(ServerLoadEvent event){
PluginManager manager = plugin.getServer().getPluginManager();
JoinEvent.init(plugin);
WorldEvents.init(plugin);
if(!manager.isPluginEnabled("ProtocolLib")){
// Populate WorldCache with all loaded worlds
Bukkit.getWorlds().forEach(world -> plugin.getWorldCache().addWorld(world.getName(), world));
if(!(plugin instanceof SpigotCore spigotCore))
return;
if(!Bukkit.getPluginManager().isPluginEnabled("ProtocolLib")){
plugin.getCore().getPlugin().getPluginLogger().warn("ProtocolLib not found! AdvancedServerList requires it to work on Spigot!");
manager.disablePlugin(plugin);
Bukkit.getPluginManager().disablePlugin(plugin);
return;
}
manager.registerEvents(new JoinEvent(plugin), plugin);
manager.registerEvents(new PingEvent(plugin, ProtocolLibrary.getProtocolManager()), plugin);
ProtocolLibEvents.init(spigotCore, ProtocolLibrary.getProtocolManager());
if(Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI"))
spigotCore.setPapiPlaceholders(PAPIPlaceholders.init(spigotCore));
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,11 +23,14 @@
*
*/
package ch.andre601.advancedserverlist.core.profiles.replacer.placeholders;
package ch.andre601.advancedserverlist.bukkit.listeners;
import java.util.Map;
import ch.andre601.advancedserverlist.api.bukkit.events.PreServerListSetEvent;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
public interface Placeholders{
public class PreServerListSetEventImpl extends PreServerListSetEvent{
Map<String, Object> getReplacements();
public PreServerListSetEventImpl(ProfileEntry entry){
super(entry);
}
}
@@ -0,0 +1,57 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bukkit.listeners;
import ch.andre601.advancedserverlist.bukkit.BukkitCore;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.event.world.WorldUnloadEvent;
public class WorldEvents implements Listener{
private final BukkitCore<?> plugin;
private WorldEvents(BukkitCore<?> plugin){
this.plugin = plugin;
Bukkit.getPluginManager().registerEvents(this, plugin);
}
public static void init(BukkitCore<?> plugin){
new WorldEvents(plugin);
}
@EventHandler
public void onWorldLoad(WorldLoadEvent event){
plugin.getWorldCache().addWorld(event.getWorld().getName(), event.getWorld());
}
@EventHandler
public void onWorldUnload(WorldUnloadEvent event){
plugin.getWorldCache().removeWorld(event.getWorld().getName());
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,18 +23,18 @@
*
*/
package ch.andre601.advancedserverlist.paper.logging;
package ch.andre601.advancedserverlist.bukkit.logging;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import java.util.logging.Level;
import java.util.logging.Logger;
public class PaperLogger implements PluginLogger{
public class BukkitLogger implements PluginLogger{
private final Logger logger;
public PaperLogger(Logger logger){
public BukkitLogger(Logger logger){
this.logger = logger;
}
@@ -52,4 +52,9 @@ public class PaperLogger implements PluginLogger{
public void warn(String msg, Throwable throwable){
logger.log(Level.WARNING, msg, throwable);
}
@Override
public void warn(String msg, Throwable throwable, Object... args){
logger.log(Level.WARNING, String.format(msg, args), throwable);
}
}
@@ -0,0 +1,50 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bukkit.objects;
import org.bukkit.World;
import java.util.HashMap;
import java.util.Map;
public record WorldCache(Map<String, World> worlds){
public WorldCache(){
this(new HashMap<>());
}
public boolean containsWorld(String key){
return worlds().containsKey(key);
}
public void addWorld(String key, World world){
worlds().put(key, world);
}
public void removeWorld(String key){
worlds().remove(key);
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,25 +23,53 @@
*
*/
package ch.andre601.advancedserverlist.spigot;
package ch.andre601.advancedserverlist.bukkit.objects.impl;
import ch.andre601.advancedserverlist.core.profiles.players.GenericPlayer;
import ch.andre601.advancedserverlist.api.bukkit.objects.BukkitPlayer;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import ch.andre601.advancedserverlist.core.profiles.players.GenericPlayerImpl;
import org.bukkit.OfflinePlayer;
public class SpigotPlayer extends GenericPlayer<OfflinePlayer>{
public class BukkitPlayerImpl extends GenericPlayerImpl implements BukkitPlayer{
public SpigotPlayer(OfflinePlayer player, String name, int protocol){
private final OfflinePlayer player;
private boolean playedBefore = false;
private boolean banned = false;
private boolean whitelisted = false;
public BukkitPlayerImpl(OfflinePlayer player, CachedPlayer cachedPlayer, int protocol){
this.player = player;
this.name = player == null ? name : player.getName();
this.name = player == null ? cachedPlayer.getName() : player.getName();
this.protocol = protocol;
this.uuid = player == null ? cachedPlayer.getUuid() : player.getUniqueId();
if(player == null)
return;
this.playedBefore = player.hasPlayedBefore();
this.banned = player.isBanned();
this.whitelisted = player.isWhitelisted();
this.uuid = player.getUniqueId();
}
@Override
public OfflinePlayer getPlayer(){
return player;
}
@Override
public boolean hasPlayedBefore(){
return playedBefore;
}
@Override
public boolean isBanned(){
return banned;
}
@Override
public boolean isWhitelisted(){
return whitelisted;
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,25 +23,32 @@
*
*/
package ch.andre601.advancedserverlist.core.profiles.replacer.placeholders;
package ch.andre601.advancedserverlist.bukkit.objects.impl;
import ch.andre601.advancedserverlist.api.bukkit.objects.BukkitServer;
import org.bukkit.World;
import java.util.HashMap;
import java.util.Map;
public class ServerPlaceholders implements Placeholders{
public record BukkitServerImpl(Map<String, World> worlds, int playersOnline, int playersMax, String host) implements BukkitServer{
private final Map<String, Object> replacements = new HashMap<>();
public ServerPlaceholders(int online, int max, String host){
this.replacements.put("${server playersOnline}", online);
this.replacements.put("${server playersMax}", max);
if(host != null)
this.replacements.put("${server host}", host);
@Override
public Map<String, World> getWorlds(){
return worlds;
}
@Override
public Map<String, Object> getReplacements(){
return this.replacements;
public int getPlayersOnline(){
return playersOnline;
}
@Override
public int getPlayersMax(){
return playersMax;
}
@Override
public String getHost(){
return host;
}
}
@@ -0,0 +1,62 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bukkit.objects.placeholders;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.bukkit.objects.BukkitPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
public class BukkitPlayerPlaceholders extends PlaceholderProvider{
private BukkitPlayerPlaceholders(){
super("player");
}
public static BukkitPlayerPlaceholders init(){
return new BukkitPlayerPlaceholders();
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server){
if(!(player instanceof BukkitPlayer bukkitPlayer))
return null;
return switch(placeholder){
case "name" -> bukkitPlayer.getName();
case "protocol" -> String.valueOf(bukkitPlayer.getProtocol());
case "uuid" -> bukkitPlayer.getUUID().toString();
case "hasPlayedBefore" -> returnValue(bukkitPlayer, bukkitPlayer.hasPlayedBefore());
case "isBanned" -> returnValue(bukkitPlayer, bukkitPlayer.isBanned());
case "isWhitelisted" -> returnValue(bukkitPlayer, bukkitPlayer.isWhitelisted());
default -> null;
};
}
private String returnValue(BukkitPlayer player, Object value){
return player.getPlayer() == null ? null : String.valueOf(value);
}
}
@@ -0,0 +1,78 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bukkit.objects.placeholders;
import ch.andre601.advancedserverlist.api.bukkit.objects.BukkitServer;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import org.bukkit.World;
public class BukkitServerPlaceholders extends PlaceholderProvider{
private BukkitServerPlaceholders(){
super("server");
}
public static BukkitServerPlaceholders init(){
return new BukkitServerPlaceholders();
}
@Override
public String parsePlaceholder(String placeholders, GenericPlayer player, GenericServer server){
if(!(server instanceof BukkitServer bukkitServer))
return null;
String[] args = placeholders.split("\\s", 2);
return switch(args[0]){
case "playersOnline" -> {
if(args.length == 2){
World world = bukkitServer.getWorlds().get(args[1]);
if(world == null)
yield null;
yield String.valueOf(world.getPlayers().size());
}
yield String.valueOf(bukkitServer.getPlayersOnline());
}
case "playersMax" -> {
if(args.length == 2)
yield null;
yield String.valueOf(bukkitServer.getPlayersMax());
}
case "host" -> {
if(args.length == 2)
yield null;
yield bukkitServer.getHost();
}
default -> null;
};
}
}
@@ -0,0 +1,155 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bukkit.objects.placeholders;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.bukkit.BukkitCore;
import ch.andre601.advancedserverlist.bukkit.objects.impl.BukkitPlayerImpl;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import ch.andre601.advancedserverlist.core.objects.GenericServerImpl;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import ch.andre601.advancedserverlist.core.profiles.ServerListProfile;
import ch.andre601.advancedserverlist.core.profiles.profile.ProfileManager;
import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer;
import ch.andre601.advancedserverlist.spigot.SpigotCore;
import ch.andre601.advancedserverlist.spigot.listeners.ProtocolLibEvents;
import com.comphenix.protocol.ProtocolLibrary;
import com.viaversion.viaversion.api.Via;
import me.clip.placeholderapi.PlaceholderAPI;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.net.InetSocketAddress;
import java.util.*;
public class PAPIPlaceholders<F> extends PlaceholderExpansion{
private final BukkitCore<F> plugin;
private PAPIPlaceholders(BukkitCore<F> plugin){
this.plugin = plugin;
this.register();
}
public static <F> PAPIPlaceholders<F> init(BukkitCore<F> plugin){
return new PAPIPlaceholders<>(plugin);
}
@Override
public @NotNull String getIdentifier(){
return "asl";
}
@Override
public @NotNull String getAuthor(){
return "Andre601";
}
@Override
public @NotNull String getVersion(){
return plugin.getCore().getVersion();
}
@Override
public boolean persist(){
return true;
}
@Override
public String onPlaceholderRequest(Player pl, @NotNull String identifier){
InetSocketAddress address = pl.getAddress();
String host = resolveVirtualHost(pl, address);
CachedPlayer cached = plugin.getCore().getPlayerHandler().getCachedPlayer(pl.getUniqueId());
int protocol = resolveProtocol(pl);
int online = Bukkit.getOnlinePlayers().size();
int max = Bukkit.getMaxPlayers();
GenericServer server = new GenericServerImpl(online, max, host);
GenericPlayer player = new BukkitPlayerImpl(pl, cached, protocol);
ServerListProfile profile = ProfileManager.resolveProfile(plugin.getCore(), player, server);
if(profile == null)
return null;
ProfileEntry entry = ProfileManager.merge(profile);
if(ProfileManager.checkOption(entry.extraPlayersEnabled()))
max = online + (entry.extraPlayersCount() == null ? 0 : entry.extraPlayersCount());
GenericServer finalServer = new GenericServerImpl(online, max, host);
return switch(identifier.toLowerCase(Locale.ROOT)){
case "motd" -> getOption(entry.motd(), pl, player, finalServer);
case "favicon" -> getOption(entry.favicon(), pl, player, finalServer);
case "playercount_hover" -> getOption(entry.players(), pl, player, finalServer);
case "playercount_text" -> getOption(entry.playerCountText(), pl, player, finalServer);
case "extra_players_max" -> String.valueOf(max);
default -> null;
};
}
private String getOption(String str, Player pl, GenericPlayer player, GenericServer server){
return getOption(Collections.singletonList(str), pl, player, server);
}
private String getOption(List<String> list, Player pl, GenericPlayer player, GenericServer server){
return ComponentParser.list(list)
.modifyText(text -> PlaceholderAPI.setPlaceholders(pl, text))
.modifyText(text -> StringReplacer.replace(text, player, server))
.toString();
}
private int resolveProtocol(Player player){
if(Bukkit.getPluginManager().isPluginEnabled("ViaVersion"))
return Via.getAPI().getPlayerVersion(player.getUniqueId());
// Since Spigot version requires ProtocolLib can we use it here safely if the plugin instance is SpigotCore.
if(plugin instanceof SpigotCore)
return ProtocolLibrary.getProtocolManager().getProtocolVersion(player);
// getProtocolVersion is only in Paper, so this is only called when main class isn't SpigotCore.
// Also, ViaVersion is not present, so the player protocol *should* be the same as the server.
return Bukkit.getUnsafe().getProtocolVersion();
}
private String resolveVirtualHost(Player player, InetSocketAddress address){
try {
// Server is a Paper Server with Player#getVirtualHost()
Class.forName("com.destroystokyo.paper.network.NetworkClient");
return player.getVirtualHost() == null ? null : player.getVirtualHost().getHostString();
}catch(ClassNotFoundException ignored){}
if(address == null)
return null;
return ProtocolLibEvents.getHostAddresses().get(address.getHostString());
}
}
@@ -0,0 +1,61 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.paper;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import io.papermc.paper.plugin.loader.PluginClasspathBuilder;
import io.papermc.paper.plugin.loader.PluginLoader;
import io.papermc.paper.plugin.loader.library.impl.MavenLibraryResolver;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.repository.RemoteRepository;
import org.jetbrains.annotations.NotNull;
public class ASLLoader implements PluginLoader{
@Override
public void classloader(@NotNull PluginClasspathBuilder pluginClasspathBuilder){
ComponentLogger logger = pluginClasspathBuilder.getContext().getLogger();
logger.info(Component.text("Loading Libraries for plugin..."));
MavenLibraryResolver resolver = new MavenLibraryResolver();
resolver.addRepository(new RemoteRepository.Builder(
"paper-maven",
"default",
"https://repo.papermc.io/repository/maven-public/"
).build());
logger.info(Component.text("Loading com.squareup.okhttp3:okhttp:4.10.0 from repo.papermc.io..."));
resolver.addDependency(new Dependency(new DefaultArtifact("com.squareup.okhttp3:okhttp:4.10.0"), null));
pluginClasspathBuilder.addLibrary(resolver);
logger.info(Component.text("Loading libraries complete!"));
}
}
@@ -0,0 +1,153 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.paper;
import ch.andre601.advancedserverlist.bukkit.BukkitCore;
import ch.andre601.advancedserverlist.bukkit.commands.CmdAdvancedServerList;
import ch.andre601.advancedserverlist.bukkit.listeners.JoinEvent;
import ch.andre601.advancedserverlist.bukkit.listeners.LoadEvent;
import ch.andre601.advancedserverlist.bukkit.listeners.WorldEvents;
import ch.andre601.advancedserverlist.bukkit.logging.BukkitLogger;
import ch.andre601.advancedserverlist.bukkit.objects.placeholders.BukkitPlayerPlaceholders;
import ch.andre601.advancedserverlist.bukkit.objects.placeholders.BukkitServerPlaceholders;
import ch.andre601.advancedserverlist.bukkit.objects.placeholders.PAPIPlaceholders;
import ch.andre601.advancedserverlist.bukkit.objects.WorldCache;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.profiles.favicon.FaviconHandler;
import ch.andre601.advancedserverlist.paper.listeners.PaperPingEvent;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
import org.bukkit.util.CachedServerIcon;
import java.nio.file.Path;
public class PaperCore extends BukkitCore<CachedServerIcon>{
private final PluginLogger logger = new BukkitLogger(getLogger());
private AdvancedServerList<CachedServerIcon> core;
private FaviconHandler<CachedServerIcon> faviconHandler = null;
private PAPIPlaceholders<CachedServerIcon> papiPlaceholders = null;
private WorldCache worldCache = null;
@Override
public void onEnable(){
this.core = AdvancedServerList.init(this, BukkitPlayerPlaceholders.init(), BukkitServerPlaceholders.init());
if(getServer().getPluginManager().isPluginEnabled("PlaceholderAPI"))
papiPlaceholders = PAPIPlaceholders.init(this);
}
@Override
public void onDisable(){
if(papiPlaceholders != null){
papiPlaceholders.unregister();
papiPlaceholders = null;
}
if(worldCache != null)
worldCache = null;
getCore().disable();
}
@Override
public void loadCommands(){
if(getServer().getCommandMap().register("asl", new CmdAdvancedServerList(this))){
getPluginLogger().info("Registered /advancedserverlist:advancedserverlist");
}else{
getPluginLogger().info("Registered /asl:advancedserverlist");
}
}
@Override
public void loadEvents(){
LoadEvent.init(this);
PaperPingEvent.init(this);
}
@Override
public void loadMetrics(){
new Metrics(this, 15584).addCustomChart(new SimplePie("profiles",
() -> String.valueOf(core.getFileHandler().getProfiles().size())
));
}
@Override
public void clearFaviconCache(){
if(faviconHandler == null)
return;
faviconHandler.clearCache();
}
@Override
public AdvancedServerList<CachedServerIcon> getCore(){
return core;
}
@Override
public Path getFolderPath(){
return getDataFolder().toPath();
}
@Override
public PluginLogger getPluginLogger(){
return logger;
}
@Override
public FaviconHandler<CachedServerIcon> getFaviconHandler(){
if(faviconHandler == null)
faviconHandler = new FaviconHandler<>(core);
return faviconHandler;
}
@Override
public String getPlatformName(){
return getServer().getName();
}
@Override
public String getPlatformVersion(){
return getServer().getVersion();
}
@Override
public String getLoader(){
return "paper";
}
@Override
public WorldCache getWorldCache(){
if(worldCache != null)
return worldCache;
return (worldCache = new WorldCache());
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -25,7 +25,7 @@
package ch.andre601.advancedserverlist.paper.commands;
import ch.andre601.advancedserverlist.core.interfaces.CmdSender;
import ch.andre601.advancedserverlist.core.interfaces.commands.CmdSender;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import org.bukkit.command.CommandSender;
@@ -0,0 +1,186 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.paper.listeners;
import ch.andre601.advancedserverlist.api.events.GenericServerListEvent;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.bukkit.BukkitCore;
import ch.andre601.advancedserverlist.bukkit.listeners.PreServerListSetEventImpl;
import ch.andre601.advancedserverlist.bukkit.objects.impl.BukkitServerImpl;
import ch.andre601.advancedserverlist.bukkit.objects.impl.BukkitPlayerImpl;
import ch.andre601.advancedserverlist.core.interfaces.events.GenericEventWrapper;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer;
import ch.andre601.advancedserverlist.paper.PaperCore;
import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
import com.destroystokyo.paper.profile.PlayerProfile;
import me.clip.placeholderapi.PlaceholderAPI;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.util.CachedServerIcon;
import java.awt.image.BufferedImage;
import java.util.*;
public class PaperEventWrapper implements GenericEventWrapper<CachedServerIcon, BukkitPlayerImpl>{
private final PaperCore plugin;
private final PaperServerListPingEvent event;
public PaperEventWrapper(PaperCore plugin, PaperServerListPingEvent event){
this.plugin = plugin;
this.event = event;
}
@Override
public GenericServerListEvent callEvent(ProfileEntry entry){
PreServerListSetEventImpl event = new PreServerListSetEventImpl(entry);
plugin.getServer().getPluginManager().callEvent(event);
return event;
}
@Override
public void setMaxPlayers(int maxPlayers){
event.setMaxPlayers(maxPlayers);
}
@Override
public void setMotd(Component component){
event.motd(component);
}
@Override
public void hidePlayers(){
event.setHidePlayers(true);
}
@Override
public void setPlayerCount(String name){
event.setVersion(name);
event.setProtocolVersion(-1);
}
@Override
public void setPlayers(List<String> lines, BukkitPlayerImpl player, GenericServer server){
event.getPlayerSample().clear();
List<PlayerProfile> players = new ArrayList<>(lines.size());
for(String line : lines){
String parsed = ComponentParser.text(line)
.modifyText(text -> StringReplacer.replace(text, player, server))
.modifyText(text -> {
if(plugin.getServer().getPluginManager().isPluginEnabled("PlaceholderAPI"))
return PlaceholderAPI.setPlaceholders(player.getPlayer(), text);
return text;
})
.toString();
players.add(Bukkit.createProfile(UUID.randomUUID(), parsed));
}
event.getPlayerSample().addAll(players);
}
@Override
public void setFavicon(CachedServerIcon favicon){
event.setServerIcon(favicon);
}
@Override
public void setDefaultFavicon(){
event.setServerIcon(event.getServerIcon());
}
// Not used in Paper
@Override
public void updateEvent(){}
// Not used in Paper
@Override
public boolean isInvalidProtocol(){
return false;
}
@Override
public int getProtocolVersion(){
return event.getClient().getProtocolVersion();
}
@Override
public int getOnlinePlayers(){
return event.getNumPlayers();
}
@Override
public int getMaxPlayers(){
return event.getMaxPlayers();
}
@Override
public String getPlayerIP(){
return event.getClient().getAddress().getHostString();
}
@Override
public String parsePAPIPlaceholders(String text, BukkitPlayerImpl player){
if(plugin.getServer().getPluginManager().isPluginEnabled("PlaceholderAPI"))
return PlaceholderAPI.setPlaceholders(player.getPlayer(), text);
return text;
}
@Override
public String getVirtualHost(){
return this.resolveHost(event.getClient().getVirtualHost());
}
@Override
public BukkitCore<CachedServerIcon> getPlugin(){
return plugin;
}
@Override
public BukkitPlayerImpl createPlayer(CachedPlayer player, int protocol){
OfflinePlayer pl = Bukkit.getOfflinePlayer(player.getUuid());
return new BukkitPlayerImpl(pl.hasPlayedBefore() ? pl : null, player, protocol);
}
@Override
public GenericServer createGenericServer(int playersOnline, int playersMax, String host){
return new BukkitServerImpl(plugin.getWorldCache().worlds(), playersOnline, playersMax, host);
}
@Override
public CachedServerIcon createFavicon(BufferedImage image) throws Exception{
return Bukkit.loadServerIcon(image);
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,30 +23,29 @@
*
*/
package ch.andre601.advancedserverlist.paper.events;
package ch.andre601.advancedserverlist.paper.listeners;
import ch.andre601.advancedserverlist.core.events.PingEventHandler;
import ch.andre601.advancedserverlist.paper.PaperCore;
import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import java.net.InetSocketAddress;
public class JoinEvent implements Listener{
public class PaperPingEvent implements Listener{
private final PaperCore plugin;
public JoinEvent(PaperCore plugin){
private PaperPingEvent(PaperCore plugin){
this.plugin = plugin;
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
public static void init(PaperCore plugin){
new PaperPingEvent(plugin);
}
@EventHandler
public void onJoin(PlayerJoinEvent event){
InetSocketAddress address = event.getPlayer().getAddress();
if(address == null)
return;
plugin.getCore().getPlayerHandler().addPlayer(event.getPlayer().getName(), address.getHostString());
public void onPaperServerListPing(PaperServerListPingEvent event){
PingEventHandler.handleEvent(new PaperEventWrapper(plugin, event));
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -25,35 +25,33 @@
package ch.andre601.advancedserverlist.spigot;
import ch.andre601.advancedserverlist.bukkit.BukkitCore;
import ch.andre601.advancedserverlist.bukkit.commands.CmdAdvancedServerList;
import ch.andre601.advancedserverlist.bukkit.logging.BukkitLogger;
import ch.andre601.advancedserverlist.bukkit.objects.placeholders.BukkitPlayerPlaceholders;
import ch.andre601.advancedserverlist.bukkit.objects.placeholders.BukkitServerPlaceholders;
import ch.andre601.advancedserverlist.bukkit.objects.placeholders.PAPIPlaceholders;
import ch.andre601.advancedserverlist.bukkit.objects.WorldCache;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.interfaces.core.ServerCore;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import ch.andre601.advancedserverlist.core.profiles.favicon.FaviconHandler;
import ch.andre601.advancedserverlist.core.profiles.replacer.placeholders.Placeholders;
import ch.andre601.advancedserverlist.spigot.commands.CmdAdvancedServerList;
import ch.andre601.advancedserverlist.spigot.events.LoadEvent;
import ch.andre601.advancedserverlist.spigot.logging.SpigotLogger;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import ch.andre601.advancedserverlist.bukkit.listeners.LoadEvent;
import com.comphenix.protocol.wrappers.WrappedServerPing;
import me.clip.placeholderapi.PlaceholderAPI;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class SpigotCore extends JavaPlugin implements ServerCore<WrappedServerPing.CompressedImage, WrappedGameProfile, OfflinePlayer>{
public class SpigotCore extends BukkitCore<WrappedServerPing.CompressedImage>{
private final PluginLogger logger = new SpigotLogger(getLogger());
private final PluginLogger logger = new BukkitLogger(getLogger());
private AdvancedServerList core;
FaviconHandler<WrappedServerPing.CompressedImage> faviconHandler = null;
private AdvancedServerList<WrappedServerPing.CompressedImage> core;
private FaviconHandler<WrappedServerPing.CompressedImage> faviconHandler = null;
private PAPIPlaceholders<WrappedServerPing.CompressedImage> papiPlaceholders = null;
private WorldCache worldCache = null;
@Override
public void onEnable(){
@@ -70,11 +68,19 @@ public class SpigotCore extends JavaPlugin implements ServerCore<WrappedServerPi
}catch(ClassNotFoundException ignored){}
}
this.core = new AdvancedServerList(this);
this.core = AdvancedServerList.init(this, BukkitPlayerPlaceholders.init(), BukkitServerPlaceholders.init());
}
@Override
public void onDisable(){
if(papiPlaceholders != null){
papiPlaceholders.unregister();
papiPlaceholders = null;
}
if(worldCache != null)
worldCache = null;
getCore().disable();
}
@@ -82,15 +88,15 @@ public class SpigotCore extends JavaPlugin implements ServerCore<WrappedServerPi
public void loadCommands(){
PluginCommand cmd = getServer().getPluginCommand("advancedserverlist");
if(cmd == null){
getPluginLogger().warn("Could not register command /advancedserverlist");
getPluginLogger().warn("Unable to register command /advancedserverlist");
return;
}
cmd.setExecutor(new CmdAdvancedServerList(this));
cmd.setExecutor(new CmdAdvancedServerList(this, BukkitAudiences.create(this)));
}
@Override
public void loadEvents(){
new LoadEvent(this);
LoadEvent.init(this);
}
@Override
@@ -102,11 +108,14 @@ public class SpigotCore extends JavaPlugin implements ServerCore<WrappedServerPi
@Override
public void clearFaviconCache(){
if(faviconHandler == null)
return;
faviconHandler.clearCache();
}
@Override
public AdvancedServerList getCore(){
public AdvancedServerList<WrappedServerPing.CompressedImage> getCore(){
return core;
}
@@ -139,25 +148,20 @@ public class SpigotCore extends JavaPlugin implements ServerCore<WrappedServerPi
}
@Override
public List<WrappedGameProfile> createPlayers(List<String> lines, OfflinePlayer player, Placeholders... placeholders){
List<WrappedGameProfile> players = new ArrayList<>(lines.size());
public String getLoader(){
return "spigot";
}
@Override
public WorldCache getWorldCache(){
if(worldCache != null)
return worldCache;
for(String line : lines){
String parsed = ComponentParser.text(line)
.replacements(placeholders[0])
.replacements(placeholders[1])
.modifyText(text -> {
if(getServer().getPluginManager().isPluginEnabled("PlaceholderAPI"))
return PlaceholderAPI.setPlaceholders(player, text);
return text;
})
.toString();
players.add(new WrappedGameProfile(UUID.randomUUID(), parsed));
}
return players;
return (worldCache = new WorldCache());
}
public void setPapiPlaceholders(PAPIPlaceholders<WrappedServerPing.CompressedImage> papiPlaceholders){
this.papiPlaceholders = papiPlaceholders;
}
private void printPaperInfo(){
@@ -165,7 +169,7 @@ public class SpigotCore extends JavaPlugin implements ServerCore<WrappedServerPi
getPluginLogger().warn("You are using the Spigot version of AdvancedServerList on a Paper server.");
getPluginLogger().warn("It is recommended to use the dedicated Paper version, to benefit from the");
getPluginLogger().warn("following improvements:");
getPluginLogger().warn(" - No need to download external libraries already provided by PaperMC.");
getPluginLogger().warn(" - No downloading of external Libraries already provided by Paper (i.e. Adventure).");
getPluginLogger().warn(" - No dependency on ProtocolLib thanks to provided Events.");
getPluginLogger().warn("");
getPluginLogger().warn("AdvancedServerList may work as normal, but consider using the PaperMC version instead!");
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -25,7 +25,7 @@
package ch.andre601.advancedserverlist.spigot.commands;
import ch.andre601.advancedserverlist.core.interfaces.CmdSender;
import ch.andre601.advancedserverlist.core.interfaces.commands.CmdSender;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import org.bukkit.command.CommandSender;
@@ -0,0 +1,194 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.spigot.listeners;
import ch.andre601.advancedserverlist.api.events.GenericServerListEvent;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.bukkit.BukkitCore;
import ch.andre601.advancedserverlist.bukkit.listeners.PreServerListSetEventImpl;
import ch.andre601.advancedserverlist.bukkit.objects.impl.BukkitServerImpl;
import ch.andre601.advancedserverlist.core.interfaces.events.GenericEventWrapper;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer;
import ch.andre601.advancedserverlist.spigot.SpigotCore;
import ch.andre601.advancedserverlist.bukkit.objects.impl.BukkitPlayerImpl;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.wrappers.WrappedChatComponent;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import com.comphenix.protocol.wrappers.WrappedServerPing;
import me.clip.placeholderapi.PlaceholderAPI;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import java.awt.image.BufferedImage;
import java.util.*;
public class ProtocolLibEventWrapper implements GenericEventWrapper<WrappedServerPing.CompressedImage, BukkitPlayerImpl>{
private final SpigotCore plugin;
private final PacketEvent event;
private final WrappedServerPing ping;
public ProtocolLibEventWrapper(SpigotCore plugin, PacketEvent event){
this.plugin = plugin;
this.event = event;
this.ping = event.getPacket().getServerPings().read(0);
}
@Override
public GenericServerListEvent callEvent(ProfileEntry entry){
PreServerListSetEventImpl event = new PreServerListSetEventImpl(entry);
plugin.getServer().getPluginManager().callEvent(event);
return event;
}
@Override
public void setMaxPlayers(int maxPlayers){
ping.setPlayersMaximum(maxPlayers);
}
@Override
public void setMotd(Component component){
ping.setMotD(WrappedChatComponent.fromJson(GsonComponentSerializer.gson().serialize(component)));
}
@Override
public void hidePlayers(){
ping.setPlayersVisible(false);
}
@Override
public void setPlayerCount(String name){
ping.setVersionName(name);
ping.setVersionProtocol(-1);
}
@Override
public void setPlayers(List<String> lines, BukkitPlayerImpl player, GenericServer server){
List<WrappedGameProfile> players = new ArrayList<>(lines.size());
for(String line : lines){
String parsed = ComponentParser.text(line)
.modifyText(text -> StringReplacer.replace(text, player, server))
.modifyText(text -> {
if(plugin.getServer().getPluginManager().isPluginEnabled("PlaceholderAPI"))
return PlaceholderAPI.setPlaceholders(player.getPlayer(), text);
return text;
})
.toString();
players.add(new WrappedGameProfile(UUID.randomUUID(), parsed));
}
ping.setPlayers(players);
}
@Override
public void setFavicon(WrappedServerPing.CompressedImage favicon){
ping.setFavicon(favicon);
}
@Override
public void setDefaultFavicon(){
ping.setFavicon(ping.getFavicon());
}
// Not used in ProtocolLib
@Override
public void updateEvent(){
event.getPacket().getServerPings().write(0, ping);
}
@Override
public boolean isInvalidProtocol(){
return event.getPlayer().getAddress() == null;
}
@Override
public int getProtocolVersion(){
return ping.getVersionProtocol();
}
@Override
public int getOnlinePlayers(){
return ping.getPlayersOnline();
}
@Override
public int getMaxPlayers(){
return ping.getPlayersMaximum();
}
@Override
public String getPlayerIP(){
return event.getPlayer().getAddress() == null ? "UNKNOWN" : event.getPlayer().getAddress().getHostString();
}
@Override
public String parsePAPIPlaceholders(String text, BukkitPlayerImpl player){
if(plugin.getServer().getPluginManager().isPluginEnabled("PlaceholderAPI"))
return PlaceholderAPI.setPlaceholders(player.getPlayer(), text);
return text;
}
@Override
public String getVirtualHost(){
String host = this.resolveHost(event.getPlayer().getAddress());
if(host == null)
return null;
return ProtocolLibEvents.getHostAddresses().get(host);
}
@Override
public BukkitCore<WrappedServerPing.CompressedImage> getPlugin(){
return plugin;
}
@Override
public BukkitPlayerImpl createPlayer(CachedPlayer player, int protocol){
OfflinePlayer pl = Bukkit.getOfflinePlayer(player.getUuid());
return new BukkitPlayerImpl(pl.hasPlayedBefore() ? pl : null, player, protocol);
}
@Override
public GenericServer createGenericServer(int playersOnline, int playersMax, String host){
return new BukkitServerImpl(plugin.getWorldCache().worlds(), playersOnline, playersMax, host);
}
@Override
public WrappedServerPing.CompressedImage createFavicon(BufferedImage image) throws Exception{
return WrappedServerPing.CompressedImage.fromPng(image);
}
}
@@ -0,0 +1,84 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.spigot.listeners;
import ch.andre601.advancedserverlist.core.events.PingEventHandler;
import ch.andre601.advancedserverlist.spigot.SpigotCore;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolManager;
import com.comphenix.protocol.events.ListenerPriority;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketEvent;
import org.bukkit.Bukkit;
import org.bukkit.event.Listener;
import java.net.InetSocketAddress;
import java.util.Map;
import java.util.TreeMap;
public class ProtocolLibEvents implements Listener{
private final ProtocolManager protocolManager;
private static final Map<String, String> hostAddresses = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
private ProtocolLibEvents(SpigotCore plugin, ProtocolManager protocolManager){
this.protocolManager = protocolManager;
loadPacketListener(plugin);
Bukkit.getPluginManager().registerEvents(this, plugin);
}
public static void init(SpigotCore plugin, ProtocolManager protocolManager){
new ProtocolLibEvents(plugin, protocolManager);
}
public static Map<String, String> getHostAddresses(){
return hostAddresses;
}
private void loadPacketListener(SpigotCore spigotPlugin){
protocolManager.addPacketListener(new PacketAdapter(spigotPlugin, ListenerPriority.LOW, PacketType.Handshake.Client.SET_PROTOCOL){
@Override
public void onPacketReceiving(PacketEvent event){
InetSocketAddress address = event.getPlayer().getAddress();
if(address == null)
return;
String host = event.getPacket().getStrings().read(0);
hostAddresses.put(address.getHostString(), host);
}
});
protocolManager.addPacketListener(new PacketAdapter(spigotPlugin, ListenerPriority.LOW, PacketType.Status.Server.SERVER_INFO){
@Override
public void onPacketSending(PacketEvent event){
PingEventHandler.handleEvent(new ProtocolLibEventWrapper(spigotPlugin, event));
}
});
}
}
@@ -4,13 +4,21 @@ version: '${plugin.version}'
description: '${plugin.description}'
main: 'ch.andre601.advancedserverlist.paper.PaperCore'
loader: 'ch.andre601.advancedserverlist.paper.ASLLoader'
api-version: 1.19
softdepend:
- 'PlaceholderAPI'
dependencies:
server:
PlaceholderAPI:
load: BEFORE
required: false
ViaVersion:
load: BEFORE
required: false
commands:
# The below stuff is NOT used by Paper plugin.
commands:
advancedserverlist:
description: 'Main command of AdvancedServerList'
usage: '/<command> [help|reload]'
@@ -18,11 +26,12 @@ commands:
- 'asl'
permission: 'advancedserverlist.admin'
permissions:
# This is actually supported(?)
permissions:
advancedserverlist.*:
description: 'Grants access to all permissions'
default: op
children:
children:
- 'advancedserverlist.admin'
advancedserverlist.admin:
description: 'Grants access to all permissions'
@@ -7,12 +7,15 @@ main: 'ch.andre601.advancedserverlist.spigot.SpigotCore'
api-version: 1.19
folia-supported: true
libraries:
- 'org.spongepowered:configurate-yaml:4.1.2'
- 'net.kyori:adventure-api:4.11.0'
- 'net.kyori:adventure-text-minimessage:4.11.0'
- 'net.kyori:adventure-text-serializer-legacy:4.11.0'
- 'net.kyori:adventure-platform-bukkit:4.1.2'
- 'net.kyori:adventure-api:4.12.0'
- 'net.kyori:adventure-text-minimessage:4.12.0'
- 'net.kyori:adventure-text-serializer-legacy:4.12.0'
- 'net.kyori:adventure-platform-bukkit:4.2.0'
- 'com.squareup.okhttp3:okhttp:4.10.0'
softdepend:
- 'ProtocolLib'
@@ -21,7 +24,7 @@ softdepend:
commands:
advancedserverlist:
description: 'Main command of AdvancedServerList'
usage: '/<command> [help|reload]'
usage: '/<command> [help|reload|clearCache]'
aliases:
- 'asl'
permission: 'advancedserverlist.admin'
@@ -48,4 +51,7 @@ permissions:
default: op
advancedserverlist.command.reload:
description: 'Grants access to /asl reload'
default: op
advancedserverlist.command.clearcache:
description: 'Clears the Player and Favicon cache'
default: op
+36 -6
View File
@@ -2,7 +2,7 @@
<!--
~ MIT License
~
~ Copyright (c) 2022 Andre_601
~ 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
@@ -58,6 +58,12 @@
<version>${plugin.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>platform-bungeecord</artifactId>
<version>${api.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
@@ -72,6 +78,18 @@
<type>javadoc</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.13.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.13.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bungeecord</artifactId>
@@ -84,10 +102,22 @@
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>configurate-yaml</artifactId>
<version>4.1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.10.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>AdvancedServerList-BungeeCord-${plugin.version}</finalName>
<finalName>AdvancedServerList-BungeeCord-${plugin.version}${project.build.commit}</finalName>
<resources>
<resource>
<filtering>true</filtering>
@@ -98,12 +128,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.11.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
@@ -120,8 +150,8 @@
<shadedPattern>ch.andre601.advancedserverlist.bungeecord.depends.bstats</shadedPattern>
</relocation>
<relocation>
<pattern>com.github.benmanes.caffeine</pattern>
<shadedPattern>ch.andre601.advancedserverlist.bungeecord.depends.caffeine</shadedPattern>
<pattern>okhttp3</pattern>
<shadedPattern>ch.andre601.advancedserverlist.bungeecord.depends.okhttp3</shadedPattern>
</relocation>
</relocations>
<filters>
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -26,35 +26,31 @@
package ch.andre601.advancedserverlist.bungeecord;
import ch.andre601.advancedserverlist.bungeecord.commands.CmdAdvancedServerList;
import ch.andre601.advancedserverlist.bungeecord.events.JoinEvent;
import ch.andre601.advancedserverlist.bungeecord.events.PingEvent;
import ch.andre601.advancedserverlist.bungeecord.listeners.JoinEvent;
import ch.andre601.advancedserverlist.bungeecord.listeners.PingEvent;
import ch.andre601.advancedserverlist.bungeecord.logging.BungeeLogger;
import ch.andre601.advancedserverlist.bungeecord.objects.BungeePlayerPlaceholders;
import ch.andre601.advancedserverlist.bungeecord.objects.BungeeServerPlaceholders;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.interfaces.core.ProxyCore;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
import ch.andre601.advancedserverlist.core.profiles.favicon.FaviconHandler;
import ch.andre601.advancedserverlist.core.profiles.replacer.placeholders.Placeholders;
import net.md_5.bungee.api.Favicon;
import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.api.plugin.Plugin;
import org.bstats.bungeecord.Metrics;
import org.bstats.charts.SimplePie;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class BungeeCordCore extends Plugin implements ProxyCore<Favicon, ServerPing.PlayerInfo>{
public class BungeeCordCore extends Plugin implements PluginCore<Favicon>{
private AdvancedServerList core;
private AdvancedServerList<Favicon> core;
private FaviconHandler<Favicon> faviconHandler = null;
private final PluginLogger logger = new BungeeLogger(getLogger());
@Override
public void onEnable(){
this.core = new AdvancedServerList(this);
this.core = AdvancedServerList.init(this, BungeePlayerPlaceholders.init(), BungeeServerPlaceholders.init());
}
@Override
@@ -83,11 +79,14 @@ public class BungeeCordCore extends Plugin implements ProxyCore<Favicon, ServerP
@Override
public void clearFaviconCache(){
if(faviconHandler == null)
return;
faviconHandler.clearCache();
}
@Override
public AdvancedServerList getCore(){
public AdvancedServerList<Favicon> getCore(){
return core;
}
@@ -120,18 +119,7 @@ public class BungeeCordCore extends Plugin implements ProxyCore<Favicon, ServerP
}
@Override
public List<ServerPing.PlayerInfo> createPlayers(List<String> lines, Placeholders... placeholders){
List<ServerPing.PlayerInfo> players = new ArrayList<>(lines.size());
for(String line : lines){
String parsed = ComponentParser.text(line)
.replacements(placeholders[0])
.replacements(placeholders[1])
.toString();
players.add(new ServerPing.PlayerInfo(parsed, UUID.randomUUID()));
}
return players;
public String getLoader(){
return "bungeecord";
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -25,7 +25,7 @@
package ch.andre601.advancedserverlist.bungeecord.commands;
import ch.andre601.advancedserverlist.core.interfaces.CmdSender;
import ch.andre601.advancedserverlist.core.interfaces.commands.CmdSender;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
import net.md_5.bungee.api.CommandSender;
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -1,145 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bungeecord.events;
import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore;
import ch.andre601.advancedserverlist.bungeecord.BungeePlayer;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import ch.andre601.advancedserverlist.core.profiles.ProfileManager;
import ch.andre601.advancedserverlist.core.profiles.ServerListProfile;
import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer;
import ch.andre601.advancedserverlist.core.profiles.replacer.placeholders.PlayerPlaceholders;
import ch.andre601.advancedserverlist.core.profiles.replacer.placeholders.ServerPlaceholders;
import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer;
import net.md_5.bungee.api.Favicon;
import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.event.ProxyPingEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.event.EventPriority;
import java.net.InetSocketAddress;
public class PingEvent implements Listener{
private final BungeeCordCore plugin;
public PingEvent(BungeeCordCore plugin){
this.plugin = plugin;
plugin.getProxy().getPluginManager().registerListener(plugin, this);
}
@EventHandler(priority = EventPriority.LOW)
public void onProxyPing(ProxyPingEvent event){
ServerPing ping = event.getResponse();
ServerPing.Protocol protocol = ping.getVersion();
if(protocol == null)
return;
String playerName = plugin.getCore().getPlayerHandler().getPlayerByIp(
((InetSocketAddress)event.getConnection().getSocketAddress()).getHostString()
);
InetSocketAddress host = event.getConnection().getVirtualHost();
int online = ping.getPlayers().getOnline();
int max = ping.getPlayers().getMax();
PlayerPlaceholders playerPlaceholders = new PlayerPlaceholders(new BungeePlayer(playerName, protocol.getProtocol()));
ServerPlaceholders serverPlaceholders = new ServerPlaceholders(online, max, host == null ? null : host.getHostString());
ServerListProfile profile = ProfileManager.get(plugin.getCore())
.replacements(playerPlaceholders)
.replacements(serverPlaceholders)
.getProfile();
if(profile == null)
return;
if(profile.isExtraPlayersEnabled()){
max = online + profile.getExtraPlayers();
ping.getPlayers().setMax(max);
}
serverPlaceholders = new ServerPlaceholders(online, max, host == null ? null : host.getHostString());
if(!profile.getMotd().isEmpty()){
TextComponent component = new TextComponent(BungeeComponentSerializer.get().serialize(
ComponentParser.list(profile.getMotd())
.replacements(playerPlaceholders)
.replacements(serverPlaceholders)
.toComponent()
));
ping.setDescriptionComponent(component);
}
if(profile.shouldHidePlayers()){
ping.setPlayers(null);
}
if(!profile.getPlayerCount().isEmpty() && !profile.shouldHidePlayers()){
protocol.setName(ComponentParser.text(profile.getPlayerCount())
.replacements(playerPlaceholders)
.replacements(serverPlaceholders)
.toString()
);
protocol.setProtocol(-1);
}
if(!profile.getPlayers().isEmpty() && !profile.shouldHidePlayers()){
ServerPing.PlayerInfo[] playerInfos = plugin.createPlayers(profile.getPlayers(), playerPlaceholders, serverPlaceholders)
.toArray(new ServerPing.PlayerInfo[0]);
if(playerInfos.length > 0)
ping.getPlayers().setSample(playerInfos);
}
if(!profile.getFavicon().isEmpty()){
String favName = StringReplacer.replace(profile.getFavicon(), playerPlaceholders.getReplacements());
Favicon favicon = plugin.getFaviconHandler().getFavicon(favName, image -> {
try{
return Favicon.create(image);
}catch(Exception ex){
plugin.getPluginLogger().warn("Unable to create Favicon. %s", ex.getMessage());
return null;
}
});
if(favicon == null){
plugin.getPluginLogger().warn("Could not obtain valid Favicon to use.");
ping.setFavicon(ping.getFaviconObject());
}else{
ping.setFavicon(favicon);
}
}
ping.setVersion(protocol);
event.setResponse(ping);
}
}
@@ -0,0 +1,185 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bungeecord.listeners;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore;
import ch.andre601.advancedserverlist.bungeecord.objects.BungeePlayerImpl;
import ch.andre601.advancedserverlist.api.events.GenericServerListEvent;
import ch.andre601.advancedserverlist.bungeecord.objects.BungeeProxyImpl;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
import ch.andre601.advancedserverlist.core.interfaces.events.GenericEventWrapper;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer;
import net.md_5.bungee.api.Favicon;
import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.event.ProxyPingEvent;
import java.awt.image.BufferedImage;
import java.net.InetSocketAddress;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class BungeeEventWrapper implements GenericEventWrapper<Favicon, BungeePlayerImpl>{
private final BungeeCordCore plugin;
private final ProxyPingEvent event;
private final ServerPing.Protocol protocol;
private final ServerPing ping;
public BungeeEventWrapper(BungeeCordCore plugin, ProxyPingEvent event){
this.plugin = plugin;
this.event = event;
this.protocol = event.getResponse().getVersion();
this.ping = event.getResponse();
}
@Override
public GenericServerListEvent callEvent(ProfileEntry entry){
PreServerListSetEventImpl event = new PreServerListSetEventImpl(entry);
plugin.getProxy().getPluginManager().callEvent(event);
return event;
}
@Override
public void setMaxPlayers(int maxPlayers){
ping.getPlayers().setMax(maxPlayers);
}
@Override
public void setMotd(Component component){
ping.setDescriptionComponent(new TextComponent(BungeeComponentSerializer.get().serialize(component)));
}
@Override
public void hidePlayers(){
ping.setPlayers(null);
}
@Override
public void setPlayerCount(String name){
protocol.setName(name);
protocol.setProtocol(-1);
}
@Override
public void setPlayers(List<String> lines, BungeePlayerImpl player, GenericServer server){
ServerPing.PlayerInfo[] players = new ServerPing.PlayerInfo[lines.size()];
for(int i = 0; i < players.length; i++){
String parsed = ComponentParser.text(lines.get(i))
.modifyText(text -> StringReplacer.replace(text, player, server))
.toString();
ServerPing.PlayerInfo pi = new ServerPing.PlayerInfo(parsed, UUID.randomUUID());
players[i] = pi;
}
if(players.length > 0)
ping.getPlayers().setSample(players);
}
@Override
public void setFavicon(Favicon favicon){
ping.setFavicon(favicon);
}
@Override
public void setDefaultFavicon(){
ping.setFavicon(ping.getFaviconObject());
}
@Override
public void updateEvent(){
this.ping.setVersion(this.protocol);
this.event.setResponse(this.ping);
}
@Override
public boolean isInvalidProtocol(){
return protocol == null;
}
@Override
public int getProtocolVersion(){
return this.protocol.getProtocol();
}
@Override
public int getOnlinePlayers(){
return ping.getPlayers().getOnline();
}
@Override
public int getMaxPlayers(){
return ping.getPlayers().getMax();
}
@Override
public String getPlayerIP(){
return ((InetSocketAddress)event.getConnection().getSocketAddress()).getHostString();
}
@Override
public String parsePAPIPlaceholders(String text, BungeePlayerImpl player){
return text;
}
@Override
public String getVirtualHost(){
return this.resolveHost(event.getConnection().getVirtualHost());
}
@Override
public PluginCore<Favicon> getPlugin(){
return plugin;
}
@Override
public BungeePlayerImpl createPlayer(CachedPlayer player, int protocol){
return new BungeePlayerImpl(player, protocol);
}
@Override
public GenericServer createGenericServer(int playersOnline, int playersMax, String host){
Map<String, ServerInfo> servers = plugin.getProxy().getServers();
return new BungeeProxyImpl(servers, playersOnline, playersMax, host);
}
@Override
public Favicon createFavicon(BufferedImage image) throws IllegalArgumentException{
return Favicon.create(image);
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,9 +23,10 @@
*
*/
package ch.andre601.advancedserverlist.bungeecord.events;
package ch.andre601.advancedserverlist.bungeecord.listeners;
import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;
@@ -44,6 +45,8 @@ public class JoinEvent implements Listener{
@EventHandler
public void onJoin(PostLoginEvent event){
InetSocketAddress address = (InetSocketAddress)event.getPlayer().getPendingConnection().getSocketAddress();
plugin.getCore().getPlayerHandler().addPlayer(event.getPlayer().getName(), address.getHostString());
ProxiedPlayer player = event.getPlayer();
plugin.getCore().getPlayerHandler().addPlayer(address.getHostString(), player.getName(), player.getUniqueId());
}
}
@@ -0,0 +1,48 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bungeecord.listeners;
import ch.andre601.advancedserverlist.bungeecord.BungeeCordCore;
import ch.andre601.advancedserverlist.core.events.PingEventHandler;
import net.md_5.bungee.api.event.ProxyPingEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.event.EventPriority;
public class PingEvent implements Listener{
private final BungeeCordCore plugin;
public PingEvent(BungeeCordCore plugin){
this.plugin = plugin;
plugin.getProxy().getPluginManager().registerListener(plugin, this);
}
@EventHandler(priority = EventPriority.LOW)
public void onProxyPing(ProxyPingEvent event){
PingEventHandler.handleEvent(new BungeeEventWrapper(plugin, event));
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,12 +23,14 @@
*
*/
package ch.andre601.advancedserverlist.core.interfaces.core;
package ch.andre601.advancedserverlist.bungeecord.listeners;
import ch.andre601.advancedserverlist.core.profiles.replacer.placeholders.Placeholders;
import ch.andre601.advancedserverlist.api.bungeecord.events.PreServerListSetEvent;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import java.util.List;
public interface ProxyCore<F, P> extends PluginCore<F>{
List<P> createPlayers(List<String> lines, Placeholders... placeholders);
public class PreServerListSetEventImpl extends PreServerListSetEvent{
public PreServerListSetEventImpl(ProfileEntry entry){
super(entry);
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -52,4 +52,9 @@ public class BungeeLogger implements PluginLogger{
public void warn(String msg, Throwable throwable){
logger.log(Level.WARNING, msg, throwable);
}
@Override
public void warn(String msg, Throwable throwable, Object... args){
logger.log(Level.WARNING, String.format(msg, args), throwable);
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,15 +23,16 @@
*
*/
package ch.andre601.advancedserverlist.bungeecord;
package ch.andre601.advancedserverlist.bungeecord.objects;
import ch.andre601.advancedserverlist.core.profiles.players.GenericPlayer;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import ch.andre601.advancedserverlist.core.profiles.players.GenericPlayerImpl;
public class BungeePlayer extends GenericPlayer<ProxiedPlayer>{
public class BungeePlayerImpl extends GenericPlayerImpl{
public BungeePlayer(String name, int protocol){
this.name = name;
public BungeePlayerImpl(CachedPlayer player, int protocol){
this.name = player.getName();
this.protocol = protocol;
this.uuid = player.getUuid();
}
}
@@ -0,0 +1,53 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bungeecord.objects;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import java.util.Locale;
public class BungeePlayerPlaceholders extends PlaceholderProvider{
private BungeePlayerPlaceholders(){
super("player");
}
public static BungeePlayerPlaceholders init(){
return new BungeePlayerPlaceholders();
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server){
return switch(placeholder.toLowerCase(Locale.ROOT)){
case "name" -> player.getName();
case "protocol" -> String.valueOf(player.getProtocol());
case "uuid" -> String.valueOf(player.getUUID());
default -> null;
};
}
}
@@ -0,0 +1,53 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bungeecord.objects;
import ch.andre601.advancedserverlist.api.bungeecord.objects.BungeeProxy;
import net.md_5.bungee.api.config.ServerInfo;
import java.util.Map;
public record BungeeProxyImpl(Map<String, ServerInfo> servers, int playersOnline, int playersMax, String host) implements BungeeProxy{
@Override
public Map<String, ServerInfo> getServers(){
return servers;
}
@Override
public int getPlayersOnline(){
return playersOnline;
}
@Override
public int getPlayersMax(){
return playersMax;
}
@Override
public String getHost(){
return host;
}
}
@@ -0,0 +1,82 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.bungeecord.objects;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.bungeecord.objects.BungeeProxy;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import net.md_5.bungee.api.config.ServerInfo;
import java.net.InetSocketAddress;
public class BungeeServerPlaceholders extends PlaceholderProvider{
private BungeeServerPlaceholders(){
super("server");
}
public static BungeeServerPlaceholders init(){
return new BungeeServerPlaceholders();
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server){
if(!(server instanceof BungeeProxy proxy))
return null;
String[] args = placeholder.split("\\s", 2);
return switch(args[0]){
case "playersOnline" -> {
if(args.length == 2){
ServerInfo info = proxy.getServers().get(args[1]);
yield String.valueOf(info.getPlayers().size());
}
yield String.valueOf(proxy.getPlayersOnline());
}
case "playersMax" -> {
// ServerInfo doesn't provide the max players that could join, so we won't allow an extra argument
if(args.length == 2)
yield null;
yield String.valueOf(proxy.getPlayersMax());
}
case "host" -> {
if(args.length == 2){
ServerInfo info = proxy.getServers().get(args[1]);
yield String.valueOf(((InetSocketAddress)info.getSocketAddress()).getHostString());
}
yield proxy.getHost();
}
default -> null;
};
}
}
+59 -10
View File
@@ -2,7 +2,7 @@
<!--
~ MIT License
~
~ Copyright (c) 2022 Andre_601
~ 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
@@ -43,37 +43,80 @@
<maven.compiler.target>16</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>flexver-repo</id>
<url>https://repo.sleeping.town/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>api</artifactId>
<version>${api.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>configurate-yaml</artifactId>
<version>4.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.11.0</version>
<version>4.14.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.11.0</version>
<version>4.14.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<version>4.11.0</version>
<version>4.14.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.1.1</version>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.11.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.unascribed</groupId>
<artifactId>flexver-java</artifactId>
<version>1.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
<scope>provided</scope>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>AdvancedServerList-Core-${plugin.version}</finalName>
<finalName>AdvancedServerList-Core-${plugin.version}${project.build.commit}</finalName>
<resources>
<resource>
<filtering>true</filtering>
@@ -84,12 +127,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.11.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
@@ -101,6 +144,12 @@
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>com.unascribed</pattern>
<shadedPattern>ch.andre601.advancedserverlist.core.depends.flexver</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -25,35 +25,50 @@
package ch.andre601.advancedserverlist.core;
import ch.andre601.advancedserverlist.api.AdvancedServerListAPI;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.core.check.UpdateChecker;
import ch.andre601.advancedserverlist.core.commands.CommandHandler;
import ch.andre601.advancedserverlist.core.file.FileHandler;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
import ch.andre601.advancedserverlist.core.objects.ServerPlaceholders;
import ch.andre601.advancedserverlist.core.profiles.players.PlayerHandler;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
public class AdvancedServerList{
public class AdvancedServerList<F>{
private final PluginCore<?> plugin;
private final PluginCore<F> plugin;
private final FileHandler fileHandler;
private final CommandHandler commandHandler;
private final PlayerHandler playerHandler;
private final AdvancedServerListAPI api = AdvancedServerListAPI.get();
private UpdateChecker updateChecker;
private String version;
public AdvancedServerList(PluginCore<?> plugin){
private AdvancedServerList(PluginCore<F> plugin, List<PlaceholderProvider> placeholders){
this.plugin = plugin;
this.fileHandler = new FileHandler(this);
this.commandHandler = new CommandHandler(this);
this.playerHandler = new PlayerHandler(this);
placeholders.forEach(this.api::addPlaceholderProvider);
load();
}
public PluginCore<?> getPlugin(){
public static <F> AdvancedServerList<F> init(PluginCore<F> plugin, PlaceholderProvider... placeholders){
return new AdvancedServerList<>(plugin, Arrays.asList(placeholders));
}
public PluginCore<F> getPlugin(){
return plugin;
}
@@ -73,9 +88,19 @@ public class AdvancedServerList{
return version;
}
public AdvancedServerListAPI getApi(){
return api;
}
public void disable(){
getPlugin().getPluginLogger().info("Saving cache.data file...");
getPlugin().getPluginLogger().info("Saving playercache.json file...");
getPlayerHandler().save();
if(updateChecker != null){
getPlugin().getPluginLogger().info("Disabling Update Checker...");
updateChecker.disable();
}
getPlugin().getPluginLogger().info("AdvancedServerList disabled!");
}
@@ -83,12 +108,15 @@ public class AdvancedServerList{
plugin.clearFaviconCache();
}
public void clearPlayerCache(){
getPlayerHandler().clearCache();
}
private void load(){
printBanner();
resolveVersion();
getPlugin().getPluginLogger().info("Starting AdvancedServerList v%s...", version);
getPlugin().getPluginLogger().info("Platform: " + plugin.getPlatformName() + " " + plugin.getPlatformVersion());
if(getFileHandler().loadConfig()){
@@ -98,6 +126,16 @@ public class AdvancedServerList{
return;
}
if(getFileHandler().isOldConfig()){
getPlugin().getPluginLogger().info("Detected old config.yml. Attempting to migrate...");
if(getFileHandler().migrateConfig()){
getPlugin().getPluginLogger().info("Migration completed successfully!");
}else{
getPlugin().getPluginLogger().warn("Couldn't migrate config.yml! Check previous lines for errors.");
return;
}
}
if(getFileHandler().loadProfiles()){
getPlugin().getPluginLogger().info("Successfully loaded " + getFileHandler().getProfiles().size() + " profiles!");
}else{
@@ -117,7 +155,7 @@ public class AdvancedServerList{
plugin.loadEvents();
getPlugin().getPluginLogger().info("Events loaded!");
getPlugin().getPluginLogger().info("Loading cache.data...");
getPlugin().getPluginLogger().info("Loading playercache.json...");
getPlayerHandler().load();
getPlugin().getPluginLogger().info("Loading bStats metrics. Disable it in the global config under /plugins/bstats/");
@@ -125,10 +163,12 @@ public class AdvancedServerList{
getPlugin().getPluginLogger().info("Metrics loaded!");
getPlugin().getPluginLogger().info("AdvancedServerList is ready!");
if(getFileHandler().getBoolean("checkUpdates"))
this.updateChecker = new UpdateChecker(this);
}
private void printBanner(){
getPlugin().getPluginLogger().info("");
getPlugin().getPluginLogger().info(" _____ _");
getPlugin().getPluginLogger().info(" /\\ / ____| |");
getPlugin().getPluginLogger().info(" / \\ | (___ | |");
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,15 +23,15 @@
*
*/
package ch.andre601.advancedserverlist.core.interfaces;
package ch.andre601.advancedserverlist.core.check;
public interface CmdSender{
boolean hasPermission(String permission);
default void sendMsg(){
sendMsg("");
import org.jetbrains.annotations.NotNull;
import java.util.concurrent.ThreadFactory;
public class UpdateCheckThread implements ThreadFactory{
@Override
public Thread newThread(@NotNull Runnable r){
return new Thread(r, "AdvancedServerList Update-Thread");
}
void sendMsg(String msg, Object... args);
}
@@ -0,0 +1,223 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.check;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import com.unascribed.flexver.FlexVerComparator;
import io.leangen.geantyref.TypeToken;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class UpdateChecker{
private final String url = "https://api.modrinth.com/v2/project/advancedserverlist/version?loaders=[\"%s\"]";
private final OkHttpClient client = new OkHttpClient();
private final AdvancedServerList core;
private final PluginLogger logger;
private final String loader;
private final Type listType = new TypeToken<ArrayList<ModrinthVersion>>(){}.getType();
private final Gson gson = new GsonBuilder()
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.setPrettyPrinting()
.setLenient()
.create();
private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(new UpdateCheckThread());
public UpdateChecker(AdvancedServerList core){
this.core = core;
this.logger = core.getPlugin().getPluginLogger();
this.loader = core.getPlugin().getLoader();
startUpdateChecker();
}
public void startUpdateChecker(){
executor.scheduleAtFixedRate(() -> {
logger.info("Checking for a new update...");
checkUpdate().whenComplete((version, throwable) -> {
if(version == null || throwable != null){
logger.warn("Failed to look for any updates. See previous messages for reasons.");
return;
}
int result = version.compare(core.getVersion());
switch(result){
case -1 -> printUpdateBanner(version.getVersionNumber(), version.getId(), version.isRelease());
case 0 -> logger.info("No new update found. You're running the latest version!");
case 1 -> logger.info(
"Your version (%s) is higher than the latest release (%s). Are you running a dev build?",
core.getVersion(), version.getVersionNumber()
);
}
});
}, 0L, 12L, TimeUnit.HOURS);
}
public void disable(){
executor.shutdown();
client.dispatcher().executorService().shutdown();
try{
if(!executor.awaitTermination(1, TimeUnit.SECONDS)){
executor.shutdownNow();
if(!executor.awaitTermination(1, TimeUnit.SECONDS))
logger.warn("Scheduler didn't terminate in time!");
}
if(!client.dispatcher().executorService().awaitTermination(1, TimeUnit.SECONDS)){
client.dispatcher().executorService().shutdownNow();
if(!client.dispatcher().executorService().awaitTermination(1, TimeUnit.SECONDS))
logger.warn("OkHttp's Scheduler didn't terminate in time!");
}
}catch(InterruptedException ex){
executor.shutdownNow();
Thread.currentThread().interrupt();
}
}
private CompletableFuture<ModrinthVersion> checkUpdate(){
return CompletableFuture.supplyAsync(() -> {
PluginLogger logger = core.getPlugin().getPluginLogger();
if(core.getVersion().equals("UNKNOWN")){
logger.warn("Cannot perform Update check! Plugin version couldn't be parsed.");
return null;
}
Request request = new Request.Builder()
.url(String.format(url, loader))
.header("User-Agent", "AdvancedServerList-" + loader + "/" + core.getVersion())
.build();
try(Response response = client.newCall(request).execute()){
if(!response.isSuccessful()){
logger.warn("Encountered a non-successful response from Modrinth! Code: %d", response.code());
return null;
}
ResponseBody body = response.body();
if(body == null){
logger.warn("Received an empty Response body from Modrinth!");
return null;
}
String responseString = body.string();
if(responseString.isEmpty()){
logger.warn("Received an empty Response body from Modrinth!");
return null;
}
List<ModrinthVersion> list = gson.fromJson(responseString, listType);
if(list == null || list.isEmpty()){
logger.warn("Couldn't convert JSON Array into a valid list.");
return null;
}
ModrinthVersion version = list.get(0);
if(version.getVersionNumber() == null || version.getVersionNumber().isEmpty()){
logger.warn("Cannot check latest version. Received version number was null/empty.");
return null;
}
return version;
}catch(JsonSyntaxException ex){
logger.warn("Encountered invalid JSON from Response body!", ex);
return null;
}catch(IOException ex){
logger.warn("Encountered Exception while checking for an update!", ex);
return null;
}
});
}
private void printUpdateBanner(String version, String versionId, boolean isRelease){
logger.info("==================================================================");
logger.info("You are running an outdated version of AdvancedServerList!");
logger.info("");
logger.info("Your version: %s", core.getVersion());
logger.info("Modrinth version: %s", version);
logger.info("");
if(!isRelease){
logger.info("WARNING: This release is an Alpha/Beta! It may contain");
logger.info(" breaking changes!");
logger.info("");
}
logger.info("You can download the latest release from here:");
logger.info("https://modrinth.com/plugin/advancedserverlist/version/%s", versionId);
logger.info("==================================================================");
}
public static class ModrinthVersion{
@SuppressWarnings("FieldMayBeFinal")
private String id;
@SuppressWarnings("FieldMayBeFinal")
private String versionNumber;
@SuppressWarnings("FieldMayBeFinal")
private String versionType;
public ModrinthVersion(String id, String versionNumber, String versionType){
this.id = id;
this.versionNumber = versionNumber;
this.versionType = versionType;
}
public String getId(){
return id;
}
public String getVersionNumber(){
return versionNumber;
}
public boolean isRelease(){
return versionType.equals("release");
}
public int compare(String version){
return FlexVerComparator.compare(version, versionNumber);
}
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -26,56 +26,121 @@
package ch.andre601.advancedserverlist.core.commands;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.interfaces.CmdSender;
import ch.andre601.advancedserverlist.core.interfaces.commands.CmdSender;
import ch.andre601.advancedserverlist.core.interfaces.commands.PluginCommand;
import java.util.ArrayList;
import java.util.List;
public class CommandHandler{
private final AdvancedServerList core;
private final List<PluginCommand> subCommands = new ArrayList<>();
public CommandHandler(AdvancedServerList core){
this.core = core;
subCommands.add(new Help());
subCommands.add(new Reload(core));
subCommands.add(new ClearCache(core));
}
public void handle(CmdSender sender, String[] args){
String errorPrefix = "<grey>[<gradient:dark_red:red>AdvancedServerList</gradient>]";
String prefix = "<grey>[<gradient:aqua:white>AdvancedServerList</gradient>]";
if(args.length == 0){
sender.sendErrorMsg("<red>Too few arguments! Use <grey>/asl help</grey> for a list of commands.");
return;
}
if(args.length == 0 || args[0].equalsIgnoreCase("help")){
if(sender.hasPermission("advancedserverlist.command.help")){
sender.sendMsg("%s - Commands", prefix);
sender.sendMsg();
sender.sendMsg("<gradient:aqua:white>/asl help</gradient> <grey>- Shows this Help");
sender.sendMsg();
sender.sendMsg("<gradient:aqua:white>/asl reload</gradient> <grey>- Reloads the plugin");
}else{
sender.sendMsg("%s <red>You do not have permissions to execute this command!", errorPrefix);
}
}else
if(args[0].equalsIgnoreCase("reload")){
if(sender.hasPermission("advancedserverlist.command.reload")){
sender.sendMsg("%s Reloading plugin...", prefix);
if(core.getFileHandler().reloadConfig()){
sender.sendMsg("%s <green>Reloaded <grey>config.yml</grey>!", prefix);
}else{
sender.sendMsg("%s <red>Error while reloading the <grey>config.yml</grey>!", errorPrefix);
for(PluginCommand subCommand : subCommands){
if(subCommand.getArgument().equalsIgnoreCase(args[0])){
if(!sender.hasPermission(subCommand.getPermission())){
sender.sendErrorMsg(
"<red>You do not have the permission <grey>%s</grey> to execute this command.",
subCommand.getPermission()
);
return;
}
if(core.getFileHandler().reloadProfiles()){
sender.sendMsg("%s <green>Loaded <grey>%s Profile(s)</grey>!", prefix, core.getFileHandler().getProfiles());
}else{
sender.sendMsg("%s <red>Cannot load Profiles!", errorPrefix);
}
core.clearFaviconCache();
sender.sendMsg("%s <green>Successfully cleared Favicon cache!", prefix);
sender.sendMsg("%s <green>Reload complete!", prefix);
}else{
sender.sendMsg("%s <red>You do not have permissions to execute this command!", errorPrefix);
subCommand.handle(sender);
return;
}
}else{
sender.sendMsg("%s <red>Unknown subcommand <grey>%s</grey>. Use <grey>/asl help</grey> for a list of commands.", prefix, args[0]);
}
sender.sendErrorMsg("<red>Unknown subcommand <grey>%s</grey>. Use <grey>/asl help</grey> for a list of commands.", args[0]);
}
private static class Help extends PluginCommand{
public Help(){
super("help");
}
@Override
public void handle(CmdSender sender){
sender.sendPrefixedMsg("- Commands");
sender.sendMsg();
sender.sendMsg("<aqua>/asl <white>help <grey>- Shows this help");
sender.sendMsg();
sender.sendMsg("<aqua>/asl <white>reload <grey>- Reloads the plugin and clears caches");
sender.sendMsg();
sender.sendMsg("<aqua>/asl <white>clearCache <grey>- Clears the Player and Favicon cache");
}
}
private static class Reload extends PluginCommand{
private final AdvancedServerList core;
public Reload(AdvancedServerList core){
super("reload");
this.core = core;
}
@Override
public void handle(CmdSender sender){
sender.sendPrefixedMsg("Reloading plugin...");
if(core.getFileHandler().reloadConfig()){
sender.sendPrefixedMsg("<green>Reloaded <grey>config.yml</grey>!");
}else{
sender.sendErrorMsg("<red>Error while reloading <grey>config.yml</grey>!");
}
if(core.getFileHandler().reloadProfiles()){
sender.sendPrefixedMsg("<green>Loaded <grey>%d profile(s)</grey>!", core.getFileHandler().getProfiles().size());
}else{
sender.sendErrorMsg("<red>Error while loading profile(s)!");
}
core.clearFaviconCache();
sender.sendPrefixedMsg("<green>Successfully cleared Favicon Cache!");
core.clearPlayerCache();
sender.sendPrefixedMsg("<green>Successfully cleared Player Cache!");
sender.sendPrefixedMsg("<green>Reload complete!");
}
}
private static class ClearCache extends PluginCommand{
private final AdvancedServerList core;
public ClearCache(AdvancedServerList core){
super("clearCache");
this.core = core;
}
@Override
public void handle(CmdSender sender){
sender.sendPrefixedMsg("Clearing caches...");
core.clearFaviconCache();
sender.sendPrefixedMsg("<green>Successfully cleared Favicon Cache!");
core.clearPlayerCache();
sender.sendPrefixedMsg("<green>Successfully cleared Player Cache!");
sender.sendPrefixedMsg("<green>Cache clearing complete!");
}
}
}
@@ -0,0 +1,127 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.events;
import ch.andre601.advancedserverlist.api.events.GenericServerListEvent;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
import ch.andre601.advancedserverlist.core.interfaces.events.GenericEventWrapper;
import ch.andre601.advancedserverlist.core.objects.GenericServerImpl;
import ch.andre601.advancedserverlist.core.parsing.ComponentParser;
import ch.andre601.advancedserverlist.core.profiles.ServerListProfile;
import ch.andre601.advancedserverlist.core.profiles.profile.ProfileManager;
import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer;
public class PingEventHandler{
public static <F, P extends GenericPlayer> void handleEvent(GenericEventWrapper<F, P> event){
if(event.isInvalidProtocol())
return;
PluginCore<F> plugin = event.getPlugin();
String host = event.getVirtualHost();
int online = event.getOnlinePlayers();
int max = event.getMaxPlayers();
P player = event.createPlayer(
plugin.getCore().getPlayerHandler().getCachedPlayer(event.getPlayerIP()),
event.getProtocolVersion()
);
GenericServer server = event.createGenericServer(online, max, host);
ServerListProfile profile = ProfileManager.resolveProfile(plugin.getCore(), player, server);
if(profile == null)
return;
GenericServerListEvent e = event.callEvent(ProfileManager.merge(profile));
if(e == null || e.isCancelled())
return;
ProfileEntry entry = e.getEntry();
if(entry.isInvalid())
return;
if(ProfileManager.checkOption(entry.extraPlayersEnabled())){
max = online + (entry.extraPlayersCount() == null ? 0 : entry.extraPlayersCount());
event.setMaxPlayers(max);
}
GenericServer finalServer = event.createGenericServer(online, max, host);
if(ProfileManager.checkOption(entry.motd())){
event.setMotd(
ComponentParser.list(entry.motd())
.modifyText(text -> StringReplacer.replace(text, player, finalServer))
.modifyText(text -> event.parsePAPIPlaceholders(text, player))
.toComponent()
);
}
boolean hidePlayers = ProfileManager.checkOption(entry.hidePlayersEnabled());
if(hidePlayers){
event.hidePlayers();
}
if(ProfileManager.checkOption(entry.playerCountText()) && !hidePlayers){
event.setPlayerCount(
ComponentParser.text(entry.playerCountText())
.modifyText(text -> StringReplacer.replace(text, player, finalServer))
.modifyText(text -> event.parsePAPIPlaceholders(text, player))
.toString()
);
}
if(ProfileManager.checkOption(entry.players()) && !hidePlayers){
event.setPlayers(entry.players(), player, server);
}
if(ProfileManager.checkOption(entry.favicon())){
String favicon = StringReplacer.replace(entry.favicon(), player, server);
F fav = plugin.getFaviconHandler().getFavicon(favicon, image -> {
try{
return event.createFavicon(image);
}catch(Exception ex){
plugin.getPluginLogger().warn("Encountered an Exception while creating Favicon!", ex);
return null;
}
});
if(fav == null){
event.setDefaultFavicon();
}else{
event.setFavicon(fav);
}
}
event.updateEvent();
}
}
@@ -0,0 +1,75 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.file;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import org.spongepowered.configurate.ConfigurateException;
import org.spongepowered.configurate.ConfigurationNode;
import org.spongepowered.configurate.NodePath;
import org.spongepowered.configurate.transformation.ConfigurationTransformation;
import org.spongepowered.configurate.transformation.TransformAction;
public class ConfigMigrator{
public static final int LATEST = 1;
private ConfigMigrator(){}
public static ConfigurationTransformation.Versioned create(){
return ConfigurationTransformation.versionedBuilder()
.versionKey("configVersion")
.addVersion(LATEST, oneToTwo())
.build();
}
public static ConfigurationTransformation oneToTwo(){
return ConfigurationTransformation.builder()
.addAction(NodePath.path("unknown_player"), (path, value) -> new Object[]{"unknownPlayer", "name"})
.addAction(NodePath.path("unknown_player_uuid"), (path, value) -> new Object[]{"unknownPlayer", "uuid"})
.addAction(NodePath.path("disable_cache"), TransformAction.rename("disableCache"))
.addAction(NodePath.path("check_updates"), TransformAction.rename("checkUpdates"))
.addAction(NodePath.path("send_statistics"), TransformAction.rename("sendStatistics"))
.addAction(NodePath.path(), (path, value) -> {
value.node("configVersion").set(LATEST);
return null;
})
.build();
}
public static <N extends ConfigurationNode> N updateNode(final N node, PluginLogger logger) throws ConfigurateException{
if(!node.virtual()){
final ConfigurationTransformation.Versioned versioned = create();
final int startVersion = versioned.version(node);
versioned.apply(node);
final int endVersion = versioned.version(node);
if(startVersion < endVersion)
logger.info("Migrated config.yml from " + startVersion + " to " + endVersion);
}
return node;
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -28,7 +28,11 @@ package ch.andre601.advancedserverlist.core.file;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.profiles.ServerListProfile;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.core.profiles.profile.ProfileSerializer;
import org.spongepowered.configurate.ConfigurateException;
import org.spongepowered.configurate.ConfigurationNode;
import org.spongepowered.configurate.yaml.NodeStyle;
import org.spongepowered.configurate.yaml.YamlConfigurationLoader;
import java.io.File;
@@ -42,7 +46,7 @@ import java.util.List;
public class FileHandler{
private final AdvancedServerList plugin;
private final AdvancedServerList<?> plugin;
private final PluginLogger logger;
private final Path config;
@@ -52,7 +56,7 @@ public class FileHandler{
private ConfigurationNode node = null;
public FileHandler(AdvancedServerList core){
public FileHandler(AdvancedServerList<?> core){
this.plugin = core;
this.logger = core.getPlugin().getPluginLogger();
@@ -80,6 +84,7 @@ public class FileHandler{
}
Files.copy(stream, config);
logger.info("Created new config.yml!");
}catch(IOException ex){
logger.warn("Cannot create config.yml for plugin.", ex);
return false;
@@ -106,9 +111,27 @@ public class FileHandler{
return false;
}
}
return reloadProfiles();
}
public boolean migrateConfig(){
YamlConfigurationLoader loader = YamlConfigurationLoader.builder()
.path(config)
.nodeStyle(NodeStyle.BLOCK)
.build();
try{
node = ConfigMigrator.updateNode(loader.load(), logger);
loader.save(node);
return true;
}catch(ConfigurateException ex){
logger.warn("Error while trying to migrate config.yml.", ex);
return false;
}
}
public boolean reloadConfig(){
return (node = getConfigurationNode(config)) != null;
}
@@ -127,7 +150,7 @@ public class FileHandler{
if(tmp == null)
continue;
profiles.add(new ServerListProfile(tmp, logger));
profiles.add(ServerListProfile.Builder.resolve(file.getName(), tmp, logger).build());
logger.info("Loaded " + file.getName());
}
@@ -142,6 +165,7 @@ public class FileHandler{
public ConfigurationNode getConfigurationNode(Path path){
YamlConfigurationLoader loader = YamlConfigurationLoader.builder()
.defaultOptions(opts -> opts.serializers(build -> build.register(ProfileEntry.class, ProfileSerializer.INSTANCE)))
.path(path)
.build();
@@ -156,4 +180,12 @@ public class FileHandler{
public String getString(String def, Object... path){
return node.node(path).getString(def);
}
public boolean getBoolean(Object... path){
return node.node(path).getBoolean();
}
public boolean isOldConfig(){
return node.node("configVersion").virtual() || node.node("configVersion").getInt(0) < ConfigMigrator.LATEST;
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -32,4 +32,6 @@ public interface PluginLogger{
void warn(String msg, Object... args);
void warn(String msg, Throwable throwable);
void warn(String msg, Throwable throwable, Object... args);
}
@@ -0,0 +1,48 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.interfaces.commands;
public interface CmdSender{
String prefix = "<grey>[<gradient:aqua:white>AdvancedServerList</gradient>] ";
String errorPrefix = "<grey>[<gradient:dark_red:red>AdvancedServerList</gradient>] ";
boolean hasPermission(String permission);
void sendMsg(String msg, Object... args);
default void sendMsg(){
sendMsg("");
}
default void sendPrefixedMsg(String msg, Object... args){
sendMsg(prefix + msg, args);
}
default void sendErrorMsg(String msg, Object... args){
sendMsg(errorPrefix + msg, args);
}
}
@@ -0,0 +1,47 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.interfaces.commands;
import java.util.Locale;
public abstract class PluginCommand{
private final String argument;
public PluginCommand(String argument){
this.argument = argument;
}
public String getArgument(){
return argument;
}
public String getPermission(){
return "advancedserverlist.command." + getArgument().toLowerCase(Locale.ROOT);
}
public abstract void handle(CmdSender sender);
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -41,7 +41,7 @@ public interface PluginCore<F>{
void clearFaviconCache();
AdvancedServerList getCore();
AdvancedServerList<F> getCore();
Path getFolderPath();
@@ -52,4 +52,6 @@ public interface PluginCore<F>{
String getPlatformName();
String getPlatformVersion();
String getLoader();
}
@@ -0,0 +1,85 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.interfaces.events;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.api.events.GenericServerListEvent;
import ch.andre601.advancedserverlist.core.interfaces.core.PluginCore;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import net.kyori.adventure.text.Component;
import java.awt.image.BufferedImage;
import java.net.InetSocketAddress;
import java.util.List;
public interface GenericEventWrapper<F, P extends GenericPlayer>{
GenericServerListEvent callEvent(ProfileEntry entry);
void setMaxPlayers(int maxPlayers);
void setMotd(Component component);
void hidePlayers();
void setPlayerCount(String name);
void setPlayers(List<String> players, P player, GenericServer server);
void setFavicon(F favicon);
void setDefaultFavicon();
void updateEvent();
boolean isInvalidProtocol();
int getProtocolVersion();
int getOnlinePlayers();
int getMaxPlayers();
String getPlayerIP();
String parsePAPIPlaceholders(String text, P player);
String getVirtualHost();
PluginCore<F> getPlugin();
P createPlayer(CachedPlayer player, int protocol);
GenericServer createGenericServer(int playersOnline, int playersMax, String host);
F createFavicon(BufferedImage image) throws Exception;
default String resolveHost(InetSocketAddress address){
return address == null ? null : address.getHostString();
}
}
@@ -0,0 +1,54 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.objects;
import java.util.UUID;
@SuppressWarnings("FieldMayBeFinal")
public class CachedPlayer{
private String ip;
private String name;
private UUID uuid;
public CachedPlayer(String ip, String name, UUID uuid){
this.ip = ip;
this.name = name;
this.uuid = uuid;
}
public String getIp(){
return ip;
}
public String getName(){
return name;
}
public UUID getUuid(){
return uuid;
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -23,33 +23,34 @@
*
*/
package ch.andre601.advancedserverlist.spigot.logging;
package ch.andre601.advancedserverlist.core.objects;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SpigotLogger implements PluginLogger{
public class GenericServerImpl implements GenericServer{
private final Logger logger;
private final int online;
private final int max;
private final String host;
public SpigotLogger(Logger logger){
this.logger = logger;
public GenericServerImpl(int online, int max, String host){
this.online = online;
this.max = max;
this.host = host;
}
@Override
public void info(String msg, Object... args){
logger.info(String.format(msg, args));
public int getPlayersOnline(){
return online;
}
@Override
public void warn(String msg, Object... args){
logger.warning(String.format(msg, args));
public int getPlayersMax(){
return max;
}
@Override
public void warn(String msg, Throwable throwable){
logger.log(Level.WARNING, msg, throwable);
public String getHost(){
return host;
}
}
@@ -0,0 +1,47 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.objects;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
public class ServerPlaceholders extends PlaceholderProvider{
public ServerPlaceholders(){
super("server");
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer genericPlayer, GenericServer genericServer){
return switch(placeholder){
case "playersOnline" -> String.valueOf(genericServer.getPlayersOnline());
case "playersMax" -> String.valueOf(genericServer.getPlayersMax());
case "host" -> genericServer.getHost();
default -> null;
};
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -25,8 +25,6 @@
package ch.andre601.advancedserverlist.core.parsing;
import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer;
import ch.andre601.advancedserverlist.core.profiles.replacer.placeholders.Placeholders;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -58,11 +56,6 @@ public class ComponentParser{
return new ComponentParser(String.join("\n", lines));
}
public ComponentParser replacements(Placeholders placeholders){
text = StringReplacer.replace(text, placeholders.getReplacements());
return this;
}
public ComponentParser modifyText(Function<String, String> function){
this.text = function.apply(text);
return this;
@@ -1,64 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.profiles.replacer.placeholders.Placeholders;
import java.util.HashMap;
import java.util.Map;
public class ProfileManager{
private final AdvancedServerList core;
private final Map<String, Object> replacements = new HashMap<>();
private ProfileManager(AdvancedServerList core){
this.core = core;
}
public static ProfileManager get(AdvancedServerList core){
return new ProfileManager(core);
}
public ProfileManager replacements(Placeholders placeholders){
this.replacements.putAll(placeholders.getReplacements());
return this;
}
public ServerListProfile getProfile(){
for(ServerListProfile profile : core.getFileHandler().getProfiles()){
if(profile.getMotd().isEmpty() && profile.getPlayers().isEmpty() && profile.getPlayerCount().isEmpty())
continue;
if(profile.evalConditions(replacements))
return profile;
}
return null;
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -25,120 +25,166 @@
package ch.andre601.advancedserverlist.core.profiles;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.profiles.conditions.Expression;
import org.spongepowered.configurate.ConfigurationNode;
import org.spongepowered.configurate.serialize.SerializationException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class ServerListProfile{
private final int priority;
private final List<Expression> expressions;
private final ProfileEntry defaultProfile;
private final List<String> motd;
private final List<String> players;
private final String playerCount;
private final String favicon;
private final boolean hidePlayers;
private final boolean extraPlayersEnabled;
private final int extraPlayers;
private final List<ProfileEntry> profiles;
public ServerListProfile(ConfigurationNode node, PluginLogger logger){
this.priority = node.node("priority").getInt();
this.expressions = createExpressions(getList(node, false, "conditions"), logger);
private final Random random = new Random();
public ServerListProfile(int priority, List<Expression> expressions, ProfileEntry defaultProfile, List<ProfileEntry> profiles){
this.priority = priority;
this.expressions = expressions;
this.defaultProfile = defaultProfile;
this.motd = getList(node, true, "motd");
this.players = getList(node, false, "playerCount", "hover");
this.playerCount = node.node("playerCount", "text").getString("");
this.favicon = node.node("favicon").getString("");
this.hidePlayers = node.node("playerCount", "hidePlayers").getBoolean();
this.extraPlayersEnabled = node.node("playerCount", "extraPlayers", "enabled").getBoolean();
this.extraPlayers = node.node("playerCount", "extraPlayers", "amount").getInt();
this.profiles = profiles;
}
public int getPriority(){
return priority;
}
public List<String> getMotd(){
return motd;
}
public List<String> getPlayers(){
return players;
}
public String getPlayerCount(){
return playerCount;
}
public String getFavicon(){
return favicon;
}
public boolean shouldHidePlayers(){
return hidePlayers;
}
public boolean isExtraPlayersEnabled(){
return extraPlayersEnabled;
}
public int getExtraPlayers(){
return extraPlayers;
}
public boolean evalConditions(Map<String, Object> replacements){
public boolean evalConditions(GenericPlayer player, GenericServer server){
if(expressions.isEmpty())
return true;
for(Expression expression : expressions){
if(!expression.evaluate(replacements)){
if(!expression.evaluate(player, server))
return false;
}
}
return true;
}
private List<Expression> createExpressions(List<String> list, PluginLogger logger) {
if(list.isEmpty())
return Collections.emptyList();
List<Expression> expressions = new ArrayList<>();
for(String str : list){
Expression expression = new Expression(str);
if(expression.getResult() != Expression.ExpressionResult.VALID){
logger.warn("Detected Invalid condition '%s'! Cause: %s", str, expression.getResult().getMessage());
continue;
}
expressions.add(expression);
public ProfileEntry getRandomProfile(){
if(profiles.isEmpty()){
return null;
}
return expressions;
if(profiles.size() == 1)
return profiles.get(0); // No need to run a random for 1 profile.
synchronized(random){
return profiles.get(random.nextInt(profiles.size()));
}
}
private List<String> getList(ConfigurationNode node, boolean trim, Object... path){
List<String> list;
try{
list = node.node(path).getList(String.class);
}catch(SerializationException ex){
return Collections.emptyList();
public ProfileEntry getDefaultProfile(){
return defaultProfile;
}
/*
* Returns true if the Profile...
* ...doesn't have any valid MOTD set AND
* ...doesn't have any player hover set AND
* ...doesn't have a player count text set and hidePlayers is false AND
* ...doesn't have a favicon set.
*/
public boolean isInvalidProfile(){
if(profiles.isEmpty())
return defaultProfile.isInvalid();
boolean profilesValid = false;
for(ProfileEntry profile : profiles){
if(profile.isInvalid())
continue;
profilesValid = true;
break;
}
return !profilesValid && defaultProfile.isInvalid();
}
public static class Builder{
private final String fileName;
private final ConfigurationNode node;
private final int priority;
private final List<Expression> expressions = new ArrayList<>();
private final PluginLogger logger;
private List<ProfileEntry> profiles = new ArrayList<>();
private ProfileEntry defaultProfile = ProfileEntry.empty();
private Builder(String fileName, ConfigurationNode node, PluginLogger logger){
this.fileName = fileName;
this.node = node;
this.priority = node.node("priority").getInt();
this.logger = logger;
}
if(list == null)
return Collections.emptyList();
public static Builder resolve(String fileName, ConfigurationNode node, PluginLogger logger){
return new Builder(fileName, node, logger)
.resolveExpressions()
.resolveProfiles()
.resolveDefaultProfile();
}
if(trim && list.size() > 2)
return list.subList(0, 2);
private Builder resolveExpressions(){
List<String> temp;
try{
temp = node.node("conditions").getList(String.class);
}catch(SerializationException ex){
logger.warn("Encountered a SerializationException while resolving conditions for %s", ex, fileName);
return this;
}
if(temp == null || temp.isEmpty())
return this;
for(String str : temp){
Expression expr = Expression.resolve(str);
if(expr.getResult() != Expression.ExpressionResult.VALID){
logger.warn("Found invalid expression in condition '%s'! Reason: %s", str, expr.getResult().getMessage());
continue;
}
this.expressions.add(expr);
}
return this;
}
return list;
private Builder resolveProfiles(){
try{
this.profiles = node.node("profiles").getList(ProfileEntry.class);
}catch(SerializationException ex){
logger.warn("Encountered a SerializationException while resolving the profiles entry for %s", ex, fileName);
}
return this;
}
private Builder resolveDefaultProfile(){
try{
this.defaultProfile = node.get(ProfileEntry.class);
}catch(SerializationException ex){
logger.warn("Encountered a SerializationException while resolving the global profile for %s", ex, fileName);
}
return this;
}
public ServerListProfile build(){
return new ServerListProfile(this.priority, this.expressions, this.defaultProfile, this.profiles);
}
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -25,43 +25,40 @@
package ch.andre601.advancedserverlist.core.profiles.conditions;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.core.profiles.replacer.StringReplacer;
import java.util.Map;
public class Expression{
private ExpressionResult result = ExpressionResult.VALID;
private final ExpressionResult result;
private String left;
private Operator operator = Operator.UNKNOWN;
private String right;
private final String left;
private final Operator operator;
private final String right;
public Expression(String expression){
resolveExpression(expression);
private Expression(ExpressionResult result, String left, Operator operator, String right){
this.result = result;
this.left = left;
this.operator = operator;
this.right = right;
}
public boolean evaluate(Map<String, Object> replacements){
String newLeft = StringReplacer.replace(left, replacements).trim();
String newRight = StringReplacer.replace(right, replacements).trim();
public static Expression createInvalid(ExpressionResult result){
return new Expression(result, null, Operator.UNKNOWN, null);
}
public static Expression resolve(String expression){
Operator operator = Operator.UNKNOWN;
return operator.evaluate(newLeft, newRight);
}
public ExpressionResult getResult(){
return result;
}
private void resolveExpression(String expression){
if(expression == null || expression.isEmpty()){
result = ExpressionResult.INVALID_NO_EXPRESSION;
return;
return Expression.createInvalid(ExpressionResult.INVALID_NO_EXPRESSION);
}
char[] chars = expression.toCharArray();
StringBuilder left = new StringBuilder();
StringBuilder right = new StringBuilder();
StringBuilder leftBuilder = new StringBuilder();
StringBuilder rightBuilder = new StringBuilder();
boolean foundOperator = false;
@@ -70,31 +67,39 @@ public class Expression{
char next = (i == (chars.length - 1)) ? '\0' : chars[i + 1];
Operator tmp = Operator.getOperand(c, next);
if(tmp == Operator.UNKNOWN){
if(foundOperator){
right.append(c);
}else{
left.append(c);
}
if(tmp != Operator.UNKNOWN && !foundOperator){
operator = tmp;
foundOperator = true;
if(tmp.hasSecond())
i++; // Skip next character if operator has 2
continue;
}
if(foundOperator){
result = ExpressionResult.INVALID_DOUBLE_OPERATOR;
return;
rightBuilder.append(c);
}else{
leftBuilder.append(c);
}
operator = tmp;
foundOperator = true;
}
if(left.isEmpty() || right.isEmpty()){
result = ExpressionResult.INVALID_EMPTY_PARTS;
return;
if(leftBuilder.isEmpty() || rightBuilder.isEmpty()){
return Expression.createInvalid(ExpressionResult.INVALID_EMPTY_PARTS);
}
this.left = left.toString();
this.right = right.toString();
return new Expression(ExpressionResult.VALID, leftBuilder.toString().trim(), operator, rightBuilder.toString().trim());
}
public boolean evaluate(GenericPlayer player, GenericServer server){
String newLeft = StringReplacer.replace(left, player, server);
String newRight = StringReplacer.replace(right, player, server);
return operator.evaluate(newLeft, newRight);
}
public ExpressionResult getResult(){
return result;
}
public enum Operator{
@@ -122,12 +127,24 @@ public class Expression{
return left.equals(right);
}
},
EQUALS_IGNORE_CASE('~', '='){
@Override
public boolean evaluate(String left, String right){
return left.equalsIgnoreCase(right);
}
},
NOT_EQUAL('!', '='){
@Override
public boolean evaluate(String left, String right){
return !left.equals(right);
}
},
NOT_EQUAL_IGNORE_CASE('!', '~'){
@Override
public boolean evaluate(String left, String right){
return !left.equalsIgnoreCase(right);
}
},
GREATER('>', '\0'){
@Override
public boolean evaluate(String left, String right){
@@ -167,7 +184,7 @@ public class Expression{
public static Operator getOperand(char first, char second){
for(Operator operator : VALUES){
if(operator.first == first){
if((!operator.hasSecond() && second != '=') || operator.second == second)
if((!operator.hasSecond() && second != '=' && second != '~') || operator.second == second)
return operator;
}
}
@@ -193,9 +210,8 @@ public class Expression{
public enum ExpressionResult{
VALID(null),
INVALID_NO_EXPRESSION ("Received empty condition which isn't allowed!"),
INVALID_DOUBLE_OPERATOR("Condition contained two operands."),
INVALID_EMPTY_PARTS ("Received condition with either left or right part being empty.");
INVALID_NO_EXPRESSION("Received empty condition which isn't allowed!"),
INVALID_EMPTY_PARTS ("Received condition with either left or right part being empty.");
private final String message;
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -26,8 +26,8 @@
package ch.andre601.advancedserverlist.core.profiles.favicon;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import javax.imageio.ImageIO;
import java.awt.*;
@@ -39,12 +39,13 @@ import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
public class FaviconHandler<F>{
private final Cache<String, F> favicons = Caffeine.newBuilder()
private final Cache<String, F> favicons = CacheBuilder.newBuilder()
.expireAfterWrite(5, TimeUnit.MINUTES)
.build();
@@ -55,13 +56,17 @@ public class FaviconHandler<F>{
}
public F getFavicon(String input, Function<BufferedImage, F> function){
return favicons.get(input, k -> {
BufferedImage image = resolveImage(core, input);
if(image == null)
return null;
return function.apply(image);
});
try{
return favicons.get(input, () -> {
BufferedImage image = resolveImage(core, input);
if(image == null)
return null;
return function.apply(image);
});
}catch(ExecutionException ignored){
return null;
}
}
public void clearCache(){
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -25,48 +25,28 @@
package ch.andre601.advancedserverlist.core.profiles.players;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import java.util.UUID;
public abstract class GenericPlayer<T>{
public abstract class GenericPlayerImpl implements GenericPlayer{
protected T player = null;
protected String name = null;
protected String version = null;
protected int protocol = -1;
protected boolean playedBefore = false;
protected boolean banned = false;
protected boolean whitelisted = false;
protected int protocol = 0;
protected UUID uuid = null;
public T getPlayer(){
return player;
}
@Override
public String getName(){
return name;
}
@Override
public int getProtocol(){
return protocol;
}
public String getVersion(){
return version;
}
public boolean hasPlayedBefore(){
return playedBefore;
}
public boolean isBanned(){
return banned;
}
public boolean isWhitelisted(){
return whitelisted;
}
public UUID getUniqueId(){
@Override
public UUID getUUID(){
return uuid;
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -26,97 +26,149 @@
package ch.andre601.advancedserverlist.core.profiles.players;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.profiles.replacer.EntryList;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import com.google.gson.Gson;
import io.leangen.geantyref.TypeToken;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.Reader;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;
import java.util.UUID;
public class PlayerHandler{
private final AdvancedServerList core;
private final AdvancedServerList<?> core;
private final PluginLogger logger;
private final Path cache;
private final EntryList<String, String> players = new EntryList<>();
private List<CachedPlayer> cachedPlayers = new ArrayList<>();
public PlayerHandler(AdvancedServerList core){
private final Type listType = new TypeToken<ArrayList<CachedPlayer>>(){}.getType();
private final Gson gson = new Gson();
// UUID of MHF_Question
private final UUID defaultUUID = UUID.fromString("606e2ff0-ed77-4842-9d6c-e1d3321c7838");
private CachedPlayer defaultPlayer = null;
public PlayerHandler(AdvancedServerList<?> core){
this.core = core;
this.cache = core.getPlugin().getFolderPath().resolve("cache.data");
this.logger = core.getPlugin().getPluginLogger();
this.cache = core.getPlugin().getFolderPath().resolve("playercache.json");
}
public void load(){
if(!cache.toFile().exists()){
core.getPlugin().getPluginLogger().info("No cache.data present. Skipping...");
logger.info("No playercache.json file present. Skipping...");
return;
}
List<String> lines;
if(core.getFileHandler().getBoolean("disableCache")){
logger.info("'disable_cache' is set to true. Skipping playercache.json loading...");
return;
}
try{
lines = Files.readAllLines(cache);
Reader reader = Files.newBufferedReader(cache);
cachedPlayers = gson.fromJson(reader, listType);
reader.close();
}catch(IOException ex){
core.getPlugin().getPluginLogger().warn("Encountered IOException while trying to read cache.data", ex);
logger.warn("Encountered IOException while reading the playercache.json file!", ex);
return;
}
if(lines.isEmpty()){
core.getPlugin().getPluginLogger().info("cache.data is empty. Skipping...");
return;
}
for(String line : lines){
String[] parts = line.split("=", 2);
if(parts.length < 2 || parts[0].isEmpty() || parts[1].isEmpty())
continue;
if(players.containsKey(parts[0]))
continue;
players.add(parts[0], parts[1]);
}
core.getPlugin().getPluginLogger().info("Loaded " + players.size() + " players into cache!");
logger.info("Loaded %d players into cache!", cachedPlayers.size());
}
public void save(){
if(players.isEmpty()){
core.getPlugin().getPluginLogger().info("No data to save. Skipping...");
if(cachedPlayers.isEmpty()){
logger.info("No players in cache to save. Skipping...");
return;
}
StringJoiner joiner = new StringJoiner("\n");
for(Map.Entry<String, String> entry : players){
joiner.add(entry.getKey() + "=" + entry.getValue());
if(core.getFileHandler().getBoolean("disableCache")){
logger.info("'disable_cache' is set to true. Skipping saving of cached players...");
return;
}
try{
BufferedWriter writer = Files.newBufferedWriter(cache, StandardCharsets.UTF_8, StandardOpenOption.WRITE);
writer.write(joiner.toString());
writer.close();
core.getPlugin().getPluginLogger().info("Successfully saved cache.data file.");
try(BufferedWriter writer = Files.newBufferedWriter(cache, StandardCharsets.UTF_8)){
gson.toJson(cachedPlayers, listType, writer);
logger.info("Successfully saved playercache.json file.");
}catch(IOException ex){
core.getPlugin().getPluginLogger().warn("Cannot save player data to cache.data file!", ex);
logger.warn("Encountered IOException while saving cached players to playercache.json!", ex);
}
}
public void addPlayer(String name, String ip){
if(players.containsKey(name))
public void addPlayer(String ip, String name, UUID uuid){
if(contains(ip) || core.getFileHandler().getBoolean("disableCache"))
return;
players.add(name, ip);
cachedPlayers.add(new CachedPlayer(ip, name, uuid));
}
public String getPlayerByIp(String ip){
for(Map.Entry<String, String> entry : players){
if(entry.getValue().equals(ip))
return entry.getKey();
public CachedPlayer getCachedPlayer(String key){
if(!contains(key) || core.getFileHandler().getBoolean("disableCache"))
return getDefaultPlayer();
for(CachedPlayer player : cachedPlayers){
if(player.getIp().equals(key))
return player;
}
return core.getFileHandler().getString("Anonymous", "unknown_player");
return getDefaultPlayer();
}
public CachedPlayer getCachedPlayer(UUID uuid){
for(CachedPlayer player : cachedPlayers){
if(player.getUuid().equals(uuid))
return player;
}
return getDefaultPlayer();
}
public void clearCache(){
cachedPlayers.clear();
defaultPlayer = null;
}
private boolean contains(String ip){
for(CachedPlayer player : cachedPlayers){
if(player.getIp().equals(ip))
return true;
}
return false;
}
private CachedPlayer getDefaultPlayer(){
if(defaultPlayer != null)
return defaultPlayer;
return (defaultPlayer = new CachedPlayer(
"0.0.0.0",
core.getFileHandler().getString("Anonymous", "unknownPlayer", "name"),
convertToUUID(core.getFileHandler().getString(defaultUUID.toString(), "unknownPlayer", "uuid"))
));
}
private UUID convertToUUID(String uuid){
try{
return UUID.fromString(uuid);
}catch(IllegalArgumentException ex){
// This is always a valid UUID.
return defaultUUID;
}
}
}
@@ -0,0 +1,181 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.profile;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.api.objects.NullBool;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.profiles.ServerListProfile;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import org.spongepowered.configurate.ConfigurationNode;
import org.spongepowered.configurate.serialize.SerializationException;
import java.util.Collections;
import java.util.List;
public class ProfileManager{
/*
* Convenience method to get a ProfileEntry instance with values merged.
* If the random profile's value is not null will it be used instead of the default one.
*/
public static ProfileEntry merge(ServerListProfile profile){
ProfileEntry entry = profile.getRandomProfile();
ProfileEntry defEntry = profile.getDefaultProfile();
List<String> motd = resolveMOTD(entry, defEntry);
List<String> players = resolvePlayers(entry, defEntry);
String playerCountText = resolvePlayerCountText(entry, defEntry);
String favicon = resolveFavicon(entry, defEntry);
boolean isHidePlayersEnabled = resolveHidePlayersEnabled(entry, defEntry);
boolean isExtraPlayersEnabled = resolveExtraPlayersEnabled(entry, defEntry);
Integer extraPlayersCount = resolveExtraPlayersCount(entry, defEntry);
return new ProfileEntry(motd, players, playerCountText, favicon,
NullBool.resolve(isHidePlayersEnabled), NullBool.resolve(isExtraPlayersEnabled), extraPlayersCount);
}
public static ServerListProfile resolveProfile(AdvancedServerList core, GenericPlayer player, GenericServer server){
for(ServerListProfile profile : core.getFileHandler().getProfiles()){
if(profile.isInvalidProfile())
continue;
if(profile.evalConditions(player, server))
return profile;
}
return null;
}
public static ProfileEntry retrieveProfileEntry(ConfigurationNode node){
List<String> motd = resolveList(node, "motd");
List<String> players = resolveList(node, "playerCount", "hover");
String playerCountText = node.node("playerCount", "text").getString("");
String favicon = node.node("favicon").getString("");
NullBool hidePlayers = resolveNullBool(node, "playerCount", "hidePlayers");
NullBool extraPlayersEnabled = resolveNullBool(node, "playerCount", "extraPlayers", "enabled");
Integer extraPlayers = resolveNullableInt(node);
return new ProfileEntry.Builder()
.setMotd(motd)
.setPlayers(players)
.setPlayerCountText(playerCountText)
.setFavicon(favicon)
.setHidePlayersEnabled(hidePlayers)
.setExtraPlayersEnabled(extraPlayersEnabled)
.setExtraPlayerCount(extraPlayers)
.build();
}
public static boolean checkOption(Object obj){
if(obj == null)
return false;
if(obj instanceof List<?> list){
return !list.isEmpty(); // Check if list isn't empty
}else
if(obj instanceof String str){
return !str.isEmpty(); // Check if String is not empty
}else
if(obj instanceof NullBool nb){
return nb.getOrDefault(false); // Return NullBool's value
}
return false;
}
private static List<String> resolveMOTD(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.motd()))
return defaultProfile.motd();
return profile.motd();
}
private static List<String> resolvePlayers(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.players()))
return defaultProfile.players();
return profile.players();
}
private static String resolvePlayerCountText(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.playerCountText()))
return defaultProfile.playerCountText();
return profile.playerCountText();
}
private static String resolveFavicon(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.favicon()))
return defaultProfile.favicon();
return profile.favicon();
}
private static boolean resolveHidePlayersEnabled(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.hidePlayersEnabled()))
return defaultProfile.hidePlayersEnabled().getOrDefault(false);
return profile.hidePlayersEnabled().getOrDefault(false);
}
private static boolean resolveExtraPlayersEnabled(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || !checkOption(profile.extraPlayersEnabled()))
return defaultProfile.extraPlayersEnabled().getOrDefault(false);
return profile.extraPlayersEnabled().getOrDefault(false);
}
private static Integer resolveExtraPlayersCount(ProfileEntry profile, ProfileEntry defaultProfile){
if(profile == null || profile.extraPlayersCount() == null)
return defaultProfile.extraPlayersCount() == null ? 0 : defaultProfile.extraPlayersCount();
return profile.extraPlayersCount();
}
private static List<String> resolveList(ConfigurationNode node, Object... path){
try{
return node.node(path).getList(String.class);
}catch(SerializationException ex){
return Collections.emptyList();
}
}
private static NullBool resolveNullBool(ConfigurationNode node, Object... path){
if(node.node(path).virtual())
return NullBool.NOT_SET;
return NullBool.resolve(node.node(path).getBoolean());
}
private static Integer resolveNullableInt(ConfigurationNode node){
if(node.node("playerCount", "extraPlayers", "amount").virtual())
return null;
return node.node("playerCount", "extraPlayers", "amount").getInt();
}
}
@@ -0,0 +1,59 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.profile;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.spongepowered.configurate.ConfigurationNode;
import org.spongepowered.configurate.serialize.SerializationException;
import org.spongepowered.configurate.serialize.TypeSerializer;
import ch.andre601.advancedserverlist.api.profiles.ProfileEntry;
import java.lang.reflect.Type;
public class ProfileSerializer implements TypeSerializer<ProfileEntry>{
public static final ProfileSerializer INSTANCE = new ProfileSerializer();
@Override
public ProfileEntry deserialize(Type type, ConfigurationNode node){
return ProfileManager.retrieveProfileEntry(node);
}
@Override
public void serialize(Type type, @Nullable ProfileEntry profile, ConfigurationNode node) throws SerializationException{
if(profile == null){
node.raw(null);
return;
}
node.node("motd").set(profile.motd());
node.node("playerCount", "hover").set(profile.players());
node.node("playerCount", "text").set(profile.playerCountText());
node.node("favicon").set(profile.favicon());
node.node("playerCount", "hidePlayers").set(profile.hidePlayersEnabled());
node.node("playerCount", "extraPlayers", "enabled").set(profile.extraPlayersEnabled());
node.node("playerCount", "extraPlayers", "amount").set(profile.extraPlayersCount());
}
}
@@ -1,49 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.replacer;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Map;
/*
* Original by Imo van den Berge (aka Bergerkiller: https://github.com/Bergerkiller)
*
* Original Source: https://github.com/bergerhealer/BKCommonLib/blob/master/src/main/java/com/bergerkiller/bukkit/common/collections/EntryList.java
*/
public class EntryList<K, V> extends ArrayList<Map.Entry<K, V>>{
public void add(K key, V value){
add(new AbstractMap.SimpleEntry<>(key, value));
}
public boolean containsKey(K key){
for(Map.Entry<K, V> entry : this){
if(entry.getKey().equals(key))
return true;
}
return false;
}
}
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
* 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
@@ -25,20 +25,110 @@
package ch.andre601.advancedserverlist.core.profiles.replacer;
import java.util.Map;
import ch.andre601.advancedserverlist.api.AdvancedServerListAPI;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
public class StringReplacer{
public static String replace(String input, Map<String, Object> replacements){
StringBuilder output = new StringBuilder(input);
int index;
for(Map.Entry<String, Object> entry : replacements.entrySet()){
index = 0;
while((index = output.indexOf(entry.getKey(), index)) != -1){
output.replace(index, index + entry.getKey().length(), String.valueOf(entry.getValue()));
index += String.valueOf(entry.getValue()).length();
public static String replace(String input, GenericPlayer player, GenericServer server){
if(input == null)
return null;
char[] chars = input.toCharArray();
StringBuilder builder = new StringBuilder(input.length());
StringBuilder identifier = new StringBuilder();
StringBuilder placeholder = new StringBuilder();
AdvancedServerListAPI api = AdvancedServerListAPI.get();
for(int i = 0; i < chars.length; i++){
char c = chars[i];
char next = (i == (chars.length - 1)) ? '\0' : chars[i + 1];
if(c != '$' || i + 2 >= chars.length){
builder.append(c);
continue;
}
if(next != '{'){
if(next == '\0')
continue;
builder.append(next);
i++;
continue;
}
i++;
boolean identified = false;
boolean invalid = true;
while(++i < chars.length){
final char id = chars[i];
if(id == '}'){
invalid = false;
break;
}
if(id == ' ' && !identified){
identified = true;
continue;
}
if(identified){
placeholder.append(id);
}else{
identifier.append(id);
}
}
String identifierString = identifier.toString();
String placeholderString = placeholder.toString();
identifier.setLength(0);
placeholder.setLength(0);
if(invalid){
builder.append("${").append(identifierString);
if(identified){
builder.append(' ').append(placeholderString);
}
continue;
}
PlaceholderProvider provider = api.retrievePlaceholderProvider(identifierString);
if(provider == null){
builder.append("${").append(identifierString);
if(identified){
builder.append(' ').append(placeholderString);
}
builder.append('}');
continue;
}
String replacement = provider.parsePlaceholder(placeholderString, player, server);
if(replacement == null){
builder.append("${").append(identifierString);
if(identified){
builder.append(' ').append(placeholderString);
}
builder.append('}');
continue;
}
builder.append(replacement);
}
return output.toString();
return builder.toString();
}
}
@@ -1,57 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2022 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.core.profiles.replacer.placeholders;
import ch.andre601.advancedserverlist.core.profiles.players.GenericPlayer;
import java.util.HashMap;
import java.util.Map;
public class PlayerPlaceholders implements Placeholders{
private final Map<String, Object> replacements = new HashMap<>();
public PlayerPlaceholders(GenericPlayer<?> player){
this.replacements.put("${player name}", player.getName());
this.replacements.put("${player protocol}", player.getProtocol());
if(player.getVersion() != null)
this.replacements.put("${player version}", player.getVersion());
if(player.getPlayer() == null)
return;
this.replacements.put("${player hasPlayedBefore}", player.hasPlayedBefore());
this.replacements.put("${player isBanned}", player.isBanned());
this.replacements.put("${player isWhitelisted}", player.isWhitelisted());
this.replacements.put("${player uuid}", player.getUniqueId());
}
@Override
public Map<String, Object> getReplacements(){
return replacements;
}
}
+38 -2
View File
@@ -1,4 +1,40 @@
#
# Used for when AdvancedServerList doesn't have a cached player to use for ${player name}
# Used for when AdvancedServerList doesn't have a cached player to use for player placeholders.
#
unknown_player: "Anonymous"
unknownPlayer:
#
# The name to use. Defaults to Anonymous.
#
name: "Anonymous"
#
# The UUID to use. Defaults to 606e2ff0-ed77-4842-9d6c-e1d3321c7838 (UUID of MHF_Question).
#
uuid: "606e2ff0-ed77-4842-9d6c-e1d3321c7838"
#
# Should the Caching of players be disabled?
#
# When set to true will AdvancedServerList not load any players from the cache.data file (if present) nor save any to it.
# Placeholders that rely on the player being cached (such as ${player name}) will not work while this option is enabled.
#
# Defaults to false when not present.
#
disableCache: false
#
# Should AdvancedServerList check for new versions?
#
# When set to true will AdvancedServerList check for a new version on modrinth.com every 12 hours and inform you in the
# console about whether it found any new update or not.
#
# Defaults to false when not present.
#
checkUpdates: true
#
# DO NOT EDIT!
#
# This is used internally to determine if the config needs to be migrated.
# Changing or even removing this option could result in your config being broken.
#
config-version: 2
+38 -5
View File
@@ -16,24 +16,54 @@ priority: 0
# - '{playerVersion} < 759'
#
# Set the MOTD that should be displayed.
# Option that allows you to define multiple profiles to use.
# Each entry supports the same options as the server list profile does. Whenever an option is not present, or set to
# an empty value (If supported) would the option in the file be used (if present).
# This allows you to f.e. randomize the MOTD while keeping other options the same, without copy-pasting the same options.
#
# A profile will be selected randomly.
#
# 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
#
#profiles:
# - motd:
# - '<aqua>Line 1'
# - '<aqua>Line 2'
# favicon: ''
# playerCount:
# hidePlayers: false
# hover:
# - '<green>Line 1'
# - '<green>Line 2'
# - '<green>Line 3'
# text: ''
# extraPlayers:
# enabled: false
# amount: 0
#
# Set the default (Global) MOTD used by this server list profile.
# Supports HEX colors for 1.16+ servers including gradients using MiniMessage's <gradient:color:color> format.
#
# Remove this option or set it to motd: [] to not alter the MOTD.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#motd
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#motds
#
motd:
- '<grey>Line 1'
- '<grey>Line 2'
#
# Allows you to set a favicon for this server list profile.
# Allows you to set a global (Default) favicon for this server list profile.
# You can use one of three possible options:
# 1. A file name matching a PNG file located in the 'favicons' folder (Needs to end with .png)
# 2. A URL pointing to a valid Image
# 3. ${player name} to display the player's head as favicon. Uses https://mc-heads.net for this
#
# Remove this option or set to favicon: '' to not replace the Favicon.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#favicon
#
favicon: ''
@@ -50,12 +80,15 @@ playerCount:
#
# Note that when this is enabled will all other options, except for 'extraPlayers', be ignored.
#
# Defaults to false when not present.
#
# Read more: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#hideplayers
#
hidePlayers: false
#
# Sets the text displayed when hovering over the player count.
# You can set this to 'hover: []' or remove the option to not modify the hover text.
#
# 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
#
@@ -69,7 +102,7 @@ playerCount:
# Note that when used, the Ping icon will display as 'outdated server'/'outdated client'.
# This is nothing that can be fixed or avoided and would require changes from Mojang.
#
# You can set this to 'count: ''' or remove the option to not modify the player count text.
# 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
#
+1 -1
View File
@@ -1,7 +1,7 @@
#
# MIT License
#
# Copyright (c) 2022 Andre_601
# 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
@@ -0,0 +1,292 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.test;
import com.unascribed.flexver.FlexVerComparator;
import org.junit.Test;
public class FlexVerTests{
private final String baseVersion = "1.0.0";
private final String versionMinor = "1.0.1";
private final String versionMajor = "1.1.0";
private final String versionBoth = "1.1.1";
private final String versionBeta = "1.0.0-b1";
private final String versionBetaMinor = "1.0.1-b1";
private final String versionBetaMajor = "1.1.0-b1";
private final String versionBetaBoth = "1.1.1-b1";
private final String versionBeta2 = "1.0.0-b2";
private final String versionBeta2Minor = "1.0.1-b2";
private final String versionBeta2Major = "1.1.0-b2";
private final String versionBeta2Both = "1.1.1-b2";
@Test
public void testFlexVerChecks(){
System.out.println("START: Version comparison Tests");
compareBaseVersion();
compareMinorVersion();
compareMajorVersion();
compareBothVersion();
compareBetaVersion();
compareBetaMinorVersion();
compareBetaMajorVersion();
compareBetaBothVersion();
compareBeta2Version();
compareBeta2MinorVersion();
compareBeta2MajorVersion();
compareBeta2BothVersion();
System.out.println("END: Version comparison Tests");
}
private void compareBaseVersion(){
System.out.println("┌────────────────────────────────┐");
System.out.println("│ Normal Version │");
System.out.println("│ │");
compare(baseVersion, "=", baseVersion, 0);
compare(baseVersion, "<", versionMinor, -1);
compare(baseVersion, "<", versionMajor, -1);
compare(baseVersion, "<", versionBoth, -1);
compare(baseVersion, ">", versionBeta, 1);
compare(baseVersion, "<", versionBetaMinor, -1);
compare(baseVersion, "<", versionBetaMajor, -1);
compare(baseVersion, "<", versionBetaBoth, -1);
compare(baseVersion, ">", versionBeta2, 1);
compare(baseVersion, "<", versionBeta2Minor, -1);
compare(baseVersion, "<", versionBeta2Major, -1);
compare(baseVersion, "<", versionBeta2Both, -1);
System.out.println("├────────────────────────────────┤");
}
private void compareMinorVersion(){
System.out.println("│ Minor Version │");
System.out.println("│ │");
compare(versionMinor, ">", baseVersion, 1);
compare(versionMinor, "=", versionMinor, 0);
compare(versionMinor, "<", versionMajor, -1);
compare(versionMinor, "<", versionBoth, -1);
compare(versionMinor, ">", versionBeta, 1);
compare(versionMinor, ">", versionBetaMinor, 1);
compare(versionMinor, "<", versionBetaMajor, -1);
compare(versionMinor, "<", versionBetaBoth, -1);
compare(versionMinor, ">", versionBeta2, 1);
compare(versionMinor, ">", versionBeta2Minor, 1);
compare(versionMinor, "<", versionBeta2Major, -1);
compare(versionMinor, "<", versionBeta2Both, -1);
System.out.println("├────────────────────────────────┤");
}
private void compareMajorVersion(){
System.out.println("│ Major Version │");
System.out.println("│ │");
compare(versionMajor, ">", baseVersion, 1);
compare(versionMajor, ">", versionMinor, 1);
compare(versionMajor, "=", versionMajor, 0);
compare(versionMajor, "<", versionBoth, -1);
compare(versionMajor, ">", versionBeta, 1);
compare(versionMajor, ">", versionBetaMinor, 1);
compare(versionMajor, ">", versionBetaMajor, 1);
compare(versionMajor, "<", versionBetaBoth, -1);
compare(versionMajor, ">", versionBeta2, 1);
compare(versionMajor, ">", versionBeta2Minor, 1);
compare(versionMajor, ">", versionBeta2Major, 1);
compare(versionMajor, "<", versionBeta2Both, -1);
System.out.println("├────────────────────────────────┤");
}
private void compareBothVersion(){
System.out.println("│ Major + Minor Version │");
System.out.println("│ │");
compare(versionBoth, ">", baseVersion, 1);
compare(versionBoth, ">", versionMinor, 1);
compare(versionBoth, ">", versionMajor, 1);
compare(versionBoth, "=", versionBoth, 0);
compare(versionBoth, ">", versionBeta, 1);
compare(versionBoth, ">", versionBetaMinor, 1);
compare(versionBoth, ">", versionBetaMajor, 1);
compare(versionBoth, ">", versionBetaBoth, 1);
compare(versionBoth, ">", versionBeta2, 1);
compare(versionBoth, ">", versionBeta2Minor, 1);
compare(versionBoth, ">", versionBeta2Major, 1);
compare(versionBoth, ">", versionBeta2Both, 1);
System.out.println("├────────────────────────────────┤");
}
private void compareBetaVersion(){
System.out.println("│ Beta Version │");
System.out.println("│ │");
compare(versionBeta, "<", baseVersion, -1);
compare(versionBeta, "<", versionMinor, -1);
compare(versionBeta, "<", versionMajor, -1);
compare(versionBeta, "<", versionBoth, -1);
compare(versionBeta, "=", versionBeta, 0);
compare(versionBeta, "<", versionBetaMinor, -1);
compare(versionBeta, "<", versionBetaMajor, -1);
compare(versionBeta, "<", versionBetaBoth, -1);
compare(versionBeta, "<", versionBeta2, -1);
compare(versionBeta, "<", versionBeta2Minor, -1);
compare(versionBeta, "<", versionBeta2Major, -1);
compare(versionBeta, "<", versionBeta2Both, -1);
System.out.println("├────────────────────────────────┤");
}
private void compareBetaMinorVersion(){
System.out.println("│ Beta Version Minor │");
System.out.println("│ │");
compare(versionBetaMinor, ">", baseVersion, 1);
compare(versionBetaMinor, "<", versionMinor, -1);
compare(versionBetaMinor, "<", versionMajor, -1);
compare(versionBetaMinor, "<", versionBoth, -1);
compare(versionBetaMinor, ">", versionBeta, 1);
compare(versionBetaMinor, "=", versionBetaMinor, 0);
compare(versionBetaMinor, "<", versionBetaMajor, -1);
compare(versionBetaMinor, "<", versionBetaBoth, -1);
compare(versionBetaMinor, ">", versionBeta2, 1);
compare(versionBetaMinor, "<", versionBeta2Minor, -1);
compare(versionBetaMinor, "<", versionBeta2Major, -1);
compare(versionBetaMinor, "<", versionBeta2Both, -1);
System.out.println("├────────────────────────────────┤");
}
private void compareBetaMajorVersion(){
System.out.println("│ Beta Version Major │");
System.out.println("│ │");
compare(versionBetaMajor, ">", baseVersion, 1);
compare(versionBetaMajor, ">", versionMinor, 1);
compare(versionBetaMajor, "<", versionMajor, -1);
compare(versionBetaMajor, "<", versionBoth, -1);
compare(versionBetaMajor, ">", versionBeta, 1);
compare(versionBetaMajor, ">", versionBetaMinor, 1);
compare(versionBetaMajor, "=", versionBetaMajor, 0);
compare(versionBetaMajor, "<", versionBetaBoth, -1);
compare(versionBetaMajor, ">", versionBeta2, 1);
compare(versionBetaMajor, ">", versionBeta2Minor, 1);
compare(versionBetaMajor, "<", versionBeta2Major, -1);
compare(versionBetaMajor, "<", versionBeta2Both, -1);
System.out.println("├────────────────────────────────┤");
}
private void compareBetaBothVersion(){
System.out.println("│ Beta Version Major + Minor │");
System.out.println("│ │");
compare(versionBetaBoth, ">", baseVersion, 1);
compare(versionBetaBoth, ">", versionMinor, 1);
compare(versionBetaBoth, ">", versionMajor, 1);
compare(versionBetaBoth, "<", versionBoth, -1);
compare(versionBetaBoth, ">", versionBeta, 1);
compare(versionBetaBoth, ">", versionBetaMinor, 1);
compare(versionBetaBoth, ">", versionBetaMajor, 1);
compare(versionBetaBoth, "=", versionBetaBoth, 0);
compare(versionBetaBoth, ">", versionBeta2, 1);
compare(versionBetaBoth, ">", versionBeta2Minor, 1);
compare(versionBetaBoth, ">", versionBeta2Major, 1);
compare(versionBetaBoth, "<", versionBeta2Both, -1);
System.out.println("├────────────────────────────────┤");
}
private void compareBeta2Version(){
System.out.println("│ Beta Version 2 │");
System.out.println("│ │");
compare(versionBeta2, "<", baseVersion, -1);
compare(versionBeta2, "<", versionMinor, -1);
compare(versionBeta2, "<", versionMajor, -1);
compare(versionBeta2, "<", versionBoth, -1);
compare(versionBeta2, ">", versionBeta, 1);
compare(versionBeta2, "<", versionBetaMinor, -1);
compare(versionBeta2, "<", versionBetaMajor, -1);
compare(versionBeta2, "<", versionBetaBoth, -1);
compare(versionBeta2, "=", versionBeta2, 0);
compare(versionBeta2, "<", versionBeta2Minor, -1);
compare(versionBeta2, "<", versionBeta2Major, -1);
compare(versionBeta2, "<", versionBeta2Both, -1);
System.out.println("├────────────────────────────────┤");
}
private void compareBeta2MinorVersion(){
System.out.println("│ Beta Version 2 Minor │");
System.out.println("│ │");
compare(versionBeta2Minor, ">", baseVersion, 1);
compare(versionBeta2Minor, "<", versionMinor, -1);
compare(versionBeta2Minor, "<", versionMajor, -1);
compare(versionBeta2Minor, "<", versionBoth, -1);
compare(versionBeta2Minor, ">", versionBeta, 1);
compare(versionBeta2Minor, ">", versionBetaMinor, 1);
compare(versionBeta2Minor, "<", versionBetaMajor, -1);
compare(versionBeta2Minor, "<", versionBetaBoth, -1);
compare(versionBeta2Minor, ">", versionBeta2, 1);
compare(versionBeta2Minor, "=", versionBeta2Minor, 0);
compare(versionBeta2Minor, "<", versionBeta2Major, -1);
compare(versionBeta2Minor, "<", versionBeta2Both, -1);
System.out.println("├────────────────────────────────┤");
}
private void compareBeta2MajorVersion(){
System.out.println("│ Beta Version 2 Major │");
System.out.println("│ │");
compare(versionBeta2Major, ">", baseVersion, 1);
compare(versionBeta2Major, ">", versionMinor, 1);
compare(versionBeta2Major, "<", versionMajor, -1);
compare(versionBeta2Major, "<", versionBoth, -1);
compare(versionBeta2Major, ">", versionBeta, 1);
compare(versionBeta2Major, ">", versionBetaMinor, 1);
compare(versionBeta2Major, ">", versionBetaMajor, 1);
compare(versionBeta2Major, "<", versionBetaBoth, -1);
compare(versionBeta2Major, ">", versionBeta2, 1);
compare(versionBeta2Major, ">", versionBeta2Minor, 1);
compare(versionBeta2Major, "=", versionBeta2Major, 0);
compare(versionBeta2Major, "<", versionBeta2Both, -1);
System.out.println("├────────────────────────────────┤");
}
private void compareBeta2BothVersion(){
System.out.println("│ Beta Version 2 Major + Minor │");
System.out.println("│ │");
compare(versionBeta2Both, ">", baseVersion, 1);
compare(versionBeta2Both, ">", versionMinor, 1);
compare(versionBeta2Both, ">", versionMajor, 1);
compare(versionBeta2Both, "<", versionBoth, -1);
compare(versionBeta2Both, ">", versionBeta, 1);
compare(versionBeta2Both, ">", versionBetaMinor, 1);
compare(versionBeta2Both, ">", versionBetaMajor, 1);
compare(versionBeta2Both, ">", versionBetaBoth, 1);
compare(versionBeta2Both, ">", versionBeta2, 1);
compare(versionBeta2Both, ">", versionBeta2Minor, 1);
compare(versionBeta2Both, ">", versionBeta2Major, 1);
compare(versionBeta2Both, "=", versionBeta2Both, 0);
System.out.println("└────────────────────────────────┘");
}
private void compare(String version1, String comparator, String version2, int expected){
String expression = version1 + " " + comparator + " " + version2 + "?";
System.out.printf("│ %-24s %5b │\n", expression, FlexVerComparator.compare(version1, version2) == expected);
}
}
+78
View File
@@ -0,0 +1,78 @@
# Changelog
This page lists the recent changes made towards the AdvancedServerListAPI.
They are ordered newest to oldest.
## v3.0.0
### :octicons-alert-24:{ .changelog-breaking title="Breaking Changes" } Breaking Changes { #v3-breaking }
- Removed `platform-spigot` API in favour of a more generic sounding `platform-bukkit`
- Renamed all platform-specific packages from `ch.andre601.advancedserverlist.<platform>` to `ch.andre601.advancedserverlist.api.<platform>`
### :octicons-plus-circle-24:{ .changelog-added title="Added" } Added { #v3-added }
- New platform-specific `GenericServer` instances with their own methods to use.
- `BukkitServer` - Contains a `getWorlds()` method that returns a `Map<String, World>` of all loaded worlds in the server.
- `BungeeProxy` - Contains a `getServers()` method that returns a `Map<String, ServerInfo>` of all known Servers for BungeeCord.
- `VelocityProxy` - Contains a `getServers()` method that returns a `Map<String, RegisteredServer>` of all known Servers for Velocity.
### :octicons-trash-24:{ .changelog-removed title="Removed" } Removed { #v-removed }
- All previously deprecated `getX()` methods from the `ProfileEntry` record
## v2.1.0
### :octicons-pencil-24:{ .changelog-changed title="Changed" } Changed { #v2.1.0-changed }
- 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 }
- `platform-paper` has been removed. It used the same code as `platform-spigot` and was therefore considered duplicate code and useless.
- `core` has been removed. The `CachedPlayer` is no longer needed in the platform-specific APIs.
### :octicons-plus-circle-24:{ .changelog-added title="Added" } Added { #v2-added }
- `PreServerListSetEvent` to the different platform-specific APIs.
- Called before AdvancedServerList alters the server list.
- Allows to override the `ProfileEntry` used or even cancel the event.
- `ProfileEntry`
- Used for setting the different values of the server list.
- Own instances can be made using the nested `Builder` class.
- Has methods to create a Builder instance from itself, or make a copy from another ProfileEntry-instance.
### :octicons-pencil-24:{ .changelog-changed title="Changed" } Changed { #v2-changed }
- Converted `GenericPlayer`, `GenericServer`, `BungeePlayer`, `SpigotPlayer` and `VelocityPlayer` into interfaces.
- `GenericPlayer` no longer has `getVersion()`, `hasPlayedBefore()`, `isBanned()` and `isWhitelisted()`. They have been moved to `VelocityPlayer` (Only `getVersion()`) and `SpigotPlayer` respectively.
- Converted `NullBool` from a class to an enum.
- Contains `TRUE`, `FALSE` and `NOT_SET`.
- `isNull()` is now `isNotSet()`.
### :octicons-trash-24:{ .changelog-removed title="Removed" } Removed { #v2-removed }
- `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 }
- `AdvancedServerListAPI`
- Main class used to add your own `PlaceholderProvider` instances.
- `PlaceholderProvider`
- Abstract class used to add your own placeholders to parse in AdvancedServerList.
<!--
Templates for changelog
### :octicons-alert-24:{ .changelog-breaking title="Breaking Changes" } Breaking Changes { #v-breaking }
### :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 }
-->
+153
View File
@@ -0,0 +1,153 @@
# API
AdvancedServerList v2 introduced a new API that plugins can hook into to use.
It provides a way for your plugin to provide its own placeholders that should be parsed by AdvancedServerList and also an event to modify the server list.
## Add dependency
Add the following to your `build.gradle` or `pom.xml` file to use the API:
=== ":simple-gradle: Gradle"
Make sure to replace `{version}` with the latest version available in the [GitHub Repository][api-repo].
```groovy title="build.gradle"
repositorories {
maven { url = 'https://jitpack.io/' }
}
dependencies {
implementation 'ch.andre601.asl-api:api:{version}'
// Optional platform dependencies
implementation 'ch.andre601.asl-api:platform-bungeecord:{version}'
implementation 'ch.andre601.asl-api:platform-spigot:{version}'
implementation 'ch.andre601.asl-api:platform-velocity:{version}'
}
```
=== ":simple-apachemaven: Maven"
Make sure to replace `{version}` with the latest version available in the [GitHub Repository][api-repo].
```xml title="pom.xml"
<repositories>
<repository>
<id>jitpack</id>
<url>https://jitpack.io/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>api</artifactId>
<version>{version}</version>
</dependency>
<!-- Optional platform dependencies -->
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>platform-bungeecord</artifactId>
<version>{version}</version>
</dependency>
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>platform-spigot</artifactId>
<version>{version}</version>
</dependency>
<dependency>
<groupId>ch.andre601.asl-api</groupId>
<artifactId>platform-velocity</artifactId>
<version>{version}</version>
</dependency>
</dependencies>
```
[api-repo]: https://github.com/Andre601/asl-api
## Add own placeholders
To add your own placeholders will you need to do a few steps.
### 1) Get API instance
Use `AdvancedServerListAPI.get()` to retrieve an instance of the currently used AdvancedServerList API.
It will be needed at a later point.
### 2) Create a Placeholder class
Make a new class that you want to use for the placeholders and let it extend the `PlaceholderProvider` class of AdvancedServerList.
Your IDE should now tell you to implement/override some methods. Confirm this action and your class should look something alongside this:
```java title="PlaceholderProvider example"
public class MyPlaceholders extends PlaceholderProvider {
public MyPlaceholders(String identifier) {
super(identifier);
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server) {
return null;
}
}
```
It's recommended to replace your generated constructor with a no-args one and set the identifier directly in the `super()`.
For example:
```java
public MyPlaceholders() {
super("myplaceholders");
}
```
The next step now would be to handle the different placeholders. These are handled in the `parsePlaceholder` method you had to override.
The `placeholder` String is whatever value was provided after the identifier in `${<identifier> <placeholder>}`. It can contain spaces.
Something to note is, that when returning `null` will AdvancedServerList understand it as an invalid placeholder and return it unchanged.
Here is a small example of the final class:
```java title="PlaceholderProvider example"
public class MyPlaceholders extends PlaceholderProvider {
public MyPlaceholders() {
super("myplaceholders");
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server) {
if(placeholder.equals("hello"))
return "Hi!";
return null;
}
}
```
### 3) Register the placeholder class
All that is left to do now is to register your class as a new PlaceholderProvider instance. To do this, get the API instance you retrieved earlier and use `addPlaceholderProvider` with a new instance of your class.
```java title="Registering PlaceholderProvider class"
AdvancedServerListAPI api = AdvancedServerListAPI.get();
api.addPlaceholderProvider(new MyPlaceholders());
```
## Events
!!! info "Note"
The mentioned event is only accessible through one of the platform dependencies, as those are used in the platform's respective event handler system.
v2 of the API adds the `PreServerListSetEvent` to the different platform dependencies to use.
It allows you to modify the ProfileEntry used for the player pinging the server/proxy or even cancelling the event altogether.
### ProfileEntry
The ProfileEntry class has been moved to the API in v2 allowing you to create your own versions using the available Builder class.
This class contains values from a Server List Profile file. The values can either be from a `profiles` list entry, one of the global options in the file, or a mix of both, depending on what options are present.
You can create a new entry or copy an existing one (i.e. from the [`PreServerListSetEvent`](#events)) to modify and use in the server list by setting it in the aforementioned `PreServerListSetEvent`.
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+43
View File
@@ -0,0 +1,43 @@
.md-header__button.md-logo img {
height: 2.5rem;
}
.md-header__button.md-logo {
padding-right: unset;
padding-left: unset;
}
.changelog-added {
color: #2ea043;
}
.changelog-removed {
color: #f85149;
}
.changelog-changed {
color: #1f6feb;
}
.changelog-breaking {
color: #9e6a03
}
.md-banner--warning__icon {
color: #d29922;
}
.result {
border: .05rem solid var(--md-code-bg-color);
border-bottom-left-radius: .1rem;
border-bottom-right-radius: .1rem;
border-top-width: .1rem;
margin-top: -1.125em;
overflow: visible;
padding: 0 1em;
}
/* Override mkdocs-material styling */
.md-banner--warning {
background: rgba(187,128,9,0.15);
}
+28
View File
@@ -0,0 +1,28 @@
# Commands
The plugin adds commands to use for various things related to the plugin itself.
The main command is `/advancedserverlist` but an alias called `/asl` is also registered to use.
## Permissions
The main permission is `advancedserverlist.admin` for all commands, but you can also grant access to specific commands using `advancedserverlist.command.<subcommand>` instead (i.e. `advancedserverlist.command.help` to grant access to [`/asl help`](#help)).
## Subcommands
The following subcommands are available (Subcommands are case-insensitive):
- [`help`](#help)
- [`reload`](#reload)
- [`clearCache`](#clearcache)
### help
Shows a list of all available [subcommands](#subcommands) for AdvancedServerList.
### reload
Reloads the plugin's `config.yml`, all available YAML files in the `profiles` folder and also clears the currently cached favicons and Players.
### clearCache
Clears the currently cached favicons and Players.
+150
View File
@@ -0,0 +1,150 @@
## About
!!! warning "The below examples may only work in v1.10.0 or newer!"
This page lists some examples you may want to use for your proxy or server.
Feel free to suggest additional examples on my [Discord Server](https://discord.gg/6dazXp6) in the `#advancedserverlist` channel.
## Table of Contents
- [Versions](#versions)
- [Different List for outdated Clients](#different-list-for-outdated-clients)
- [Different MOTD for < 1.16](#different-motd-for-116)
- [Spigot/PaperMC](#spigotpapermc)
- [Different profile for banned Player](#different-profile-for-banned-player)
- [Other](#other)
- [Different profile for different host](#different-profile-for-different-host)
- [Different profile for known player](#different-profile-for-known-player)
- [Random MOTD but same hover](#random-motd-but-same-hover)
----
## Versions
Some examples about version-related things.
### Different List for outdated Clients
You may want to display a separate MOTD or text for incompatible client versions.
This example here shows a separate MOTD and player count message for when the player's client version is older than what the server supports.
```yaml title="outdated-client.yml"
priority: 1
# Display this profile, if the version of the player is below 760 (1.19.1)
conditions:
- '${player protocol} < 760'
motd:
- <red>You are using an outdated client!
- <red>Please update to 1.19.1 to join.
playerCount:
text: '<red>Outdated Client!'
```
### Different MOTD for < 1.16
This profile would display a MOTD without HEX colours if the player's version is below 735 (1.16).
```yaml title="pre-1_16.yml"
priority: 1
# Display this profile, if the version of the player is below 735 (1.16)
conditions:
- '${player protocol} < 735'
motd:
- <grey>Welcome to <aqua>YourServer.com</aqua>!
- <grey>Enjoy your stay.
```
----
## Spigot/PaperMC
Examples that can be used with the Spigot or PaperMC version.
### Different profile for banned Player
!!! warning "Requires a cached player to work reliably."
Displays a separate profile for when the player has been banned from the server.
```yaml title="banned.yml"
priority: 1
conditions:
- '${player isBanned} = true'
motd:
- <red>You have been <bold>BANNED</bold>!
- <red>Go away.
# Don't show the player count to the banned player.
playerCount:
hidePlayers: true
```
----
## Other
Some misc examples.
### Different profile for different host
Display a different profile when the playing pings a specific domain/IP.
```yaml title="specific-host.yml"
priority: 1
conditions:
- '${server host} = other.example.com'
motd:
- <grey>Please use <aqua>mc.example.com
- <grey>to join our server.
```
### Different profile for known player
Display a different profile, if the player pinging the server is "known" by AdvancedServerList (Has joined before with the same IP).
```yaml title="personalized.yml"
priority: 1
conditions:
- `${player name} != Anonymous` # "Anonymous" should be replaced with whatever you use in 'unknown_player'
motd:
- <grey>Hello there <aqua>${player name}</aqua>!
- <grey>It's nice to see you again.
playerCount:
hover:
- '<grey>Welcome back <aqua>${player name}</aqua>!'
- '<grey>'
- '<grey>Come and join <aqua>${server playersOnline}'
- '<aqua>other players</aqua> <grey>on the Server!'
```
### Random MOTD but same hover
v1.10.0 of AdvancedServerList introduced an option called `profiles`. It allows you to create multiple variants of an MOTD, playercount, etc. while also supporting the normal (global) options as a fallback.
The following example will create a profile that has a randomized MOTD, but the same hover for both:
```yaml title="random-motd.yml"
priority: 1
profiles:
- motd:
- 'A randomized MOTD.'
- 'Lines change, but hover is the same.'
- motd: ['Different Syntax.', 'May be more readable.']
playerCount:
hover:
- 'This player count hover always'
- 'stays the same, no matter what'
- 'MOTD is being used here.'
```
Loaded 100 of 130 files, more files were not shown because too many files have changed in this diff. Show more