1
mirror of https://github.com/CarmJos/MineConfiguration.git synced 2026-06-04 21:58:16 +08:00

Compare commits

...

248 Commits

Author SHA1 Message Date
dependabot[bot] 6944210ed4 chore(deps-dev): bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.4 to 3.5.5.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.4...surefire-3.5.5)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-version: 3.5.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-10 08:05:57 +08:00
renovate[bot] c159be5bd1 chore(deps): update actions/upload-artifact action to v7 2026-03-10 08:05:50 +08:00
dependabot[bot] 0b1866e59e chore(deps-dev): bump org.apache.maven.plugins:maven-shade-plugin
Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.6.1 to 3.6.2.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.6.1...maven-shade-plugin-3.6.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-10 08:05:28 +08:00
renovate[bot] a3bcf78ff1 chore(deps): update actions/upload-artifact action to v6 2026-02-21 00:58:06 +08:00
dependabot[bot] f4b7dd99c8 chore(deps): bump org.apache.maven.plugins:maven-release-plugin
Bumps [org.apache.maven.plugins:maven-release-plugin](https://github.com/apache/maven-release) from 3.2.0 to 3.3.1.
- [Release notes](https://github.com/apache/maven-release/releases)
- [Commits](https://github.com/apache/maven-release/compare/maven-release-3.2.0...maven-release-3.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-21 00:57:52 +08:00
dependabot[bot] 8828421632 chore(deps): bump com.github.cryptomorin:XSeries from 13.5.1 to 13.6.0
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 13.5.1 to 13.6.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v13.5.1...v13.6.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-version: 13.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-21 00:57:45 +08:00
dependabot[bot] b253658bd9 chore(deps): bump deps.adventure.version from 4.25.0 to 4.26.1
Bumps `deps.adventure.version` from 4.25.0 to 4.26.1.

Updates `net.kyori:adventure-api` from 4.25.0 to 4.26.1
- [Release notes](https://github.com/PaperMC/adventure/releases)
- [Commits](https://github.com/PaperMC/adventure/compare/v4.25.0...v4.26.1)

Updates `net.kyori:adventure-text-serializer-legacy` from 4.25.0 to 4.26.1
- [Release notes](https://github.com/PaperMC/adventure/releases)
- [Commits](https://github.com/PaperMC/adventure/compare/v4.25.0...v4.26.1)

Updates `net.kyori:adventure-text-serializer-plain` from 4.25.0 to 4.26.1
- [Release notes](https://github.com/PaperMC/adventure/releases)
- [Commits](https://github.com/PaperMC/adventure/compare/v4.25.0...v4.26.1)

Updates `net.kyori:adventure-text-minimessage` from 4.25.0 to 4.26.1
- [Release notes](https://github.com/PaperMC/adventure/releases)
- [Commits](https://github.com/PaperMC/adventure/compare/v4.25.0...v4.26.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-21 00:57:30 +08:00
dependabot[bot] 17ba07b2a8 chore(deps): bump org.sonatype.central:central-publishing-maven-plugin
Bumps [org.sonatype.central:central-publishing-maven-plugin](https://github.com/sonatype/central-publishing-maven-plugin) from 0.9.0 to 0.10.0.
- [Commits](https://github.com/sonatype/central-publishing-maven-plugin/commits)

---
updated-dependencies:
- dependency-name: org.sonatype.central:central-publishing-maven-plugin
  dependency-version: 0.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-21 00:57:16 +08:00
dependabot[bot] 7da7704065 chore(deps-dev): bump org.apache.maven.plugins:maven-compiler-plugin
Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.14.1 to 3.15.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.14.1...maven-compiler-plugin-3.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-21 00:57:03 +08:00
renovate[bot] 7aa9f02c87 fix(deps): update dependency org.jetbrains:annotations to v26.1.0 2026-02-21 00:56:56 +08:00
renovate[bot] 136e16ed59 chore(deps): update actions/upload-artifact action to v5 2025-12-01 09:32:34 +08:00
dependabot[bot] 4e5405304c chore(deps): bump org.apache.maven.plugins:maven-release-plugin
Bumps [org.apache.maven.plugins:maven-release-plugin](https://github.com/apache/maven-release) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/apache/maven-release/releases)
- [Commits](https://github.com/apache/maven-release/compare/maven-release-3.1.1...maven-release-3.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 09:32:20 +08:00
renovate[bot] 4c309fd7e1 chore(deps): update codacy/codacy-analysis-cli-action digest to 30783d0 2025-12-01 09:32:14 +08:00
dependabot[bot] 9e9c49032f chore(deps): bump org.apache.maven.plugins:maven-jar-plugin
Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.4.2 to 3.5.0.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.4.2...maven-jar-plugin-3.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 09:32:01 +08:00
renovate[bot] 0a4191666e chore(deps): update actions/checkout action to v6 2025-12-01 09:31:55 +08:00
renovate[bot] 043c6166fc chore(deps): update dependency org.apache.maven.plugins:maven-source-plugin to v3.4.0 2025-12-01 09:31:49 +08:00
renovate[bot] 2e4021a13e fix(deps): update dependency net.md-5:bungeecord-api to v1.21-r0.4 2025-10-23 10:37:49 +08:00
dependabot[bot] 4b69661562 chore(deps): bump deps.configured.version from 4.1.7 to 4.2.0
Bumps `deps.configured.version` from 4.1.7 to 4.2.0.

Updates `cc.carm.lib:configured-core` from 4.1.7 to 4.2.0
- [Release notes](https://github.com/CarmJos/configured/releases)
- [Commits](https://github.com/CarmJos/configured/compare/4.1.7...4.2.0)

Updates `cc.carm.lib:configured-feature-commentable` from 4.1.7 to 4.2.0
- [Release notes](https://github.com/CarmJos/configured/releases)
- [Commits](https://github.com/CarmJos/configured/compare/4.1.7...4.2.0)

Updates `cc.carm.lib:configured-feature-file` from 4.1.7 to 4.2.0
- [Release notes](https://github.com/CarmJos/configured/releases)
- [Commits](https://github.com/CarmJos/configured/compare/4.1.7...4.2.0)

Updates `cc.carm.lib:configured-feature-text` from 4.1.7 to 4.2.0
- [Release notes](https://github.com/CarmJos/configured/releases)
- [Commits](https://github.com/CarmJos/configured/compare/4.1.7...4.2.0)

Updates `cc.carm.lib:configured-yaml` from 4.1.7 to 4.2.0
- [Release notes](https://github.com/CarmJos/configured/releases)
- [Commits](https://github.com/CarmJos/configured/compare/4.1.7...4.2.0)

---
updated-dependencies:
- dependency-name: cc.carm.lib:configured-core
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: cc.carm.lib:configured-feature-commentable
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: cc.carm.lib:configured-feature-file
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: cc.carm.lib:configured-feature-text
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: cc.carm.lib:configured-yaml
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-23 10:37:37 +08:00
dependabot[bot] d81a2ecf99 chore(deps): bump net.md-5:bungeecord-chat
Bumps [net.md-5:bungeecord-chat](https://github.com/SpigotMC/BungeeCord) from 1.21-R0.3-deprecated+build.22 to 1.21-R0.4.
- [Commits](https://github.com/SpigotMC/BungeeCord/commits)

---
updated-dependencies:
- dependency-name: net.md-5:bungeecord-chat
  dependency-version: 1.21-R0.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-23 10:37:31 +08:00
dependabot[bot] a5d564c40c chore(deps): bump deps.adventure.version from 4.24.0 to 4.25.0
Bumps `deps.adventure.version` from 4.24.0 to 4.25.0.

Updates `net.kyori:adventure-api` from 4.24.0 to 4.25.0
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.24.0...v4.25.0)

Updates `net.kyori:adventure-text-serializer-legacy` from 4.24.0 to 4.25.0
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.24.0...v4.25.0)

Updates `net.kyori:adventure-text-serializer-plain` from 4.24.0 to 4.25.0
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.24.0...v4.25.0)

Updates `net.kyori:adventure-text-minimessage` from 4.24.0 to 4.25.0
- [Release notes](https://github.com/KyoriPowered/adventure/releases)
- [Commits](https://github.com/KyoriPowered/adventure/compare/v4.24.0...v4.25.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-23 10:37:13 +08:00
renovate[bot] 30e1e440ef chore(deps): update github/codeql-action action to v4 2025-10-23 10:37:07 +08:00
dependabot[bot] e28501e63a chore(deps): bump com.github.cryptomorin:XSeries from 13.4.0 to 13.5.1
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 13.4.0 to 13.5.1.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v13.4.0...v13.5.1)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-version: 13.5.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-23 10:37:00 +08:00
carm b7f9add038 feat: Bump to 3.1.4 2025-09-24 11:11:04 +08:00
renovate[bot] d4b06fe7e6 fix(deps): update dependency net.md-5:bungeecord-chat to v1.21-r0.3-deprecated+build.22 2025-09-24 11:10:33 +08:00
carm 2b68387e7b chore(platform): Make "velocity" to "adventure". 2025-09-24 11:06:13 +08:00
carm 804639d6a0 chore(platform): Make "velocity" to "adventure". 2025-09-24 10:53:40 +08:00
carm ee47be4842 chore(platform): Make "velocity" to "adventure". 2025-09-24 10:41:23 +08:00
dependabot[bot] 63eabb955c chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.11.3 to 3.12.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.11.3...maven-javadoc-plugin-3.12.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-24 09:19:45 +08:00
dependabot[bot] 35b4726c82 chore(deps): bump org.apache.maven.plugins:maven-compiler-plugin
Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.14.0 to 3.14.1.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.14.0...maven-compiler-plugin-3.14.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-24 09:19:40 +08:00
dependabot[bot] ca47d2b3a8 chore(deps): bump org.sonatype.central:central-publishing-maven-plugin
Bumps [org.sonatype.central:central-publishing-maven-plugin](https://github.com/sonatype/central-publishing-maven-plugin) from 0.8.0 to 0.9.0.
- [Commits](https://github.com/sonatype/central-publishing-maven-plugin/commits)

---
updated-dependencies:
- dependency-name: org.sonatype.central:central-publishing-maven-plugin
  dependency-version: 0.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-24 09:19:27 +08:00
renovate[bot] 75279de348 chore(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.6.1 2025-09-14 16:56:53 +08:00
renovate[bot] 3cb0eac566 chore(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.5.4 2025-09-14 16:56:47 +08:00
renovate[bot] 60aa5ccb1f fix(deps): update dependency com.github.cryptomorin:xseries to v13.4.0 2025-09-14 16:56:41 +08:00
renovate[bot] 19286850fa fix(deps): update dependency org.jetbrains:annotations to v26.0.2-1 2025-09-06 10:08:57 +08:00
dependabot[bot] 6e755ee48e chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin
Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.7 to 3.2.8.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.7...maven-gpg-plugin-3.2.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 23:44:16 +08:00
dependabot[bot] f0f4de7d93 chore(deps): bump com.github.cryptomorin:XSeries from 13.3.1 to 13.3.3
---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-version: 13.3.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 23:44:09 +08:00
renovate[bot] c0045a8ab0 chore(deps): update codacy/codacy-analysis-cli-action digest to d28ce58 2025-08-21 23:44:03 +08:00
dependabot[bot] 2c2adeadad chore(deps): bump deps.configured.version from 4.1.5 to 4.1.7
Bumps `deps.configured.version` from 4.1.5 to 4.1.7.

Updates `cc.carm.lib:configured-core` from 4.1.5 to 4.1.7
- [Release notes](https://github.com/CarmJos/configured/releases)
- [Commits](https://github.com/CarmJos/configured/compare/4.1.5...4.1.7)

Updates `cc.carm.lib:configured-feature-commentable` from 4.1.5 to 4.1.7
- [Release notes](https://github.com/CarmJos/configured/releases)
- [Commits](https://github.com/CarmJos/configured/compare/4.1.5...4.1.7)

Updates `cc.carm.lib:configured-feature-file` from 4.1.5 to 4.1.7
- [Release notes](https://github.com/CarmJos/configured/releases)
- [Commits](https://github.com/CarmJos/configured/compare/4.1.5...4.1.7)

Updates `cc.carm.lib:configured-feature-text` from 4.1.5 to 4.1.7
- [Release notes](https://github.com/CarmJos/configured/releases)
- [Commits](https://github.com/CarmJos/configured/compare/4.1.5...4.1.7)

Updates `cc.carm.lib:configured-yaml` from 4.1.5 to 4.1.7
- [Release notes](https://github.com/CarmJos/configured/releases)
- [Commits](https://github.com/CarmJos/configured/compare/4.1.5...4.1.7)

---
updated-dependencies:
- dependency-name: cc.carm.lib:configured-core
  dependency-version: 4.1.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: cc.carm.lib:configured-feature-commentable
  dependency-version: 4.1.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: cc.carm.lib:configured-feature-file
  dependency-version: 4.1.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: cc.carm.lib:configured-feature-text
  dependency-version: 4.1.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: cc.carm.lib:configured-yaml
  dependency-version: 4.1.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 23:43:46 +08:00
renovate[bot] 30bb6c18ee fix(deps): update dependency net.md-5:bungeecord-chat to v1.21-r0.3-deprecated+build.22 2025-08-21 23:43:39 +08:00
renovate[bot] eb5d7351f1 chore(deps): update actions/checkout action to v5 2025-08-21 23:43:30 +08:00
dependabot[bot] 5a58277722 chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.11.2 to 3.11.3.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.11.2...maven-javadoc-plugin-3.11.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 23:43:14 +08:00
renovate[bot] dda8bc5e7a chore(deps): update actions/setup-java action to v5 2025-08-21 23:43:08 +08:00
renovate[bot] 5d956cd6f6 fix(deps): update dependency net.md-5:bungeecord-api to v1.21-r0.3 2025-06-25 06:29:50 +08:00
dependabot[bot] 366aa372d9 chore(deps): bump net.md-5:bungeecord-chat from 1.21-R0.2 to 1.21-R0.3
Bumps [net.md-5:bungeecord-chat](https://github.com/SpigotMC/BungeeCord) from 1.21-R0.2 to 1.21-R0.3.
- [Commits](https://github.com/SpigotMC/BungeeCord/commits)

---
updated-dependencies:
- dependency-name: net.md-5:bungeecord-chat
  dependency-version: 1.21-R0.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-25 06:29:38 +08:00
dependabot[bot] 2a9c7d4ec5 chore(deps): bump org.sonatype.central:central-publishing-maven-plugin
Bumps [org.sonatype.central:central-publishing-maven-plugin](https://github.com/sonatype/central-publishing-maven-plugin) from 0.7.0 to 0.8.0.
- [Commits](https://github.com/sonatype/central-publishing-maven-plugin/commits)

---
updated-dependencies:
- dependency-name: org.sonatype.central:central-publishing-maven-plugin
  dependency-version: 0.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-25 06:29:26 +08:00
dependabot[bot] 390552efed chore(deps): bump com.github.cryptomorin:XSeries from 13.3.0 to 13.3.1
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 13.3.0 to 13.3.1.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v13.3.0...v13.3.1)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-version: 13.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-04 13:04:16 +08:00
dependabot[bot] 6eafb82ce5 chore(deps): bump cc.carm.lib:easyplugin-color from 1.5.12 to 1.5.13
Bumps [cc.carm.lib:easyplugin-color](https://github.com/CarmJos/EasyPlugin) from 1.5.12 to 1.5.13.
- [Release notes](https://github.com/CarmJos/EasyPlugin/releases)
- [Commits](https://github.com/CarmJos/EasyPlugin/compare/1.5.12...1.5.13)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyplugin-color
  dependency-version: 1.5.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-02 15:05:17 +08:00
dependabot[bot] 1ee6474c0e chore(deps): bump com.github.cryptomorin:XSeries from 13.2.0 to 13.3.0
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 13.2.0 to 13.3.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v13.2.0...v13.3.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-version: 13.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-02 15:05:06 +08:00
carm b26d3ae52c docs: Drop visitors counter 2025-05-14 04:27:01 +08:00
carm 8d972612e4 feat: Updated to 3.1.3 2025-05-14 04:26:40 +08:00
carm 76d22520b9 feat: Updated to 3.1.3 2025-05-14 03:30:11 +08:00
carm d8f5615f2d feat: Updated to 3.1.3 2025-05-14 03:19:44 +08:00
renovate[bot] ac279f71c0 fix(deps): update deps.configured.version to v4.1.4 2025-05-14 03:16:58 +08:00
carm 0c1026f37e feat: Updated to 3.1.2 2025-05-14 02:51:03 +08:00
carm 112e34e1b4 feat: Updated to 3.1.2 2025-05-14 02:49:35 +08:00
renovate[bot] ce4ceaef73 chore(deps): update dependency junit:junit to v4.14-20200802.183205-9 2025-05-14 02:48:12 +08:00
renovate[bot] 10ad1c8fcd fix(deps): update dependency net.md-5:bungeecord-api to v1.21-r0.2 2025-04-18 10:56:13 +08:00
dependabot[bot] abdbd88946 chore(deps): bump net.md-5:bungeecord-chat
Bumps [net.md-5:bungeecord-chat](https://github.com/SpigotMC/BungeeCord) from 1.20-R0.2-deprecated+build.19 to 1.21-R0.2.
- [Commits](https://github.com/SpigotMC/BungeeCord/commits)

---
updated-dependencies:
- dependency-name: net.md-5:bungeecord-chat
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 10:56:06 +08:00
dependabot[bot] 517b661a13 chore(deps): bump com.github.cryptomorin:XSeries from 13.1.0 to 13.2.0
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 13.1.0 to 13.2.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v13.1.0...v13.2.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-version: 13.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 10:55:50 +08:00
dependabot[bot] 4ddd2a3454 chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.2...surefire-3.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 10:55:45 +08:00
carm 50f7eb31bb chore: Remove "resourcesPath" by default. 2025-03-29 03:09:36 +08:00
carm e44e74a512 feat(deps): Update with EasyConfiguration 2025-03-21 03:39:46 +08:00
carm 051049eee2 feat(deps): Update with EasyConfiguration 2025-03-21 02:39:46 +08:00
renovate[bot] c4010bb642 fix(deps): update dependency com.github.cryptomorin:xseries to v13.1.0 2025-03-17 03:28:19 +08:00
carm 420eb93366 feat(deps): Update with EasyConfiguration 2025-03-17 03:26:32 +08:00
dependabot[bot] b346fc7600 chore(deps): bump deps.easyconfifuration.version from 4.0.10 to 4.0.11
Bumps `deps.easyconfifuration.version` from 4.0.10 to 4.0.11.

Updates `cc.carm.lib:easyconfiguration-core` from 4.0.10 to 4.0.11
- [Release notes](https://github.com/CarmJos/EasyConfiguration/releases)
- [Commits](https://github.com/CarmJos/EasyConfiguration/compare/4.0.10...4.0.11)

Updates `cc.carm.lib:easyconfiguration-feature-commentable` from 4.0.10 to 4.0.11

Updates `cc.carm.lib:easyconfiguration-feature-file` from 4.0.10 to 4.0.11

Updates `cc.carm.lib:easyconfiguration-feature-text` from 4.0.10 to 4.0.11

Updates `cc.carm.lib:easyconfiguration-yaml` from 4.0.10 to 4.0.11

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyconfiguration-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: cc.carm.lib:easyconfiguration-feature-commentable
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: cc.carm.lib:easyconfiguration-feature-file
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: cc.carm.lib:easyconfiguration-feature-text
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: cc.carm.lib:easyconfiguration-yaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-12 04:38:29 +08:00
carm f354258593 feat(deps): Update with EasyConfiguration 2025-03-04 02:07:59 +08:00
carm e859722a85 feat(deps): Update with EasyConfiguration 2025-03-04 01:41:37 +08:00
carm adf26baf59 ci(deploy): Cancel javadoc deployment 2025-02-25 01:44:28 +08:00
carm 3d814baa8f build(deps): Update with EasyConfiguration 2025-02-25 01:43:30 +08:00
dependabot[bot] c5c93d836f chore(deps): bump org.apache.maven.plugins:maven-compiler-plugin
Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.13.0 to 3.14.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.13.0...maven-compiler-plugin-3.14.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>
2025-02-22 10:21:42 +08:00
carm 7820b14344 build(deps): Update with EasyConfiguration 2025-02-22 10:20:34 +08:00
carm 3a1ad7f9ce build(deps): Update repo 2025-02-20 00:37:27 +08:00
carm adbc393ee9 build(deps): Update repo 2025-02-20 00:30:11 +08:00
carm 2b5b62c979 build(deps): Update repo 2025-02-20 00:28:42 +08:00
carm bb84f593e4 build(deps): Update repo 2025-02-20 00:20:43 +08:00
carm 96804f83ba ci: Update ci 2025-02-20 00:13:45 +08:00
carm a7b1c06c8f chore(deps): Update EasyConfiguration 2025-02-20 00:08:55 +08:00
carm 180ccc5046 chore(deps): Update EasyConfiguration 2025-02-20 00:07:31 +08:00
carm bab34b840f chore: Move repository to parents 2025-02-19 00:53:35 +08:00
carm bba135e911 feat!(conf): Upgraded to latest EasyConfiguration with optimized. 2025-02-17 18:45:42 +08:00
renovate[bot] 87799d2c70 fix(deps): update dependency org.jetbrains:annotations to v26.0.2 2025-01-23 22:51:12 +08:00
renovate[bot] b601b4433d chore(deps): update github/codeql-action action to v3 2025-01-18 13:20:43 +08:00
renovate[bot] 5ffb734f22 chore(deps): update actions/setup-java action to v4 2025-01-18 04:04:45 +08:00
renovate[bot] d697a268b4 chore(deps): update actions/upload-artifact action to v4 2025-01-18 04:04:42 +08:00
renovate[bot] bcd6a9c0d0 fix(deps): update dependency net.md-5:bungeecord-api to v1.20-r0.2 2025-01-18 04:04:00 +08:00
renovate[bot] 6b6710fe8f chore(deps): update actions/checkout action to v4 2025-01-18 04:03:56 +08:00
renovate[bot] 44d3fb16cf chore(deps): update codacy/codacy-analysis-cli-action digest to 0991600 2025-01-18 03:53:53 +08:00
renovate[bot] ffd18557e1 chore(deps): update dependency net.md-5:bungeecord-chat to v1.20-r0.2-deprecated+build.19 2025-01-18 03:53:51 +08:00
renovate[bot] 249ca790e4 Add renovate.json 2025-01-18 03:38:43 +08:00
dependabot[bot] 4b6ff606b2 chore(deps): bump com.github.cryptomorin:XSeries from 12.1.0 to 13.0.0
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 12.1.0 to 13.0.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v12.1.0...v13.0.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-17 06:45:57 +08:00
dependabot[bot] 7795f66744 chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.1...surefire-3.5.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-11 02:19:22 +08:00
dependabot[bot] ded6c53924 chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.11.1 to 3.11.2.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.11.1...maven-javadoc-plugin-3.11.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-11 02:19:04 +08:00
carm 154f536768 chore(platform): Try to support Velocity 2024-12-28 00:25:52 +08:00
dependabot[bot] a46dbfae3d chore(deps): bump com.github.cryptomorin:XSeries from 11.3.0 to 12.1.0
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 11.3.0 to 12.1.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v11.3.0...v12.1.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 00:01:55 +08:00
dependabot[bot] 2291375276 chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.10.1 to 3.11.1.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.10.1...maven-javadoc-plugin-3.11.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-25 02:29:54 +08:00
dependabot[bot] 9d835fd83d chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin
Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.6 to 3.2.7.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.6...maven-gpg-plugin-3.2.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-23 16:43:15 +08:00
dependabot[bot] 1999d9a9f9 chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.10.0 to 3.10.1.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.10.0...maven-javadoc-plugin-3.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-23 16:39:18 +08:00
dependabot[bot] 11051cdf34 chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.0...surefire-3.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-23 16:21:15 +08:00
dependabot[bot] 9b015a4427 chore(deps): bump org.jetbrains:annotations from 25.0.0 to 26.0.1
Bumps [org.jetbrains:annotations](https://github.com/JetBrains/java-annotations) from 25.0.0 to 26.0.1.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/25.0.0...26.0.1)

---
updated-dependencies:
- dependency-name: org.jetbrains:annotations
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-23 16:20:29 +08:00
dependabot[bot] 204f3b012b chore(deps): bump com.github.cryptomorin:XSeries from 11.2.2 to 11.3.0
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 11.2.2 to 11.3.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v11.2.2...v11.3.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-28 23:45:01 +08:00
dependabot[bot] 4c3ee212c8 chore(deps): bump org.jetbrains:annotations from 24.1.0 to 25.0.0
Bumps [org.jetbrains:annotations](https://github.com/JetBrains/java-annotations) from 24.1.0 to 25.0.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/24.1.0...25.0.0)

---
updated-dependencies:
- dependency-name: org.jetbrains:annotations
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-27 21:22:45 +08:00
dependabot[bot] cf3b65a413 chore(deps): bump com.github.cryptomorin:XSeries from 11.2.1 to 11.2.2
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 11.2.1 to 11.2.2.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v11.2.1...v11.2.2)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-21 21:38:32 +08:00
dependabot[bot] d2d45fb7aa chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin
Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.5 to 3.2.6.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.5...maven-gpg-plugin-3.2.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-17 23:50:32 +08:00
dependabot[bot] 127183ec47 chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin
Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.4...maven-gpg-plugin-3.2.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-14 22:50:06 +08:00
dependabot[bot] afe3e5199b chore(deps): bump com.github.cryptomorin:XSeries from 11.2.0.1 to 11.2.1
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 11.2.0.1 to 11.2.1.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v11.2.0.1...v11.2.1)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-14 22:49:59 +08:00
dependabot[bot] 8fa807053d chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.8.0 to 3.10.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.8.0...maven-javadoc-plugin-3.10.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-14 22:48:32 +08:00
dependabot[bot] 9200f4f220 chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.3.1 to 3.5.0.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.3.1...surefire-3.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-11 15:25:20 +08:00
dependabot[bot] 0a60497be8 chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.7.0 to 3.8.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.7.0...maven-javadoc-plugin-3.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-31 07:29:12 +08:00
dependabot[bot] 1a8979d18c chore(deps): bump org.apache.maven.plugins:maven-release-plugin (#91) 2024-07-16 23:00:45 +00:00
dependabot[bot] 9c08be7660 chore(deps): bump com.github.cryptomorin:XSeries from 11.2.0 to 11.2.0.1
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 11.2.0 to 11.2.0.1.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v11.2.0...v11.2.0.1)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-17 06:43:37 +08:00
dependabot[bot] 6bbf32515d chore(deps): bump com.github.cryptomorin:XSeries from 11.1.0 to 11.2.0
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 11.1.0 to 11.2.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v11.1.0...v11.2.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-12 00:41:15 +08:00
dependabot[bot] 3538ae557b chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.5 to 3.3.1.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.5...surefire-3.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-12 00:41:07 +08:00
dependabot[bot] cd4394ed68 chore(deps): bump org.apache.maven.plugins:maven-jar-plugin
Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.4.1 to 3.4.2.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.4.1...maven-jar-plugin-3.4.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-12 00:14:48 +08:00
dependabot[bot] 2a28415e48 chore(deps): bump org.apache.maven.plugins:maven-release-plugin
Bumps [org.apache.maven.plugins:maven-release-plugin](https://github.com/apache/maven-release) from 3.0.1 to 3.1.0.
- [Release notes](https://github.com/apache/maven-release/releases)
- [Commits](https://github.com/apache/maven-release/compare/maven-release-3.0.1...maven-release-3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-24 11:32:55 +08:00
dependabot[bot] 191702c5ef chore(deps): bump com.github.cryptomorin:XSeries from 10.0.0 to 11.1.0
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 10.0.0 to 11.1.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v10.0.0...v11.1.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-21 11:26:29 +08:00
dependabot[bot] ea39874d6c chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.3 to 3.7.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.3...maven-javadoc-plugin-3.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-04 12:20:59 +08:00
dependabot[bot] feccc6f284 chore(deps): bump org.apache.maven.plugins:maven-shade-plugin
Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.5.3 to 3.6.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.5.3...maven-shade-plugin-3.6.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>
2024-06-04 12:20:50 +08:00
dependabot[bot] d76685c7c1 chore(deps): bump me.clip:placeholderapi from 2.11.5 to 2.11.6
Bumps me.clip:placeholderapi from 2.11.5 to 2.11.6.

---
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>
2024-06-04 09:40:38 +08:00
dependabot[bot] 524e3849e8 chore(deps): bump com.github.cryptomorin:XSeries from 9.10.0 to 10.0.0
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 9.10.0 to 10.0.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v9.10.0...v10.0.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-21 00:36:44 +08:00
dependabot[bot] 919ec4eefd chore(deps): bump org.apache.maven.plugins:maven-jar-plugin
Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.4.0...maven-jar-plugin-3.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-25 08:51:00 +08:00
dependabot[bot] 1a198abf9f chore(deps): bump org.apache.maven.plugins:maven-shade-plugin
Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.5.2...maven-shade-plugin-3.5.3)

---
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>
2024-04-25 08:50:50 +08:00
dependabot[bot] c4b7eed949 chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin
Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.3...maven-gpg-plugin-3.2.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-20 15:16:57 +08:00
dependabot[bot] 56183172a4 chore(deps): bump org.apache.maven.plugins:maven-source-plugin
Bumps [org.apache.maven.plugins:maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.3.0 to 3.3.1.
- [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.3.0...maven-source-plugin-3.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-16 16:10:59 +08:00
dependabot[bot] 0b4ade5370 chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin
Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.2...maven-gpg-plugin-3.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-16 16:10:49 +08:00
dependabot[bot] 59d97bf40d chore(deps): bump org.apache.maven.plugins:maven-jar-plugin
Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.3.0...maven-jar-plugin-3.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-16 16:10:37 +08:00
dependabot[bot] 9093bb8a6d chore(deps): bump com.github.cryptomorin:XSeries from 9.9.0 to 9.10.0 (#73)
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 9.9.0 to 9.10.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v9.9.0...v9.10.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 11:47:04 +08:00
dependabot[bot] dde394559c chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin (#71)
Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.1...maven-gpg-plugin-3.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-27 14:29:40 +08:00
dependabot[bot] b1e2bcb4c9 chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin (#69)
Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.0...maven-gpg-plugin-3.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 20:11:33 +08:00
dependabot[bot] a9bcf7ffc9 chore(deps): bump org.apache.maven.plugins:maven-compiler-plugin (#70)
Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.1 to 3.13.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.1...maven-compiler-plugin-3.13.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 20:10:59 +08:00
dependabot[bot] 1f9af2c22c chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin (#68)
Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.1.0...maven-gpg-plugin-3.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 09:34:21 +08:00
dependabot[bot] 653a3f761c chore(deps): bump org.apache.maven.plugins:maven-shade-plugin (#67)
Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.5.1...maven-shade-plugin-3.5.2)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-21 17:54:43 +08:00
dependabot[bot] 05a9dccbaa chore(deps): bump cc.carm.lib:easyplugin-color from 1.5.11 to 1.5.12 (#66)
Bumps [cc.carm.lib:easyplugin-color](https://github.com/CarmJos/EasyPlugin) from 1.5.11 to 1.5.12.
- [Release notes](https://github.com/CarmJos/EasyPlugin/releases)
- [Commits](https://github.com/CarmJos/EasyPlugin/compare/1.5.11...1.5.12)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyplugin-color
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-08 15:47:20 +08:00
dependabot[bot] e6ab328ac4 chore(deps): bump com.github.cryptomorin:XSeries from 9.8.1 to 9.9.0 (#65)
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 9.8.1 to 9.9.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v9.8.1...v9.9.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 13:38:30 +08:00
dependabot[bot] 91f65cc08b chore(deps): bump net.md-5:bungeecord-chat from 1.20-R0.1 to 1.20-R0.2 (#64)
Bumps [net.md-5:bungeecord-chat](https://github.com/SpigotMC/BungeeCord) from 1.20-R0.1 to 1.20-R0.2.
- [Commits](https://github.com/SpigotMC/BungeeCord/commits)

---
updated-dependencies:
- dependency-name: net.md-5:bungeecord-chat
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-20 16:09:28 +08:00
dependabot[bot] 7d4d716724 chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin (#63)
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.3 to 3.2.5.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.3...surefire-3.2.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-11 22:34:31 +08:00
carm 7ecfff5bc4 fix(debug): 移除多余的debug消息。 2024-01-09 18:10:08 +08:00
carm 1cebe8daca chore(create): 更新整合类的初始化方法 2024-01-09 17:05:57 +08:00
dependabot[bot] 49df2ca24e chore(deps): bump com.github.cryptomorin:XSeries from 9.8.0 to 9.8.1 (#62)
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 9.8.0 to 9.8.1.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v9.8.0...v9.8.1)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 14:01:18 +08:00
dependabot[bot] 6e1803fb75 chore(deps): bump org.apache.maven.plugins:maven-compiler-plugin (#61)
Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.0 to 3.12.1.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.0...maven-compiler-plugin-3.12.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-26 10:31:04 +08:00
carm 480f015a2f chore(create): 更新整合类的初始化方法 2023-12-25 04:02:49 +08:00
carm bf5c6a2fce feat(notify): 尝试实现整合的消息配置 #39 2023-12-25 03:40:33 +08:00
carm f86229037d feat(notify): 尝试实现整合的消息配置 #39 2023-12-25 02:38:43 +08:00
carm 38292052f5 feat(notify): 尝试实现整合的消息配置 #39 2023-12-25 02:33:37 +08:00
dependabot[bot] b737e4dda2 chore(deps): bump cc.carm.lib:easyconfiguration-core from 3.8.0 to 3.8.1 (#60)
Bumps [cc.carm.lib:easyconfiguration-core](https://github.com/CarmJos/EasyConfiguration) from 3.8.0 to 3.8.1.
- [Release notes](https://github.com/CarmJos/EasyConfiguration/releases)
- [Commits](https://github.com/CarmJos/EasyConfiguration/compare/3.8.0...3.8.1)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyconfiguration-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-23 23:05:28 +08:00
dependabot[bot] 058da094cd chore(deps): bump org.apache.maven.plugins:maven-compiler-plugin (#59)
Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.11.0 to 3.12.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.11.0...maven-compiler-plugin-3.12.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-19 08:20:43 +08:00
dependabot[bot] 020adeb030 chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin (#58)
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.2...surefire-3.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-15 18:17:22 +08:00
dependabot[bot] 3183e1025d chore(deps): bump com.github.cryptomorin:XSeries from 9.7.0 to 9.8.0 (#57)
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 9.7.0 to 9.8.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v9.7.0...v9.8.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 00:36:18 +08:00
dependabot[bot] 3c57b97fb1 chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin (#56)
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.2 to 3.6.3.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.2...maven-javadoc-plugin-3.6.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-05 08:13:21 +08:00
carm c77253508c feat(item): 令插入的行支持ConfiguredMessage的解析方法 2023-11-21 23:51:05 +08:00
carm 56ee1ec991 Merge remote-tracking branch 'origin/master' 2023-11-21 23:50:39 +08:00
carm 706db18ffe feat(item): 令插入的行支持ConfiguredMessage的解析方法 2023-11-21 23:50:29 +08:00
dependabot[bot] 46bfbe063e chore(deps): bump org.jetbrains:annotations from 24.0.1 to 24.1.0 (#55)
Bumps [org.jetbrains:annotations](https://github.com/JetBrains/java-annotations) from 24.0.1 to 24.1.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/24.0.1...24.1.0)

---
updated-dependencies:
- dependency-name: org.jetbrains:annotations
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-16 17:56:10 +08:00
dependabot[bot] c3d993311e chore(deps): bump cc.carm.lib:easyplugin-color from 1.5.10 to 1.5.11 (#54)
Bumps [cc.carm.lib:easyplugin-color](https://github.com/CarmJos/EasyPlugin) from 1.5.10 to 1.5.11.
- [Release notes](https://github.com/CarmJos/EasyPlugin/releases)
- [Commits](https://github.com/CarmJos/EasyPlugin/compare/1.5.10...1.5.11)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyplugin-color
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-15 01:16:44 +08:00
dependabot[bot] 67d1fd67fc chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin (#51)
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.0 to 3.6.2.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.0...maven-javadoc-plugin-3.6.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 07:58:26 +08:00
dependabot[bot] 357b6054a4 chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin (#52)
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.1...surefire-3.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 07:58:18 +08:00
dependabot[bot] c150d607e9 chore(deps): bump cc.carm.lib:easyplugin-color from 1.5.8 to 1.5.10 (#53)
Bumps [cc.carm.lib:easyplugin-color](https://github.com/CarmJos/EasyPlugin) from 1.5.8 to 1.5.10.
- [Release notes](https://github.com/CarmJos/EasyPlugin/releases)
- [Commits](https://github.com/CarmJos/EasyPlugin/compare/1.5.8...1.5.10)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyplugin-color
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 07:58:08 +08:00
carm dbcaff5c93 fix(head): 修复头颅皮肤无法正确应用的问题 2023-11-05 02:56:56 +08:00
dependabot[bot] e0d5f9229b chore(deps): bump me.clip:placeholderapi from 2.11.4 to 2.11.5 (#50)
Bumps me.clip:placeholderapi from 2.11.4 to 2.11.5.

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-31 14:13:10 +08:00
dependabot[bot] caf92ef565 chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin (#48)
Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.1.2 to 3.2.1.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.2...surefire-3.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-25 22:50:12 +08:00
dependabot[bot] 77547cdc80 chore(deps): bump com.github.cryptomorin:XSeries from 9.6.1.1 to 9.7.0 (#49)
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 9.6.1.1 to 9.7.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v9.6.1.1...v9.7.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-25 22:50:04 +08:00
carm 5d55ddbce9 feat(item): 优化PreparedItem的结构,使其适用于更多项目。 2023-10-11 22:44:57 +08:00
carm c73032266d feat(item): 优化PreparedItem的结构,使其适用于更多项目。 2023-10-11 22:32:19 +08:00
dependabot[bot] a6b6d46be6 chore(deps): bump com.github.cryptomorin:XSeries from 9.6.0 to 9.6.1.1 (#46)
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 9.6.0 to 9.6.1.1.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v9.6.0...v9.6.1.1)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-11 20:18:07 +08:00
carm 47d7b17082 ci(cache): NO MORE GITHUB CACHE SERVICE! 2023-10-10 15:23:41 +08:00
dependabot[bot] 0663f3d117 chore(deps): bump com.github.cryptomorin:XSeries from 9.5.0 to 9.6.0 (#45)
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 9.5.0 to 9.6.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v9.5.0...v9.6.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 13:32:00 +08:00
dependabot[bot] 1947ba1899 chore(deps): bump org.apache.maven.plugins:maven-shade-plugin (#43)
Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.5.0...maven-shade-plugin-3.5.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 12:48:09 +08:00
dependabot[bot] 2e4de9880f chore(deps): bump me.clip:placeholderapi from 2.11.3 to 2.11.4 (#44)
Bumps me.clip:placeholderapi from 2.11.3 to 2.11.4.

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 12:47:59 +08:00
carm 398bc773d6 feat(item): 重构物品相关代码,支持更多功能 2023-09-21 22:23:35 +08:00
dependabot[bot] 1396c6bd6e chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin (#42)
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.5.0...maven-javadoc-plugin-3.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-21 00:12:31 +08:00
carm 2959c00795 feat(item): 重构物品相关代码,支持更多功能 2023-09-21 00:08:42 +08:00
carm 09537975e4 feat(item): 重构物品相关代码,支持更多功能 2023-09-20 23:46:59 +08:00
carm 02625b5c0c feat(item): 重构物品相关代码,支持更多功能 2023-09-20 23:39:34 +08:00
carm bb9e24dd96 fix(item): 修复上下空行错误 2023-09-08 23:47:53 +08:00
carm 5bdc5908ef feat(item): 支持为插入的LORE设置偏移量,以便在上方、下方空行,分割功能。 2023-09-08 22:15:28 +08:00
dependabot[bot] dde304625e chore(deps): bump cc.carm.lib:easyplugin-color from 1.5.7 to 1.5.8 (#41)
Bumps [cc.carm.lib:easyplugin-color](https://github.com/CarmJos/EasyPlugin) from 1.5.7 to 1.5.8.
- [Release notes](https://github.com/CarmJos/EasyPlugin/releases)
- [Commits](https://github.com/CarmJos/EasyPlugin/compare/1.5.7...1.5.8)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyplugin-color
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-07 22:23:55 +08:00
carm 24ef0b6dcd feat(send): 提供物品预备方法,方便插入lore、修改附魔、flags等 2023-09-07 03:49:15 +08:00
carm a1d6cf1258 feat(send): 提供新消息发送方法,分离玩家参数和消息参数 2023-09-07 02:31:57 +08:00
carm 0f7fc39f87 feat(send): 提供新消息发送方法,分离玩家参数和消息参数 2023-09-06 06:40:52 +08:00
dependabot[bot] 92ecb55a95 chore(deps): bump cc.carm.lib:easyplugin-color from 1.5.6 to 1.5.7 (#40)
Bumps [cc.carm.lib:easyplugin-color](https://github.com/CarmJos/EasyPlugin) from 1.5.6 to 1.5.7.
- [Release notes](https://github.com/CarmJos/EasyPlugin/releases)
- [Commits](https://github.com/CarmJos/EasyPlugin/compare/1.5.6...1.5.7)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyplugin-color
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 01:10:37 +08:00
carm bfd1624e85 chore(update): 适配上游版本更新。 2023-08-29 12:43:49 +08:00
dependabot[bot] 01d3c245a9 chore(deps): bump net.md-5:bungeecord-chat from 1.16-R0.4 to 1.20-R0.1 (#37)
Bumps [net.md-5:bungeecord-chat](https://github.com/SpigotMC/BungeeCord) from 1.16-R0.4 to 1.20-R0.1.
- [Commits](https://github.com/SpigotMC/BungeeCord/commits)

---
updated-dependencies:
- dependency-name: net.md-5:bungeecord-chat
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-08 14:09:36 +08:00
dependabot[bot] 8721c6085f chore(deps): bump com.github.cryptomorin:XSeries from 9.4.0 to 9.5.0 (#36)
Bumps [com.github.cryptomorin:XSeries](https://github.com/CryptoMorin/XSeries) from 9.4.0 to 9.5.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v9.4.0...v9.5.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-08 14:09:23 +08:00
dependabot[bot] eca4d47b8f chore(deps): bump easyconfiguration-core from 3.7.0 to 3.7.1 (#35)
Bumps [easyconfiguration-core](https://github.com/CarmJos/EasyConfiguration) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/CarmJos/EasyConfiguration/releases)
- [Commits](https://github.com/CarmJos/EasyConfiguration/compare/3.7.0...3.7.1)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyconfiguration-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-20 08:49:44 +08:00
dependabot[bot] 3750ac7d58 chore(deps): bump easyconfiguration-core from 3.6.0 to 3.7.0 (#34)
Bumps [easyconfiguration-core](https://github.com/CarmJos/EasyConfiguration) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/CarmJos/EasyConfiguration/releases)
- [Commits](https://github.com/CarmJos/EasyConfiguration/compare/3.6.0...3.7.0)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyconfiguration-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 17:02:40 +08:00
dependabot[bot] d3bdc4ad60 chore(deps): bump easyplugin-color from 1.5.4 to 1.5.6 (#33)
Bumps [easyplugin-color](https://github.com/CarmJos/EasyPlugin) from 1.5.4 to 1.5.6.
- [Release notes](https://github.com/CarmJos/EasyPlugin/releases)
- [Commits](https://github.com/CarmJos/EasyPlugin/compare/1.5.4...1.5.6)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyplugin-color
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-02 04:03:39 +08:00
dependabot[bot] 6bb6fb1b95 chore(deps): bump maven-shade-plugin from 3.4.1 to 3.5.0 (#32)
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.4.1...maven-shade-plugin-3.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-17 21:22:09 +08:00
dependabot[bot] dd2499512c chore(deps): bump XSeries from 9.3.1 to 9.4.0 (#31)
Bumps [XSeries](https://github.com/CryptoMorin/XSeries) from 9.3.1 to 9.4.0.
- [Release notes](https://github.com/CryptoMorin/XSeries/releases)
- [Commits](https://github.com/CryptoMorin/XSeries/compare/v9.3.1...v9.4.0)

---
updated-dependencies:
- dependency-name: com.github.cryptomorin:XSeries
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-14 09:58:56 +08:00
dependabot[bot] 3aa0542f01 chore(deps): bump maven-surefire-plugin from 3.1.0 to 3.1.2 (#30)
Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.1.0 to 3.1.2.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.0...surefire-3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-09 13:36:34 +08:00
dependabot[bot] 4d9d5f5d84 chore(deps): bump maven-release-plugin from 3.0.0 to 3.0.1 (#29)
Bumps [maven-release-plugin](https://github.com/apache/maven-release) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/apache/maven-release/releases)
- [Commits](https://github.com/apache/maven-release/compare/maven-release-3.0.0...maven-release-3.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-06 12:12:30 +08:00
carm 2b31ee1318 fix(item): 修复物品获取后修改被直接应用到缓存导致重复获取第一次物品的问题。 2023-06-01 02:32:45 +08:00
carm 9d6212e5ea feat(conf): 为入口类添加了实例方法,方便快捷创建基础配置和消息配置文件。 2023-05-27 00:22:30 +08:00
carm 8f3d574446 feat(conf): 搭配XSeries实现部分配置类的跨版本支持。 2023-05-27 00:12:37 +08:00
dependabot[bot] 437e1d6d61 chore(deps): bump maven-source-plugin from 3.2.1 to 3.3.0 (#28)
Bumps [maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.2.1 to 3.3.0.
- [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.2.1...maven-source-plugin-3.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 21:33:19 +08:00
carm a04b7c9c06 chore(update): 适配上游版本更新。 2023-05-21 17:30:03 +08:00
carm 74e88a126c chore(update): 适配上游版本更新。 2023-05-21 17:29:02 +08:00
dependabot[bot] 79a65a94bc chore(deps): bump maven-gpg-plugin from 3.0.1 to 3.1.0 (#26)
Bumps [maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.0.1 to 3.1.0.
- [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.0.1...maven-gpg-plugin-3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-10 13:28:54 +08:00
dependabot[bot] 6ba08f7a67 chore(deps): bump maven-surefire-plugin from 3.0.0 to 3.1.0 (#27)
Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0...surefire-3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-10 13:28:44 +08:00
dependabot[bot] 166b9fa0a8 chore(deps): bump maven-release-plugin from 2.5.3 to 3.0.0 (#25)
Bumps [maven-release-plugin](https://github.com/apache/maven-release) from 2.5.3 to 3.0.0.
- [Release notes](https://github.com/apache/maven-release/releases)
- [Commits](https://github.com/apache/maven-release/compare/maven-release-2.5.3...maven-release-3.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-21 19:12:20 +08:00
dependabot[bot] 6257cdd114 chore(deps): bump placeholderapi from 2.11.2 to 2.11.3 (#24)
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-21 19:12:11 +08:00
carm c28ee7d57b feat(comments): 适配上游对配置文件保存方式的更新。 2023-03-20 20:28:40 +08:00
carm 3d1639362b feat(value): 适配Manifest更新 2023-03-15 22:51:06 +08:00
dependabot[bot] ce205e10fe chore(deps): bump maven-surefire-plugin from 2.22.2 to 3.0.0 (#23)
Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 2.22.2 to 3.0.0.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-2.22.2...surefire-3.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 14:01:38 +08:00
dependabot[bot] 8e4e712936 chore(deps): bump easyplugin-color from 1.5.3 to 1.5.4 (#22)
Bumps [easyplugin-color](https://github.com/CarmJos/EasyPlugin) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/CarmJos/EasyPlugin/releases)
- [Commits](https://github.com/CarmJos/EasyPlugin/compare/1.5.3...1.5.4)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyplugin-color
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 14:01:13 +08:00
dependabot[bot] c3d9c65a86 chore(deps): bump easyplugin-color from 1.5.2 to 1.5.3 (#21)
Bumps [easyplugin-color](https://github.com/CarmJos/EasyPlugin) from 1.5.2 to 1.5.3.
- [Release notes](https://github.com/CarmJos/EasyPlugin/releases)
- [Commits](https://github.com/CarmJos/EasyPlugin/compare/1.5.2...1.5.3)

---
updated-dependencies:
- dependency-name: cc.carm.lib:easyplugin-color
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-08 18:32:44 +08:00
dependabot[bot] ebddeff78d chore(deps): bump annotations from 24.0.0 to 24.0.1 (#20)
Bumps [annotations](https://github.com/JetBrains/java-annotations) from 24.0.0 to 24.0.1.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains:annotations
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-03 12:58:40 +08:00
dependabot[bot] afcdc2c378 chore(deps): bump maven-compiler-plugin from 3.10.1 to 3.11.0 (#19)
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-28 18:19:42 +08:00
carm 5905b25c73 chore(update): 适配上游版本更新。 2023-02-19 17:31:43 +08:00
carm 31f51c9b96 chore(update): 适配上游版本更新。 2023-02-19 17:28:58 +08:00
carm eb8f279e0b chore(update): 适配上游版本更新。 2023-02-19 17:28:45 +08:00
carm e291c3a109 chore(update): 适配上游版本更新。 2023-02-19 04:22:14 +08:00
carm 433f780608 chore(update): 适配上游版本更新。 2023-02-19 04:22:02 +08:00
carm 385f6dd22f chore(color): 使用由 EasyPlugin 提供的ColorParser。 2023-02-18 20:46:16 +08:00
dependabot[bot] 04168d4d12 chore(deps): bump maven-javadoc-plugin from 3.4.1 to 3.5.0 (#18)
Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.4.1...maven-javadoc-plugin-3.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-16 19:24:11 +08:00
carm 143e0c2283 chore(update): 适配上游版本更新。 2023-02-11 21:54:59 +08:00
carm 4b4f90ee38 chore(update): 适配上游版本更新。 2023-02-11 21:54:35 +08:00
dependabot[bot] 97d24c7027 chore(deps): bump annotations from 23.1.0 to 24.0.0 (#17)
Bumps [annotations](https://github.com/JetBrains/java-annotations) from 23.1.0 to 24.0.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/23.1.0...24.0.0)

---
updated-dependencies:
- dependency-name: org.jetbrains:annotations
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-12 22:15:52 +08:00
carm d1b01ffed5 build(scm): 修复错误的scm地址 2022-12-18 04:54:29 +08:00
carm 67931094e6 refactor(proj): 放弃spigot项目,将Bukkit子项目单独提出。 2022-12-16 16:09:50 +08:00
carm 02f59b99f0 feat(msg): 添加 sendToEach 方法支持 2022-12-16 04:31:43 +08:00
carm e781d54348 feat(color): 完善ColorParser支持渐变RGB颜色。 2022-12-16 04:13:49 +08:00
carm bbd2c9e5e7 Merge remote-tracking branch 'origin/master' 2022-12-12 22:46:18 +08:00
carm ccc8cc6b72 feat(deps): 适配上游版本更新。 2022-12-12 22:36:20 +08:00
dependabot[bot] 1612e49326 chore(deps): bump annotations from 23.0.0 to 23.1.0 (#16)
Bumps [annotations](https://github.com/JetBrains/java-annotations) from 23.0.0 to 23.1.0.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/23.0.0...23.1.0)

---
updated-dependencies:
- dependency-name: org.jetbrains:annotations
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-10 11:35:23 +08:00
carm 2754f12cd5 fix(parse): 修复Number类型转换错误的问题。 2022-12-06 22:06:27 +08:00
dependabot[bot] c0f5d32ba0 chore(deps): bump maven-shade-plugin from 3.4.0 to 3.4.1 (#14)
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-02 18:31:09 +08:00
dependabot[bot] 6c355e0d89 chore(deps): bump maven-jar-plugin from 3.2.2 to 3.3.0 (#12)
Bumps [maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.2.2 to 3.3.0.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.2.2...maven-jar-plugin-3.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 00:22:14 +08:00
dependabot[bot] 6c7a5dd60a chore(deps): bump maven-shade-plugin from 3.3.0 to 3.4.0 (#11)
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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-15 22:01:36 +08:00
carm 425d61834b chore: 移除重复方法 2022-09-10 01:33:47 +08:00
carm c9a272d052 fix(repo): 添加sonatype-repo 2022-09-10 01:23:23 +08:00
carm 327484cd53 feat(source): 为 ConfigurationWrapper 添加 getSource() 方法以获取源实现内容。 2022-09-10 01:17:10 +08:00
carm 99090929dd feat(source): 为 ConfigurationWrapper 添加 getSource() 方法以获取源实现内容。 2022-09-10 01:04:14 +08:00
carm 8437c4c904 feat(source): 为 ConfigurationWrapper 添加 getSource() 方法以获取源实现内容。 2022-09-10 01:04:04 +08:00
dependabot[bot] 21f7742d78 chore(deps): bump maven-javadoc-plugin from 3.4.0 to 3.4.1 (#9)
Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.4.0...maven-javadoc-plugin-3.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-16 21:04:11 +08:00
dependabot[bot] 68e6280c94 chore(deps): bump placeholderapi from 2.11.1 to 2.11.2 (#7)
Bumps placeholderapi from 2.11.1 to 2.11.2.

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-05 14:44:26 +08:00
carm 9a8e6395bb fix(text): 令 AbstractText#parse 返回值不得为null,避免在List类型循环parse时出现异常。 2022-06-21 05:03:16 +08:00
carm 7fa6fa1551 feat(item): 为ItemConfig添加 ItemFlag 与 enchant 相关配置 2022-06-18 06:10:17 +08:00
carm 346ae4c494 feat(item): 为ItemConfig添加 ItemFlag 与 enchant 相关配置 2022-06-18 06:00:39 +08:00
carm 2d8c1817a6 feat(item): 为ItemConfig添加 ItemFlag 与 enchant 相关配置 2022-06-18 05:56:58 +08:00
carm f67d0fae8d feat(item): 为ItemConfig添加 ItemFlag 与 enchant 相关配置 2022-06-18 05:56:43 +08:00
carm 8d723df7a6 chore(sound): 添加输入长度判断,适用于不想发送声音的情况。 2022-06-17 22:57:05 +08:00
carm d4c7124d9e chore(sound): 添加输入长度判断,适用于不想发送声音的情况。 2022-06-17 22:56:47 +08:00
carm 2804543419 test(bungee): 添加测试输出 2022-06-09 00:23:28 +08:00
carm f826014c09 refactor(all): 修改项目结构,为BungeeYAML支持注释。
项目结构修改,避免使用上的误解。同时为 Bungee(YAML) 支持了注释功能。

BREAKING CHANGE: 包名与入口类变更
  1. 项目结构与包名修改
  mineconfiguration-bukkit-general -> mineconfiguration-bukkit
  mineconfiguration-bukkit-native -> mineconfiguration-spigot
  2. MineConfiguration入口类变更,现移动到各自平台的包下。
2022-06-09 00:18:14 +08:00
carm 616d24d885 ci(javadoc): 添加debug消息 2022-05-28 12:48:08 +08:00
carm 8d58583a1e ci(javadoc): 添加debug消息 2022-05-28 12:43:32 +08:00
carm 4b594269bd ci(javadoc): 添加Javadoc自动部署到gh-pages 2022-05-28 12:30:04 +08:00
carm b629a7d96d fix(bukkit): 修复Title配置文件未初始化报错的问题 2022-05-28 12:15:54 +08:00
89 changed files with 2519 additions and 3015 deletions
+9
View File
@@ -0,0 +1,9 @@
# MineConfiguration Javadoc
基于 [Github Pages](https://pages.github.com/) 搭建,请访问 [JavaDoc](https://carmjos.github.io/MineConfiguration) 。
## 如何实现?
若您也想通过 [Github Actions](https://docs.github.com/en/actions/learn-github-actions)
自动部署项目的Javadoc到 [Github Pages](https://pages.github.com/)
可以参考我的文章 [《自动部署Javadoc到Github Pages》](https://pages.carm.cc/doc/javadoc-in-github.html) 。
+3 -3
View File
@@ -29,11 +29,11 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v6
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
uses: codacy/codacy-analysis-cli-action@30783d03e758713bb5ed7b79292cfb14b9dd9a4a
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
@@ -49,6 +49,6 @@ jobs:
# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: results.sarif
+4 -4
View File
@@ -38,11 +38,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v4
# ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v4
+9 -8
View File
@@ -16,11 +16,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- name: "Set up JDK"
uses: actions/setup-java@v2
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
cache: maven
server-id: github
@@ -39,22 +39,23 @@ jobs:
central-deploy:
name: "Deploy Project (Central Repository)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- name: "Set up JDK"
uses: actions/setup-java@v2
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
cache: maven
server-id: ossrh
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: "Central Deploy"
run: mvn -B -Possrh deploy --file pom.xml -DskipTests
run: mvn -B -Pcentral deploy --file pom.xml -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASS }}
+12 -8
View File
@@ -8,10 +8,6 @@ on:
workflow_dispatch:
pull_request:
push:
paths-ignore:
- ".github/**"
- "README.md"
- "LICENCE"
jobs:
build:
@@ -19,18 +15,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- name: "Set up JDK"
uses: actions/setup-java@v2
uses: actions/setup-java@v5
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
cache: maven
server-id: github
server-username: MAVEN_USERNAME
server-password: MAVEN_TOKEN
- name: "Package"
run: mvn -B package --file pom.xml -Dgpg.skip
env:
MAVEN_USERNAME: ${{ github.repository_owner }}
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: "Target Stage"
run: mkdir staging && cp */target/*.jar staging
- name: "Upload artifact"
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: Artifact
path: staging
+15 -27
View File
@@ -12,7 +12,6 @@
[![License](https://img.shields.io/github/license/CarmJos/MineConfiguration)](https://opensource.org/licenses/MIT)
[![workflow](https://github.com/CarmJos/MineConfiguration/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/CarmJos/MineConfiguration/actions/workflows/maven.yml)
![CodeSize](https://img.shields.io/github/languages/code-size/CarmJos/MineConfiguration)
![](https://visitor-badge.glitch.me/badge?page_id=MineConfiguration.readme)
EasyConfiguration for MineCraft!
@@ -20,46 +19,35 @@ EasyConfiguration for MineCraft!
## 项目结构
### **MineConfiguration-Common**
### **MineConfiguration-Common** [`common`](common)
全部版本的共用部分,包括
全部版本的共用部分(均已被打包至下行包中),包括
- `ConfigMessage` (实现类为 `ConfiguredMessage<M>`)
- `ConfigMessageList` (实现类为 `ConfiguredMessageList<M>`)
如要使用,请访问对应实现类的builder() 方法来快速创建。
### MineConfiguration-Bukkit
### **MineConfiguration-Bukkit** [`platform/bukkit`](platform/bukkit)
#### MineConfiguration-Bukkit-Base
Bukkit系通用依赖,不包含实现部分,请使用 **MineConfiguration-Bukkit-General****MineConfiguration-Bukkit-Native**
适用于Bukkit的版本,同时支持其他以Bukkit为基础的服务端 *(如Spigot、Paper、CatServer)*
相较于基础版本,额外提供了以下功能:
- `ConfiguredSerializable<T extends ConfigurationSerializable>`
- `ConfiguredItem` (快捷读简单的物品配置文件)
- `ConfiguredSound` (快捷读音效配置文件)
- `ConfiguredItem` (快捷读\写\使用简单的物品配置文件)
- `ConfiguredSound` (快捷读\写\使用音效配置文件)
- `ConfiguredTitle` (快速读\写\使用标题文字配置文件)
以上类型可以通过 `CraftConfigValue.builder()` 来创建,部分类型提供了 `of(...);` 方法来快速创建。
#### **MineConfiguration-Bukkit-General** _(推荐)_
### **MineConfiguration-Bungee** [`platform/bungee`](platform/bungee)
适用于Bukkit的版本,包含以Bukkit为基础的其他服务端 *(如Spigot、Paper、CatServer)*
#### **MineConfiguration-Bukkit-Native**
适用于 Spigot(1.18+) 的版本,适配了1.18及以后版本Spigot原生自带的配置文件注释功能,随Spigot更新而优化,安全稳定。
### **MineConfiguration-Bungee**
适用于BungeeCord的版本,可用JSON与YAML格式,但**不支持配置文件注释**。
如需使用配置文件注释,建议使用 [EasyConfiguration-YAML](https://github.com/CarmJos/EasyConfiguration) 。
适用于BungeeCord的版本,可用JSON与YAML格式。其中JSON格式**不支持配置文件注释**
## 开发
请详见 [EasyConfiguration](https://github.com/CarmJos/EasyConfiguration)
其他功能请详见 [EasyConfiguration](https://github.com/CarmJos/EasyConfiguration)
的 [开发介绍](https://github.com/CarmJos/EasyConfiguration/tree/master/.documentation) 。
### 依赖方式
@@ -111,14 +99,14 @@ Bukkit系通用依赖,不包含实现部分,请使用 **MineConfiguration-Bu
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>mineconfiguration-bukkit-general</artifactId>
<artifactId>mineconfiguration-bukkit</artifactId>
<version>[LATEST RELEASE]</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>mineconfiguration-bukkit-native</artifactId>
<artifactId>mineconfiguration-spigot</artifactId>
<version>[LATEST RELEASE]</version>
<scope>compile</scope>
</dependency>
@@ -164,9 +152,9 @@ repositories {
dependencies {
api "cc.carm.lib:mineconfiguration-bukkit-general:[LATEST RELEASE]"
api "cc.carm.lib:mineconfiguration-bukkit:[LATEST RELEASE]"
api "cc.carm.lib:mineconfiguration-bukkit-native:[LATEST RELEASE]"
api "cc.carm.lib:mineconfiguration-spigot:[LATEST RELEASE]"
api "cc.carm.lib:mineconfiguration-bungee:[LATEST RELEASE]"
+37 -23
View File
@@ -5,36 +5,62 @@
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.4.2</version>
<version>3.1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${project.jdk.version}</maven.compiler.source>
<maven.compiler.target>${project.jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<artifactId>mineconfiguration-common</artifactId>
<name>MineConfiguration-Common</name>
<description>轻松(做)配置,全部版本的共用部分。</description>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyconfiguration-core</artifactId>
<version>${easyconfiguration.version}</version>
<groupId>cc.carm.lib</groupId>
<artifactId>configured-core</artifactId>
<version>${deps.configured.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.themoep</groupId>
<artifactId>minedown</artifactId>
<version>1.7.1-SNAPSHOT</version>
<groupId>cc.carm.lib</groupId>
<artifactId>configured-feature-commentable</artifactId>
<version>${deps.configured.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>configured-feature-file</artifactId>
<version>${deps.configured.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>configured-feature-text</artifactId>
<version>${deps.configured.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>easyplugin-color</artifactId>
<version>${deps.easyplugin.version}</version>
<scope>compile</scope>
</dependency>
<!--suppress VulnerableLibrariesLocal -->
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-chat</artifactId>
<version>1.16-R0.4</version>
<version>1.21-R0.4</version>
<scope>provided</scope>
</dependency>
@@ -43,18 +69,6 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
@@ -0,0 +1,51 @@
package cc.carm.lib.mineconfiguration.common;
import cc.carm.lib.configuration.Configuration;
import cc.carm.lib.configuration.source.ConfigurationHolder;
import org.jetbrains.annotations.NotNull;
public abstract class AbstractConfiguration<HOLDER extends ConfigurationHolder<?>> {
private final HOLDER config;
private final HOLDER message;
protected AbstractConfiguration(@NotNull HOLDER config, @NotNull HOLDER message) {
this.config = config;
this.message = message;
}
public void initializeConfig(@NotNull Configuration configRoot) {
this.config.initialize(configRoot);
}
public void initializeMessage(@NotNull Configuration messageRoot) {
this.message.initialize(messageRoot);
}
public void initializeConfig(@NotNull Class<? extends Configuration> configRoot) {
this.config.initialize(configRoot);
}
public void initializeMessage(@NotNull Class<? extends Configuration> messageRoot) {
this.message.initialize(messageRoot);
}
public HOLDER getConfig() {
return config;
}
public HOLDER getMessage() {
return message;
}
public void reload() throws Exception {
getConfig().reload();
getMessage().reload();
}
public void save() throws Exception {
getConfig().save();
getMessage().save();
}
}
@@ -1,39 +0,0 @@
package cc.carm.lib.mineconfiguration.common.builder.message;
import cc.carm.lib.mineconfiguration.common.data.AbstractText;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.function.BiFunction;
public abstract class MessageConfigBuilder<R, T extends AbstractText<R>> {
protected final @NotNull Class<R> receiverClazz;
protected final @NotNull Class<T> textClazz;
public MessageConfigBuilder(@NotNull Class<R> receiverClazz,
@NotNull Class<T> textClazz) {
this.receiverClazz = receiverClazz;
this.textClazz = textClazz;
}
/**
* 以单条消息为目标,构建一个消息配置。
*
* @param parser 消息解析器,负责将String转换为目标消息类型。
* @param <M> 消息类型
* @return 单条消息构建器
*/
public abstract <M> @NotNull MessageValueBuilder<M, R, T, ?> asValue(@NotNull BiFunction<@Nullable R, @NotNull String, @Nullable M> parser);
/**
* 以多行消息为目标,构建一个消息配置。
*
* @param parser 消息解析器
* @param <M> 消息类型
* @return 多行消息构建器
*/
public abstract <M> @NotNull MessageListBuilder<M, R, T, ?> asList(@NotNull BiFunction<@Nullable R, @NotNull String, @Nullable M> parser);
}
@@ -1,70 +0,0 @@
package cc.carm.lib.mineconfiguration.common.builder.message;
import cc.carm.lib.mineconfiguration.common.data.AbstractText;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import cc.carm.lib.mineconfiguration.common.value.ConfigMessageList;
import cc.carm.lib.configuration.core.builder.CommonConfigBuilder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.Collectors;
public abstract class MessageListBuilder<M, R, T extends AbstractText<R>, B extends MessageListBuilder<M, R, T, B>>
extends CommonConfigBuilder<List<T>, B> {
protected final @NotNull Class<R> receiverClazz;
protected @NotNull String[] params;
protected @NotNull BiFunction<@Nullable R, @NotNull String, @Nullable M> messageParser;
protected @NotNull BiConsumer<@NotNull R, @NotNull List<M>> sendFunction;
protected @NotNull Function<@NotNull String, @NotNull String> paramFormatter;
protected final @NotNull Function<String, T> textBuilder;
public MessageListBuilder(@NotNull Class<R> receiverClazz,
@NotNull Function<String, T> textBuilder,
@NotNull BiFunction<@Nullable R, @NotNull String, @Nullable M> parser) {
this.receiverClazz = receiverClazz;
this.textBuilder = textBuilder;
this.params = new String[0];
this.messageParser = parser;
this.paramFormatter = ParamsUtils.DEFAULT_PARAM_FORMATTER;
this.sendFunction = (sender, M) -> {
};
}
public B defaults(@NotNull String... messages) {
return defaults(new ArrayList<>(Arrays.stream(messages).map(textBuilder).collect(Collectors.toList())));
}
public B params(@NotNull String... params) {
this.params = params;
return getThis();
}
public B params(@NotNull List<String> params) {
this.params = params.toArray(new String[0]);
return getThis();
}
public B formatParam(@NotNull Function<@NotNull String, @NotNull String> paramFormatter) {
this.paramFormatter = paramFormatter;
return getThis();
}
public B whenSend(@NotNull BiConsumer<@NotNull R, @NotNull List<M>> sendFunction) {
this.sendFunction = sendFunction;
return getThis();
}
@Override
public abstract @NotNull ConfigMessageList<M, T, R> build();
}
@@ -1,67 +0,0 @@
package cc.carm.lib.mineconfiguration.common.builder.message;
import cc.carm.lib.mineconfiguration.common.data.AbstractText;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import cc.carm.lib.mineconfiguration.common.value.ConfigMessage;
import cc.carm.lib.configuration.core.builder.CommonConfigBuilder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
public abstract class MessageValueBuilder<M, R, T extends AbstractText<R>, B extends MessageValueBuilder<M, R, T, B>>
extends CommonConfigBuilder<T, B> {
protected final @NotNull Class<R> receiverClazz;
protected @NotNull String[] params;
protected @NotNull BiFunction<@Nullable R, @NotNull String, @Nullable M> messageParser;
protected @NotNull BiConsumer<@NotNull R, @NotNull M> sendHandler;
protected @NotNull Function<@NotNull String, @NotNull String> paramFormatter;
protected final @NotNull Function<String, T> textBuilder;
public MessageValueBuilder(@NotNull Class<R> receiverClazz,
@NotNull Function<String, T> textBuilder,
@NotNull BiFunction<@Nullable R, @NotNull String, @Nullable M> parser) {
this.receiverClazz = receiverClazz;
this.params = new String[0];
this.paramFormatter = ParamsUtils.DEFAULT_PARAM_FORMATTER;
this.textBuilder = textBuilder;
this.messageParser = parser;
this.sendHandler = (receiver, M) -> {
};
}
public B defaults(@NotNull String message) {
return defaults(this.textBuilder.apply(message));
}
public B params(@NotNull String... params) {
this.params = params;
return getThis();
}
public B params(@NotNull List<String> params) {
this.params = params.toArray(new String[0]);
return getThis();
}
public B formatParam(@NotNull Function<@NotNull String, @NotNull String> paramFormatter) {
this.paramFormatter = paramFormatter;
return getThis();
}
public B whenSend(@NotNull BiConsumer<@NotNull R, @NotNull M> sendFunction) {
this.sendHandler = sendFunction;
return getThis();
}
@Override
public abstract @NotNull ConfigMessage<M, T, R> build();
}
@@ -1,44 +0,0 @@
package cc.carm.lib.mineconfiguration.common.data;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import java.util.function.BiFunction;
/**
* @param <R> Receiver type
*/
public abstract class AbstractText<R> {
private final @NotNull Class<R> receiverClazz;
protected @NotNull String message;
public AbstractText(@NotNull Class<R> receiverClazz, @NotNull String message) {
this.receiverClazz = receiverClazz;
this.message = message;
}
public @NotNull Class<R> getReceiverClazz() {
return receiverClazz;
}
public @NotNull String getMessage() {
return this.message;
}
public <M> @Nullable M parse(@NotNull BiFunction<@Nullable R, @NotNull String, @NotNull M> parser,
@Nullable R receiver, @Nullable String[] params, @Nullable Object[] values) {
return parse(parser, receiver, ParamsUtils.buildParams(params, values));
}
public <M> @Nullable M parse(@NotNull BiFunction<@Nullable R, @NotNull String, @NotNull M> parser,
@Nullable R receiver, @NotNull Map<String, Object> placeholders) {
String message = getMessage();
if (message.isEmpty()) return null; // No further processing
else return parser.apply(receiver, ParamsUtils.setPlaceholders(message, placeholders));
}
}
@@ -1,44 +0,0 @@
package cc.carm.lib.mineconfiguration.common.utils;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class ColorParser {
public static Pattern HEX_PATTERN = Pattern.compile("&\\(&?#([0-9a-fA-F]{6})\\)");
public static String parse(String text) {
return parseBaseColor(parseHexColor(text));
}
public static String[] parse(String... texts) {
return parse(Arrays.asList(texts)).toArray(new String[0]);
}
public static List<String> parse(List<String> texts) {
return texts.stream().map(ColorParser::parse).collect(Collectors.toList());
}
public static String parseBaseColor(final String text) {
return text.replaceAll("&", "§").replace("§§", "&");
}
public static String parseHexColor(String text) {
Matcher matcher = HEX_PATTERN.matcher(text);
while (matcher.find()) {
text = matcher.replaceFirst(buildHexColor(matcher.group(1)).toLowerCase());
matcher.reset(text);
}
return text;
}
private static String buildHexColor(String hexCode) {
return Arrays.stream(hexCode.split(""))
.map(s -> '§' + s)
.collect(Collectors.joining("", '§' + "x", ""));
}
}
@@ -1,43 +0,0 @@
package cc.carm.lib.mineconfiguration.common.utils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
public class ParamsUtils {
/**
* 默认的变量格式为 {@code %(变量名)}。
*/
public static Function<@NotNull String, @NotNull String> DEFAULT_PARAM_FORMATTER = (s) -> "%(" + s + ")";
public static String[] formatParams(@NotNull Function<String, String> formatter, @NotNull String[] params) {
return Arrays.stream(params).map(formatter).toArray(String[]::new);
}
public static Map<String, Object> buildParams(@Nullable String[] params, @Nullable Object[] values) {
Map<String, Object> map = new HashMap<>();
if (params == null || params.length == 0) return map;
for (int i = 0; i < params.length; i++) {
map.put(params[i], values.length > i ? values[i] : "?");
}
return map;
}
public static String setPlaceholders(@NotNull String messages, @NotNull Map<String, Object> placeholders) {
if (messages.isEmpty()) return messages;
String parsed = messages;
for (Map.Entry<String, Object> entry : placeholders.entrySet()) {
Object value = entry.getValue();
parsed = parsed.replace(entry.getKey(), value == null ? "" : value.toString());
}
return parsed;
}
}
@@ -1,75 +0,0 @@
package cc.carm.lib.mineconfiguration.common.value;
import cc.carm.lib.mineconfiguration.common.data.AbstractText;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import cc.carm.lib.configuration.core.function.ConfigValueParser;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import cc.carm.lib.configuration.core.value.type.ConfiguredValue;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
public abstract class ConfigMessage<M, T extends AbstractText<R>, R>
extends ConfiguredValue<T> {
protected final @NotNull String[] params;
protected final @NotNull BiFunction<@Nullable R, @NotNull String, @Nullable M> messageParser;
protected final @NotNull BiConsumer<@NotNull R, @NotNull M> messageConsumer;
protected final @NotNull Function<String, T> textBuilder;
public ConfigMessage(@Nullable ConfigurationProvider<?> provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@NotNull Class<T> textClazz, @NotNull T defaultMessage, @NotNull String[] params,
@NotNull BiFunction<@Nullable R, @NotNull String, @Nullable M> messageParser,
@NotNull BiConsumer<@NotNull R, @NotNull M> messageConsumer,
@NotNull Function<String, T> textBuilder) {
super(provider, sectionPath, headerComments, inlineComments, textClazz, defaultMessage,
ConfigValueParser.castToString().andThen((s, d) -> textBuilder.apply(s)), AbstractText::getMessage
);
this.params = params;
this.messageParser = messageParser;
this.messageConsumer = messageConsumer;
this.textBuilder = textBuilder;
}
public @Nullable M parse(@Nullable R sender, @Nullable Object... values) {
return parse(sender, ParamsUtils.buildParams(params, values));
}
public @Nullable M parse(@Nullable R sender, @NotNull Map<String, Object> placeholders) {
T value = get();
if (value == null || value.getMessage().isEmpty()) return null;
else return value.parse(this.messageParser, sender, placeholders);
}
public void send(@Nullable R receiver, @Nullable Object... values) {
send(receiver, ParamsUtils.buildParams(params, values));
}
public void send(@Nullable R receiver, @NotNull Map<String, Object> placeholders) {
if (receiver == null) return;
M parsed = parse(receiver, placeholders);
if (parsed == null) return;
messageConsumer.accept(receiver, parsed);
}
public void broadcast(@Nullable Object... values) {
broadcast(ParamsUtils.buildParams(params, values));
}
public abstract void broadcast(@NotNull Map<String, Object> placeholders);
public void set(@Nullable String value) {
this.set(value == null ? null : buildText(value));
}
protected T buildText(String value) {
return textBuilder.apply(value);
}
}
@@ -1,93 +0,0 @@
package cc.carm.lib.mineconfiguration.common.value;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import cc.carm.lib.mineconfiguration.common.data.AbstractText;
import cc.carm.lib.configuration.core.function.ConfigDataFunction;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import cc.carm.lib.configuration.core.value.type.ConfiguredList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.Collectors;
public abstract class ConfigMessageList<M, T extends AbstractText<R>, R> extends ConfiguredList<T> {
protected final @NotNull String[] params;
protected final @NotNull BiFunction<@Nullable R, @NotNull String, @Nullable M> messageParser;
protected final @NotNull BiConsumer<@NotNull R, @NotNull List<M>> sendFunction;
protected final @NotNull Function<String, T> textBuilder;
@SuppressWarnings("NullableProblems")
public ConfigMessageList(@Nullable ConfigurationProvider<?> provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@NotNull Class<T> textClazz, @NotNull List<T> messages, @NotNull String[] params,
@NotNull BiFunction<@Nullable R, @NotNull String, @Nullable M> messageParser,
@NotNull BiConsumer<@NotNull R, @NotNull List<M>> sendFunction,
@NotNull Function<String, @NotNull T> textBuilder) {
super(
provider, sectionPath, headerComments, inlineComments, textClazz, messages,
ConfigDataFunction.castToString().andThen(textBuilder::apply), AbstractText::getMessage
);
this.params = params;
this.messageParser = messageParser;
this.sendFunction = sendFunction;
this.textBuilder = textBuilder;
}
public @Nullable List<M> parse(@Nullable R sender, @Nullable Object... values) {
return parse(sender, ParamsUtils.buildParams(params, values));
}
public @Nullable List<M> parse(@Nullable R sender, @NotNull Map<String, Object> placeholders) {
List<T> list = get();
if (list.isEmpty()) return null;
List<String> messages = list.stream().map(T::getMessage).collect(Collectors.toList());
if (String.join("", messages).isEmpty()) return null;
return list.stream().map(value -> value.parse(this.messageParser, sender, placeholders))
.collect(Collectors.toList());
}
public void send(@Nullable R receiver, @Nullable Object... values) {
send(receiver, ParamsUtils.buildParams(params, values));
}
public void send(@Nullable R receiver, @NotNull Map<String, Object> placeholders) {
if (receiver == null) return;
List<M> parsed = parse(receiver, placeholders);
if (parsed == null) return;
sendFunction.accept(receiver, parsed);
}
public void broadcast(@Nullable Object... values) {
broadcast(ParamsUtils.buildParams(params, values));
}
public abstract void broadcast(@NotNull Map<String, Object> placeholders);
public void setMessages(@NotNull String... values) {
setMessages(values.length == 0 ? null : Arrays.asList(values));
}
public void setMessages(@Nullable List<String> values) {
if (values == null || values.isEmpty()) {
set(null);
} else {
set(buildText(values));
}
}
protected List<T> buildText(List<String> values) {
return values.stream().map(textBuilder).collect(Collectors.toList());
}
}
+77
View File
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>3.1.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<deps.adventure.version>4.26.1</deps.adventure.version>
</properties>
<artifactId>mineconfiguration-velocity</artifactId>
<packaging>jar</packaging>
<name>MineConfiguration-Adventure</name>
<description>轻松(做)配置,适用于基于Adventure的平台(如Velocity、Paper),可用JSON与YAML格式。</description>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>mineconfiguration-common</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>configured-yaml</artifactId>
<version>${deps.configured.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>${deps.adventure.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<version>${deps.adventure.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-plain</artifactId>
<version>${deps.adventure.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>${deps.adventure.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,38 @@
package cc.carm.lib.mineconfiguration.adventure;
import cc.carm.lib.configuration.Configuration;
import cc.carm.lib.configuration.source.ConfigurationHolder;
import cc.carm.lib.configuration.source.yaml.YAMLConfigFactory;
import cc.carm.lib.configuration.source.yaml.YAMLSource;
import cc.carm.lib.mineconfiguration.common.AbstractConfiguration;
import org.jetbrains.annotations.NotNull;
import java.io.File;
public class MineConfiguration extends AbstractConfiguration<ConfigurationHolder<YAMLSource>> {
public MineConfiguration(@NotNull File pluginDataFolder) {
super(
YAMLConfigFactory.from(pluginDataFolder, "config.yml").build(),
YAMLConfigFactory.from(pluginDataFolder, "messages.yml").build()
);
}
public MineConfiguration(@NotNull File pluginDataFolder,
@NotNull Configuration configRoot,
@NotNull Configuration messageRoot) {
this(pluginDataFolder);
initializeConfig(configRoot);
initializeMessage(messageRoot);
}
public MineConfiguration(@NotNull File pluginDataFolder,
@NotNull Class<? extends Configuration> configRoot,
@NotNull Class<? extends Configuration> messageRoot) {
this(pluginDataFolder);
initializeConfig(configRoot);
initializeMessage(messageRoot);
}
}
@@ -0,0 +1,68 @@
package cc.carm.lib.mineconfiguration.adventure.value;
import cc.carm.lib.configuration.value.ValueManifest;
import cc.carm.lib.configuration.value.text.ConfiguredText;
import cc.carm.lib.configuration.value.text.data.TextContents;
import cc.carm.lib.easyplugin.utils.ColorParser;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.ComponentSerializer;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
public class ConfiguredMessage extends ConfiguredText<Component, Audience> {
public static final LegacyComponentSerializer LEGACY_SERIALIZER = LegacyComponentSerializer.legacySection();
public static AtomicReference<ComponentSerializer<?, ?, String>> SERIALIZER = new AtomicReference<>(LEGACY_SERIALIZER);
@NotNull
public static ConfiguredMessage.Builder create() {
return new Builder();
}
public static ConfiguredMessage ofString(@NotNull String... messages) {
return create().defaults(messages).build();
}
public ConfiguredMessage(@NotNull ValueManifest<TextContents, TextContents> manifest,
@NotNull BiFunction<Audience, String, String> parser,
@NotNull BiFunction<Audience, String, Component> compiler,
@NotNull BiConsumer<Audience, List<Component>> dispatcher,
@NotNull String[] params) {
super(manifest, parser, compiler, dispatcher, params);
}
public void sendActionBar(Audience audience, Object... values) {
Component content = prepare(values).parseLine(audience, (sender, message) -> Component.text(message));
if (content != null) audience.sendActionBar(content);
}
public static class Builder extends ConfiguredText.Builder<Component, Audience, Builder> {
public Builder() {
super();
this.parser = (receiver, message) -> ColorParser.parse(message);
this.compiler = (receiver, message) -> SERIALIZER.get().deserialize(message);
this.dispatcher = (receiver, message) -> message.forEach(receiver::sendMessage);
}
@Override
public @NotNull ConfiguredMessage build() {
return new ConfiguredMessage(buildManifest(), this.parser, this.compiler, this.dispatcher, this.params);
}
@Override
public @NotNull ConfiguredMessage.Builder self() {
return this;
}
}
}
-57
View File
@@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>mineconfiguration-bukkit</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<artifactId>mineconfiguration-bukkit-base</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyconfiguration-core</artifactId>
<version>${easyconfiguration.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>mineconfiguration-common</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
@@ -1,35 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import cc.carm.lib.configuration.core.value.impl.CachedConfigValue;
import cc.carm.lib.mineconfiguration.bukkit.builder.CraftConfigBuilder;
import cc.carm.lib.mineconfiguration.bukkit.source.CraftConfigProvider;
import cc.carm.lib.mineconfiguration.bukkit.source.CraftSectionWrapper;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public abstract class CraftConfigValue<T> extends CachedConfigValue<T> {
public static @NotNull CraftConfigBuilder builder() {
return new CraftConfigBuilder();
}
public CraftConfigValue(@Nullable CraftConfigProvider provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@Nullable T defaultValue) {
super(provider, sectionPath, headerComments, inlineComments, defaultValue);
}
public CraftConfigProvider getBukkitProvider() {
ConfigurationProvider<?> provider = getProvider();
if (provider instanceof CraftConfigProvider) return (CraftConfigProvider) getProvider();
else throw new IllegalStateException("Provider is not a SpigotConfigProvider");
}
public CraftSectionWrapper getBukkitConfig() {
return getBukkitProvider().getConfiguration();
}
}
@@ -1,13 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.builder;
import cc.carm.lib.mineconfiguration.bukkit.source.CraftConfigProvider;
import cc.carm.lib.configuration.core.builder.AbstractConfigBuilder;
public abstract class AbstractCraftBuilder<T, B extends AbstractCraftBuilder<T, B>>
extends AbstractConfigBuilder<T, B, CraftConfigProvider> {
public AbstractCraftBuilder() {
super(CraftConfigProvider.class);
}
}
@@ -1,45 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.builder;
import cc.carm.lib.configuration.core.builder.ConfigBuilder;
import cc.carm.lib.mineconfiguration.bukkit.builder.item.ItemConfigBuilder;
import cc.carm.lib.mineconfiguration.bukkit.builder.message.CraftMessageBuilder;
import cc.carm.lib.mineconfiguration.bukkit.builder.serializable.SerializableBuilder;
import cc.carm.lib.mineconfiguration.bukkit.builder.sound.SoundConfigBuilder;
import cc.carm.lib.mineconfiguration.bukkit.builder.title.TitleConfigBuilder;
import cc.carm.lib.mineconfiguration.bukkit.data.ItemConfig;
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredItem;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class CraftConfigBuilder extends ConfigBuilder {
public @NotNull SoundConfigBuilder createSound() {
return new SoundConfigBuilder();
}
public @NotNull ItemConfigBuilder createItem() {
return new ItemConfigBuilder();
}
public @NotNull CraftMessageBuilder createMessage() {
return new CraftMessageBuilder();
}
public @NotNull TitleConfigBuilder createTitle() {
return new TitleConfigBuilder();
}
public <V extends ConfigurationSerializable> @NotNull SerializableBuilder<V> ofSerializable(@NotNull Class<V> valueClass) {
return new SerializableBuilder<>(valueClass);
}
public @NotNull ConfiguredItem ofItem() {
return createItem().build();
}
public @NotNull ConfiguredItem ofItem(@Nullable ItemConfig defaultItem) {
return createItem().defaults(defaultItem).build();
}
}
@@ -1,101 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.builder.item;
import cc.carm.lib.mineconfiguration.bukkit.builder.AbstractCraftBuilder;
import cc.carm.lib.mineconfiguration.bukkit.data.ItemConfig;
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredItem;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
public class ItemConfigBuilder extends AbstractCraftBuilder<ItemConfig, ItemConfigBuilder> {
protected Material type;
protected short data = 0;
protected String name = null;
protected List<String> lore = new ArrayList<>();
protected @NotNull String[] params = new String[0];
protected @NotNull Function<@NotNull String, @NotNull String> paramFormatter = ParamsUtils.DEFAULT_PARAM_FORMATTER;
public ItemConfigBuilder defaults(@NotNull Material type,
@Nullable String name, @NotNull String... lore) {
return defaults(type, (short) 0, name, Arrays.asList(lore));
}
public ItemConfigBuilder defaults(@NotNull Material type, short data,
@Nullable String name, @NotNull String... lore) {
return defaults(type, data, name, Arrays.asList(lore));
}
public ItemConfigBuilder defaults(@NotNull Material type, short data,
@Nullable String name, @NotNull List<String> lore) {
return defaultType(type).defaultDataID(data).defaultName(name).defaultLore(lore);
}
public ItemConfigBuilder defaultType(@NotNull Material type) {
this.type = type;
return this;
}
public ItemConfigBuilder defaultName(@Nullable String name) {
this.name = name;
return this;
}
public ItemConfigBuilder defaultDataID(short dataID) {
this.data = dataID;
return this;
}
public ItemConfigBuilder defaultLore(@NotNull String... lore) {
return defaultLore(Arrays.asList(lore));
}
public ItemConfigBuilder defaultLore(@NotNull List<String> lore) {
this.lore = new ArrayList<>(lore);
return this;
}
public ItemConfigBuilder formatParam(@NotNull Function<@NotNull String, @NotNull String> paramFormatter) {
this.paramFormatter = paramFormatter;
return getThis();
}
public ItemConfigBuilder params(@NotNull String... params) {
this.params = params;
return getThis();
}
public ItemConfigBuilder params(@NotNull List<String> params) {
this.params = params.toArray(new String[0]);
return getThis();
}
@Override
protected @NotNull ItemConfigBuilder getThis() {
return this;
}
protected @Nullable ItemConfig buildDefault() {
if (this.type == null) return null;
else return new ItemConfig(type, data, name, lore);
}
@Override
public @NotNull ConfiguredItem build() {
ItemConfig defaultItem = Optional.ofNullable(this.defaultValue).orElse(buildDefault());
return new ConfiguredItem(this.provider, this.path, this.headerComments, this.inlineComment, defaultItem, buildParams());
}
protected final String[] buildParams() {
return Arrays.stream(params).map(param -> paramFormatter.apply(param)).toArray(String[]::new);
}
}
@@ -1,44 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.builder.message;
import cc.carm.lib.mineconfiguration.bukkit.data.TextConfig;
import cc.carm.lib.mineconfiguration.bukkit.utils.TextParser;
import cc.carm.lib.mineconfiguration.common.builder.message.MessageConfigBuilder;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.HashMap;
import java.util.function.BiFunction;
public class CraftMessageBuilder extends MessageConfigBuilder<CommandSender, TextConfig> {
public CraftMessageBuilder() {
super(CommandSender.class, TextConfig.class);
}
@Override
public @NotNull <M> CraftMessageValueBuilder<M> asValue(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> parser) {
return new CraftMessageValueBuilder<>(parser);
}
@Override
public @NotNull <M> CraftMessageListBuilder<M> asList(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> parser) {
return new CraftMessageListBuilder<>(parser);
}
public @NotNull
CraftMessageValueBuilder<String> asStringValue() {
return asValue(defaultParser()).whenSend(CommandSender::sendMessage);
}
public @NotNull
CraftMessageListBuilder<String> asStringList() {
return asList(defaultParser()).whenSend((r, m) -> m.forEach(r::sendMessage));
}
protected static @NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable String> defaultParser() {
return (receiver, message) -> TextParser.parseText(receiver, message, new HashMap<>());
}
}
@@ -1,36 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.builder.message;
import cc.carm.lib.mineconfiguration.bukkit.data.TextConfig;
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredMessageList;
import cc.carm.lib.mineconfiguration.common.builder.message.MessageListBuilder;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Optional;
import java.util.function.BiFunction;
public class CraftMessageListBuilder<M>
extends MessageListBuilder<M, CommandSender, TextConfig, CraftMessageListBuilder<M>> {
public CraftMessageListBuilder(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> parser) {
super(CommandSender.class, TextConfig::of, parser);
}
@Override
protected @NotNull CraftMessageListBuilder<M> getThis() {
return this;
}
@Override
public @NotNull ConfiguredMessageList<M> build() {
return new ConfiguredMessageList<>(
this.provider, this.path, this.headerComments, this.inlineComment,
Optional.ofNullable(this.defaultValue).orElse(TextConfig.of(new ArrayList<>())),
ParamsUtils.formatParams(this.paramFormatter, this.params),
this.messageParser, this.sendFunction
);
}
}
@@ -1,37 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.builder.message;
import cc.carm.lib.mineconfiguration.bukkit.data.TextConfig;
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredMessage;
import cc.carm.lib.mineconfiguration.common.builder.message.MessageValueBuilder;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Optional;
import java.util.function.BiFunction;
public class CraftMessageValueBuilder<M>
extends MessageValueBuilder<M, CommandSender, TextConfig, CraftMessageValueBuilder<M>> {
public CraftMessageValueBuilder(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> parser) {
super(CommandSender.class, TextConfig::new, parser);
}
@Override
protected @NotNull CraftMessageValueBuilder<M> getThis() {
return this;
}
@Override
public @NotNull ConfiguredMessage<M> build() {
return new ConfiguredMessage<>(
this.provider, this.path, this.headerComments, this.inlineComment,
Optional.ofNullable(this.defaultValue).orElse(TextConfig.of("")),
ParamsUtils.formatParams(this.paramFormatter, this.params),
this.messageParser, this.sendHandler
);
}
}
@@ -1,28 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.builder.serializable;
import cc.carm.lib.mineconfiguration.bukkit.builder.AbstractCraftBuilder;
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredSerializable;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.jetbrains.annotations.NotNull;
public class SerializableBuilder<T extends ConfigurationSerializable>
extends AbstractCraftBuilder<T, SerializableBuilder<T>> {
protected final @NotNull Class<T> valueClass;
public SerializableBuilder(@NotNull Class<T> valueClass) {
this.valueClass = valueClass;
}
@Override
protected @NotNull SerializableBuilder<T> getThis() {
return this;
}
@Override
public @NotNull ConfiguredSerializable<T> build() {
return new ConfiguredSerializable<>(this.provider, this.path, this.headerComments, this.inlineComment, this.valueClass, this.defaultValue);
}
}
@@ -1,46 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.builder.sound;
import cc.carm.lib.mineconfiguration.bukkit.builder.AbstractCraftBuilder;
import cc.carm.lib.mineconfiguration.bukkit.data.SoundConfig;
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredSound;
import org.bukkit.Sound;
import org.jetbrains.annotations.NotNull;
public class SoundConfigBuilder extends AbstractCraftBuilder<SoundConfig, SoundConfigBuilder> {
public @NotNull SoundConfigBuilder defaults(@NotNull Sound sound, float volume, float pitch) {
return defaults(new SoundConfig(sound.name(), sound, volume, pitch));
}
public @NotNull SoundConfigBuilder defaults(@NotNull Sound sound, float volume) {
return defaults(sound, volume, 1.0f);
}
public @NotNull SoundConfigBuilder defaults(@NotNull Sound sound) {
return defaults(sound, 1.0f);
}
public @NotNull SoundConfigBuilder defaults(@NotNull String soundName, float volume, float pitch) {
return defaults(new SoundConfig(soundName, volume, pitch));
}
public @NotNull SoundConfigBuilder defaults(@NotNull String soundName, float volume) {
return defaults(soundName, volume, 1.0f);
}
public @NotNull SoundConfigBuilder defaults(@NotNull String soundName) {
return defaults(soundName, 1.0f);
}
@Override
protected @NotNull SoundConfigBuilder getThis() {
return this;
}
@Override
public @NotNull ConfiguredSound build() {
return new ConfiguredSound(this.provider, this.path, this.headerComments, this.inlineComment, this.defaultValue);
}
}
@@ -1,97 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.builder.title;
import cc.carm.lib.mineconfiguration.bukkit.builder.AbstractCraftBuilder;
import cc.carm.lib.mineconfiguration.bukkit.data.TitleConfig;
import cc.carm.lib.mineconfiguration.bukkit.function.TitleSendConsumer;
import cc.carm.lib.mineconfiguration.bukkit.utils.ProtocolLibHelper;
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredTitle;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Range;
import java.util.List;
import java.util.function.Function;
public class TitleConfigBuilder extends AbstractCraftBuilder<TitleConfig, TitleConfigBuilder> {
@SuppressWarnings("deprecation")
protected static @NotNull TitleSendConsumer DEFAULT_TITLE_CONSUMER = (player, fadeIn, stay, fadeOut, line1, line2) -> {
if (Bukkit.getPluginManager().isPluginEnabled("ProtocolLib")) {
try {
ProtocolLibHelper.sendTitle(player, fadeIn, stay, fadeOut, line1, line2);
} catch (Exception ignored) {
}
} else {
player.sendTitle(line1, line2);
}
};
protected @NotNull String[] params;
protected @Range(from = 0L, to = Integer.MAX_VALUE) int fadeIn = 10;
protected @Range(from = 0L, to = Integer.MAX_VALUE) int stay = 60;
protected @Range(from = 0L, to = Integer.MAX_VALUE) int fadeOut = 10;
protected @NotNull TitleSendConsumer sendConsumer;
protected @NotNull Function<@NotNull String, @NotNull String> paramFormatter;
public TitleConfigBuilder() {
this.sendConsumer = TitleConfigBuilder.DEFAULT_TITLE_CONSUMER;
this.paramFormatter = ParamsUtils.DEFAULT_PARAM_FORMATTER;
}
public @NotNull TitleConfigBuilder defaults(@Nullable String line1,
@Nullable String line2) {
return defaults(TitleConfig.of(line1, line2));
}
public @NotNull TitleConfigBuilder whenSend(@NotNull TitleSendConsumer consumer) {
this.sendConsumer = consumer;
return this;
}
public TitleConfigBuilder params(String... params) {
this.params = params;
return this;
}
public TitleConfigBuilder params(@NotNull List<String> params) {
return params(params.toArray(new String[0]));
}
public TitleConfigBuilder fadeIn(@Range(from = 0L, to = Integer.MAX_VALUE) int fadeIn) {
this.fadeIn = fadeIn;
return this;
}
public TitleConfigBuilder stay(@Range(from = 0L, to = Integer.MAX_VALUE) int stay) {
this.stay = stay;
return this;
}
public TitleConfigBuilder fadeOut(@Range(from = 0L, to = Integer.MAX_VALUE) int fadeOut) {
this.fadeOut = fadeOut;
return this;
}
public TitleConfigBuilder formatParam(Function<String, String> paramFormatter) {
this.paramFormatter = paramFormatter;
return this;
}
@Override
protected @NotNull TitleConfigBuilder getThis() {
return this;
}
@Override
public @NotNull ConfiguredTitle build() {
return new ConfiguredTitle(
this.provider, this.path, this.headerComments, this.inlineComment,
this.defaultValue, ParamsUtils.formatParams(this.paramFormatter, this.params),
this.sendConsumer, this.fadeIn, this.stay, this.fadeOut
);
}
}
@@ -1,105 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.data;
import cc.carm.lib.configuration.core.source.ConfigurationWrapper;
import cc.carm.lib.mineconfiguration.bukkit.utils.TextParser;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
public class ItemConfig {
protected @NotNull Material type;
protected short data;
protected @Nullable String name;
protected @NotNull List<String> lore;
public ItemConfig(@NotNull Material type, short damage,
@Nullable String name, @NotNull List<String> lore) {
this.type = type;
this.data = damage;
this.name = name;
this.lore = lore;
}
public @NotNull Material getType() {
return type;
}
public short getData() {
return data;
}
public @Nullable String getName() {
return name;
}
public @Nullable String getName(@Nullable Player player, @NotNull Map<String, Object> placeholders) {
return Optional.ofNullable(getName())
.map(name -> TextParser.parseText(player, name, placeholders))
.orElse(null);
}
public @NotNull List<String> getLore() {
return lore;
}
public @Nullable List<String> getLore(@Nullable Player player, @NotNull Map<String, Object> placeholders) {
if (getLore().isEmpty()) return null;
else return TextParser.parseList(player, getLore(), placeholders);
}
public final @NotNull ItemStack getItemStack() {
return getItemStack(1);
}
public @NotNull ItemStack getItemStack(int amount) {
return getItemStack(null, amount, new HashMap<>());
}
public @NotNull ItemStack getItemStack(@Nullable Player player) {
return getItemStack(player, new HashMap<>());
}
public @NotNull ItemStack getItemStack(@Nullable Player player, @NotNull Map<String, Object> placeholders) {
return getItemStack(player, 1, placeholders);
}
public @NotNull ItemStack getItemStack(@Nullable Player player, int amount, @NotNull Map<String, Object> placeholders) {
ItemStack item = new ItemStack(type, amount, data);
ItemMeta meta = item.getItemMeta();
if (meta == null) return item;
Optional.ofNullable(getName(player, placeholders)).ifPresent(meta::setDisplayName);
Optional.ofNullable(getLore(player, placeholders)).ifPresent(meta::setLore);
item.setItemMeta(meta);
return item;
}
public @NotNull Map<String, Object> serialize() {
Map<String, Object> map = new LinkedHashMap<>();
map.put("type", type.name());
if (this.data != 0) map.put("data", data);
if (name != null) map.put("name", name);
if (!lore.isEmpty()) map.put("lore", lore);
return map;
}
public static @NotNull ItemConfig deserialize(@NotNull ConfigurationWrapper section) throws Exception {
String typeName = section.getString("type");
if (typeName == null) throw new NullPointerException("Item type name is null");
Material type = Material.matchMaterial(typeName);
if (type == null) throw new Exception("Invalid material name: " + typeName);
else return new ItemConfig(
type, section.getShort("data", (short) 0),
section.getString("name"),
section.getStringList("lore")
);
}
}
@@ -1,35 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.data;
import cc.carm.lib.mineconfiguration.common.data.AbstractText;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class TextConfig extends AbstractText<CommandSender> {
public TextConfig(@NotNull String message) {
super(CommandSender.class, message);
}
@Contract("!null,-> !null")
public static @Nullable TextConfig of(@Nullable String message) {
if (message == null) return null;
else return new TextConfig(message);
}
public static @NotNull List<TextConfig> of(@Nullable List<String> messages) {
if (messages == null || messages.isEmpty()) return new ArrayList<>();
else return messages.stream().map(TextConfig::of).collect(Collectors.toList());
}
public static @NotNull List<TextConfig> of(@NotNull String... messages) {
return of(Arrays.asList(messages));
}
}
@@ -1,68 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.data;
import cc.carm.lib.configuration.core.source.ConfigurationWrapper;
import cc.carm.lib.mineconfiguration.bukkit.function.TitleSendConsumer;
import cc.carm.lib.mineconfiguration.bukkit.utils.TextParser;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Range;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Optional;
public class TitleConfig {
public static @NotNull TitleConfig of(@Nullable String line1, @Nullable String line2) {
return of(
Optional.ofNullable(line1).map(TextConfig::of).orElse(null),
Optional.ofNullable(line2).map(TextConfig::of).orElse(null)
);
}
public static @NotNull TitleConfig of(@Nullable TextConfig line1, @Nullable TextConfig line2) {
return new TitleConfig(line1, line2);
}
protected @Nullable TextConfig line1;
protected @Nullable TextConfig line2;
protected TitleConfig(@Nullable TextConfig line1, @Nullable TextConfig line2) {
this.line1 = line1;
this.line2 = line2;
}
public void send(@NotNull Player player,
@Range(from = 0L, to = Long.MAX_VALUE) int fadeIn,
@Range(from = 0L, to = Long.MAX_VALUE) int stay,
@Range(from = 0L, to = Long.MAX_VALUE) int fadeOut,
@NotNull Map<String, Object> placeholders,
@Nullable TitleSendConsumer sendConsumer) {
if (this.line1 == null && this.line2 == null) return;
if (sendConsumer == null) return;
sendConsumer.send(
player, fadeIn, stay, fadeOut,
parseLine(this.line1, player, placeholders),
parseLine(this.line2, player, placeholders)
);
}
protected @NotNull String parseLine(@Nullable TextConfig text,
@NotNull Player player, @NotNull Map<String, Object> placeholders) {
if (text == null) return "";
else return TextParser.parseText(player, text.getMessage(), placeholders);
}
public @NotNull Map<String, Object> serialize() {
Map<String, Object> map = new LinkedHashMap<>();
if (this.line1 != null) map.put("line1", this.line1.getMessage());
if (this.line2 != null) map.put("line2", this.line2.getMessage());
return map;
}
public static @NotNull TitleConfig deserialize(@NotNull ConfigurationWrapper section) {
return of(section.getString("line1"), section.getString("line2"));
}
}
@@ -1,26 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.function;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Range;
@FunctionalInterface
public interface TitleSendConsumer {
/**
* 向目标玩家发送标题文字
*
* @param player 目标玩家
* @param fadeIn 淡入时间 (ticks)
* @param stay 保留时间 (ticks)
* @param fadeOut 淡出时间 (ticks)
* @param line1 第一行文字
* @param line2 第二行文字
*/
void send(@NotNull Player player,
@Range(from = 0L, to = Integer.MAX_VALUE) int fadeIn,
@Range(from = 0L, to = Integer.MAX_VALUE) int stay,
@Range(from = 0L, to = Integer.MAX_VALUE) int fadeOut,
@NotNull String line1, @NotNull String line2);
}
@@ -1,43 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.source;
import cc.carm.lib.configuration.core.ConfigInitializer;
import cc.carm.lib.configuration.core.source.impl.FileConfigProvider;
import org.bukkit.configuration.file.YamlConfiguration;
import org.jetbrains.annotations.NotNull;
import java.io.File;
public abstract class CraftConfigProvider extends FileConfigProvider<CraftSectionWrapper> {
public static final char SEPARATOR = '.';
protected ConfigInitializer<? extends CraftConfigProvider> initializer;
protected YamlConfiguration configuration;
public CraftConfigProvider(@NotNull File file) {
super(file);
}
public abstract void initializeConfig();
@Override
public @NotNull CraftSectionWrapper getConfiguration() {
return CraftSectionWrapper.of(this.configuration);
}
@Override
protected void onReload() throws Exception {
configuration.load(getFile());
}
@Override
public void save() throws Exception {
configuration.save(getFile());
}
@Override
public @NotNull ConfigInitializer<? extends CraftConfigProvider> getInitializer() {
return this.initializer;
}
}
@@ -1,74 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.source;
import cc.carm.lib.configuration.core.source.ConfigurationWrapper;
import org.bukkit.configuration.ConfigurationSection;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
public class CraftSectionWrapper implements ConfigurationWrapper {
protected final ConfigurationSection section;
protected CraftSectionWrapper(ConfigurationSection section) {
this.section = section;
}
public ConfigurationSection getSourceSection() {
return section;
}
@Override
public @NotNull Set<String> getKeys(boolean deep) {
return this.section.getKeys(deep);
}
@Override
public @NotNull Map<String, Object> getValues(boolean deep) {
return this.section.getValues(deep);
}
@Override
public void set(@NotNull String path, @Nullable Object value) {
this.section.set(path, value);
}
@Override
public boolean contains(@NotNull String path) {
return this.section.contains(path);
}
@Override
public @Nullable Object get(@NotNull String path) {
return this.section.get(path);
}
@Override
public boolean isList(@NotNull String path) {
return this.section.isList(path);
}
@Override
public @Nullable List<?> getList(@NotNull String path) {
return this.section.getList(path);
}
@Override
public boolean isConfigurationSection(@NotNull String path) {
return this.section.isConfigurationSection(path);
}
@Override
public @Nullable ConfigurationWrapper getConfigurationSection(@NotNull String path) {
return Optional.ofNullable(section.getConfigurationSection(path))
.map(CraftSectionWrapper::of).orElse(null);
}
public static CraftSectionWrapper of(ConfigurationSection section) {
return new CraftSectionWrapper(section);
}
}
@@ -1,41 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.utils;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.wrappers.EnumWrappers;
import com.comphenix.protocol.wrappers.WrappedChatComponent;
import org.bukkit.entity.Player;
public class ProtocolLibHelper {
@SuppressWarnings("deprecation")
public static void sendTitle(Player player, long fadeIn, long stay, long fadeOut, String line1, String line2) throws Exception {
ProtocolManager pm = ProtocolLibrary.getProtocolManager();
if (line1 != null) {
PacketContainer packet = pm.createPacket(PacketType.Play.Server.TITLE);
packet.getTitleActions().write(0, EnumWrappers.TitleAction.TITLE);
packet.getChatComponents().write(0, WrappedChatComponent.fromText(line1));
pm.sendServerPacket(player, packet, false);
}
if (line2 != null) {
PacketContainer packet = pm.createPacket(PacketType.Play.Server.TITLE);
packet.getTitleActions().write(0, EnumWrappers.TitleAction.SUBTITLE);
packet.getChatComponents().write(0, WrappedChatComponent.fromText(line2));
pm.sendServerPacket(player, packet, false);
}
PacketContainer timePacket = pm.createPacket(PacketType.Play.Server.TITLE);
timePacket.getTitleActions().write(0, EnumWrappers.TitleAction.TIMES);
timePacket.getIntegers()
.write(0, Math.toIntExact(fadeIn))
.write(1, Math.toIntExact(stay))
.write(2, Math.toIntExact(fadeOut));
pm.sendServerPacket(player, timePacket, false);
}
}
@@ -1,71 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.value;
import cc.carm.lib.mineconfiguration.bukkit.CraftConfigValue;
import cc.carm.lib.mineconfiguration.bukkit.data.ItemConfig;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import cc.carm.lib.configuration.core.function.ConfigValueParser;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import cc.carm.lib.configuration.core.source.ConfigurationWrapper;
import cc.carm.lib.configuration.core.value.type.ConfiguredSection;
import cc.carm.lib.mineconfiguration.bukkit.builder.item.ItemConfigBuilder;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ConfiguredItem extends ConfiguredSection<ItemConfig> {
public static ItemConfigBuilder create() {
return CraftConfigValue.builder().createItem();
}
public static ConfiguredItem of() {
return CraftConfigValue.builder().ofItem();
}
public static ConfiguredItem of(@Nullable ItemConfig defaultItem) {
return CraftConfigValue.builder().ofItem(defaultItem);
}
protected final @NotNull String[] params;
public ConfiguredItem(@Nullable ConfigurationProvider<?> provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@Nullable ItemConfig defaultValue, @NotNull String[] params) {
super(provider, sectionPath, headerComments, inlineComments, ItemConfig.class, defaultValue, getItemParser(), ItemConfig::serialize);
this.params = params;
}
public static ConfigValueParser<ConfigurationWrapper, ItemConfig> getItemParser() {
return (s, d) -> ItemConfig.deserialize(s);
}
public @NotNull String[] getParams() {
return params;
}
public @Nullable ItemStack getItem(@Nullable Player player) {
return getItem(player, 1);
}
public @Nullable ItemStack getItem(@Nullable Player player, int amount) {
return getItem(player, amount, new HashMap<>());
}
public @Nullable ItemStack getItem(@Nullable Player player, int amount, @NotNull Object... values) {
return getItem(player, amount, ParamsUtils.buildParams(params, values));
}
public @Nullable ItemStack getItem(@Nullable Player player, int amount, @NotNull String[] params, @NotNull Object[] values) {
return getItem(player, amount, ParamsUtils.buildParams(params, values));
}
public @Nullable ItemStack getItem(@Nullable Player player, int amount, @NotNull Map<String, Object> placeholders) {
return getOptional().map(item -> item.getItemStack(player, amount, placeholders)).orElse(null);
}
}
@@ -1,52 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.value;
import cc.carm.lib.mineconfiguration.bukkit.CraftConfigValue;
import cc.carm.lib.mineconfiguration.bukkit.data.TextConfig;
import cc.carm.lib.mineconfiguration.common.value.ConfigMessage;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import cc.carm.lib.mineconfiguration.bukkit.builder.message.CraftMessageValueBuilder;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
public class ConfiguredMessage<M> extends ConfigMessage<M, TextConfig, CommandSender> {
@NotNull
public static <M> CraftMessageValueBuilder<@Nullable M> create(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> messageParser) {
return CraftConfigValue.builder().createMessage().asValue(messageParser);
}
public static CraftMessageValueBuilder<String> asString() {
return CraftConfigValue.builder().createMessage().asStringValue();
}
public static ConfiguredMessage<String> ofString() {
return asString().build();
}
public static ConfiguredMessage<String> ofString(@NotNull String defaultMessage) {
return asString().defaults(defaultMessage).build();
}
public ConfiguredMessage(@Nullable ConfigurationProvider<?> provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@NotNull TextConfig defaultMessage, @NotNull String[] params,
@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> messageParser,
@NotNull BiConsumer<@NotNull CommandSender, @NotNull M> sendFunction) {
super(provider, sectionPath, headerComments, inlineComments, TextConfig.class, defaultMessage, params, messageParser, sendFunction, TextConfig::of);
}
@Override
public void broadcast(@NotNull Map<String, Object> placeholders) {
Bukkit.getOnlinePlayers().forEach(pl -> send(pl, placeholders));
send(Bukkit.getConsoleSender(), placeholders);
}
}
@@ -1,46 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.value;
import cc.carm.lib.mineconfiguration.bukkit.CraftConfigValue;
import cc.carm.lib.mineconfiguration.bukkit.data.TextConfig;
import cc.carm.lib.mineconfiguration.common.value.ConfigMessageList;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import cc.carm.lib.mineconfiguration.bukkit.builder.message.CraftMessageListBuilder;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
public class ConfiguredMessageList<M> extends ConfigMessageList<M, TextConfig, CommandSender> {
@NotNull
public static <M> CraftMessageListBuilder<M> create(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> messageParser) {
return CraftConfigValue.builder().createMessage().asList(messageParser);
}
public static CraftMessageListBuilder<String> asStrings() {
return CraftConfigValue.builder().createMessage().asStringList();
}
public static ConfiguredMessageList<String> ofStrings(@NotNull String... defaultMessages) {
return asStrings().defaults(defaultMessages).build();
}
public ConfiguredMessageList(@Nullable ConfigurationProvider<?> provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@NotNull List<TextConfig> messages, @NotNull String[] params,
@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> messageParser,
@NotNull BiConsumer<@NotNull CommandSender, @NotNull List<M>> sendFunction) {
super(provider, sectionPath, headerComments, inlineComments, TextConfig.class, messages, params, messageParser, sendFunction, TextConfig::of);
}
public void broadcast(@NotNull Map<String, Object> placeholders) {
Bukkit.getOnlinePlayers().forEach(pl -> send(pl, placeholders));
send(Bukkit.getConsoleSender(), placeholders);
}
}
@@ -1,53 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.value;
import cc.carm.lib.mineconfiguration.bukkit.CraftConfigValue;
import cc.carm.lib.mineconfiguration.bukkit.source.CraftConfigProvider;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Optional;
public class ConfiguredSerializable<T extends ConfigurationSerializable> extends CraftConfigValue<T> {
public static <V extends ConfigurationSerializable> ConfiguredSerializable<V> of(@NotNull Class<V> valueClass) {
return of(valueClass, null);
}
public static <V extends ConfigurationSerializable> ConfiguredSerializable<V> of(@NotNull Class<V> valueClass,
@Nullable V defaultValue) {
return builder().ofSerializable(valueClass).defaults(defaultValue).build();
}
protected final @NotNull Class<T> valueClass;
public ConfiguredSerializable(@Nullable CraftConfigProvider provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@NotNull Class<T> valueClass, @Nullable T defaultValue) {
super(provider, sectionPath, headerComments, inlineComments, defaultValue);
this.valueClass = valueClass;
}
@Override
public @Nullable T get() {
if (isExpired()) { // 已过时的数据,需要重新解析一次。
try {
// 若未出现错误,则直接更新缓存并返回。
return updateCache(getBukkitConfig().get(getConfigPath(), getDefaultValue(), valueClass));
} catch (Exception e) {
// 出现了解析错误,提示并返回默认值。
e.printStackTrace();
return useDefault();
}
} else return Optional.ofNullable(getCachedValue()).orElse(defaultValue);
}
@Override
public void set(@Nullable T value) {
updateCache(value);
setValue(value);
}
}
@@ -1,77 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.value;
import cc.carm.lib.configuration.core.function.ConfigValueParser;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import cc.carm.lib.configuration.core.value.type.ConfiguredValue;
import cc.carm.lib.mineconfiguration.bukkit.CraftConfigValue;
import cc.carm.lib.mineconfiguration.bukkit.builder.sound.SoundConfigBuilder;
import cc.carm.lib.mineconfiguration.bukkit.data.SoundConfig;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Optional;
public class ConfiguredSound extends ConfiguredValue<SoundConfig> {
public static @NotNull SoundConfigBuilder create() {
return CraftConfigValue.builder().createSound();
}
public static @NotNull ConfiguredSound of(Sound sound) {
return CraftConfigValue.builder().createSound().defaults(sound).build();
}
public static @NotNull ConfiguredSound of(Sound sound, float volume) {
return CraftConfigValue.builder().createSound().defaults(sound, volume).build();
}
public static @NotNull ConfiguredSound of(Sound sound, float volume, float pitch) {
return CraftConfigValue.builder().createSound().defaults(sound, volume, pitch).build();
}
public static @NotNull ConfiguredSound of(String soundName) {
return CraftConfigValue.builder().createSound().defaults(soundName).build();
}
public static @NotNull ConfiguredSound of(String soundName, float volume) {
return CraftConfigValue.builder().createSound().defaults(soundName, volume).build();
}
public static @NotNull ConfiguredSound of(String soundName, float volume, float pitch) {
return CraftConfigValue.builder().createSound().defaults(soundName, volume, pitch).build();
}
public ConfiguredSound(@Nullable ConfigurationProvider<?> provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@Nullable SoundConfig defaultValue) {
super(provider, sectionPath, headerComments, inlineComments, SoundConfig.class, defaultValue, getSoundParser(), SoundConfig::serialize);
}
public void setSound(@NotNull Sound sound) {
setSound(sound, 1.0f);
}
public void setSound(@NotNull Sound sound, float volume) {
setSound(sound, volume, 1.0f);
}
public void setSound(@NotNull Sound sound, float volume, float pitch) {
set(new SoundConfig(sound.name(), sound, volume, pitch));
}
public void playTo(@NotNull Player player) {
Optional.ofNullable(get()).ifPresent(c -> c.playTo(player));
}
public void playToAll() {
Optional.ofNullable(get()).ifPresent(SoundConfig::playToAll);
}
public static ConfigValueParser<Object, SoundConfig> getSoundParser() {
return ConfigValueParser.castToString().andThen((s, d) -> SoundConfig.deserialize(s));
}
}
@@ -1,109 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.value;
import cc.carm.lib.mineconfiguration.bukkit.CraftConfigValue;
import cc.carm.lib.mineconfiguration.bukkit.data.TitleConfig;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import cc.carm.lib.configuration.core.function.ConfigValueParser;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import cc.carm.lib.configuration.core.source.ConfigurationWrapper;
import cc.carm.lib.configuration.core.value.type.ConfiguredSection;
import cc.carm.lib.mineconfiguration.bukkit.builder.title.TitleConfigBuilder;
import cc.carm.lib.mineconfiguration.bukkit.function.TitleSendConsumer;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Range;
import java.util.List;
import java.util.Map;
public class ConfiguredTitle extends ConfiguredSection<TitleConfig> {
public static TitleConfigBuilder create() {
return CraftConfigValue.builder().createTitle();
}
public static ConfiguredTitle of(@Nullable String line1, @Nullable String line2) {
return create().defaults(line1, line2).build();
}
public static ConfiguredTitle of(@Nullable String line1, @Nullable String line2,
int fadeIn, int stay, int fadeOut) {
return create().defaults(line1, line2).fadeIn(fadeIn).stay(stay).fadeOut(fadeOut).build();
}
protected final @NotNull TitleSendConsumer sendConsumer;
protected final @NotNull String[] params;
protected final int fadeIn;
protected final int stay;
protected final int fadeOut;
public ConfiguredTitle(@Nullable ConfigurationProvider<?> provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@Nullable TitleConfig defaultValue, @NotNull String[] params,
@NotNull TitleSendConsumer sendConsumer,
int fadeIn, int stay, int fadeOut) {
super(provider, sectionPath, headerComments, inlineComments, TitleConfig.class, defaultValue, getTitleParser(), TitleConfig::serialize);
this.sendConsumer = sendConsumer;
this.params = params;
this.fadeIn = fadeIn;
this.stay = stay;
this.fadeOut = fadeOut;
}
@Range(from = 0L, to = Integer.MAX_VALUE)
public int getFadeInTicks() {
return fadeIn;
}
@Range(from = 0L, to = Integer.MAX_VALUE)
public int getStayTicks() {
return stay;
}
@Range(from = 0L, to = Integer.MAX_VALUE)
public int getFadeOutTicks() {
return fadeOut;
}
public @NotNull TitleSendConsumer getSendConsumer() {
return sendConsumer;
}
public void send(@NotNull Player player, Object... values) {
send(player, this.params, values);
}
public void send(@NotNull Player player, @NotNull String[] params, @NotNull Object[] values) {
send(player, ParamsUtils.buildParams(params, values));
}
public void send(@NotNull Player player, @NotNull Map<String, Object> placeholders) {
TitleConfig config = get();
if (config != null) {
config.send(player, fadeIn, stay, fadeOut, placeholders, sendConsumer);
}
}
public void sendAll(Object... values) {
sendAll(this.params, values);
}
public void sendAll(@NotNull String[] params, @NotNull Object[] values) {
sendAll(ParamsUtils.buildParams(params, values));
}
public void sendAll(@NotNull Map<String, Object> placeholders) {
TitleConfig config = get();
if (config == null) return;
Bukkit.getOnlinePlayers().forEach(onlinePlayer -> send(onlinePlayer, placeholders));
}
public static ConfigValueParser<ConfigurationWrapper, TitleConfig> getTitleParser() {
return (s, d) -> TitleConfig.deserialize(s);
}
}
-51
View File
@@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>mineconfiguration-bukkit</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<artifactId>mineconfiguration-bukkit-general</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>mineconfiguration-bukkit-base</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
@@ -1,41 +0,0 @@
package cc.carm.lib.mineconfiguration;
import cc.carm.lib.mineconfiguration.bukkit.source.BukkitConfigProvider;
import org.bukkit.plugin.Plugin;
import java.io.File;
import java.io.IOException;
public class MineConfiguration {
public static BukkitConfigProvider from(File file, String source) {
BukkitConfigProvider provider = new BukkitConfigProvider(file);
try {
provider.initializeFile(source);
provider.initializeConfig();
} catch (IOException e) {
e.printStackTrace();
}
return provider;
}
public static BukkitConfigProvider from(File file) {
return from(file, file.getName());
}
public static BukkitConfigProvider from(String fileName) {
return from(fileName, fileName);
}
public static BukkitConfigProvider from(String fileName, String source) {
return from(new File(fileName), source);
}
public static BukkitConfigProvider from(Plugin plugin, String fileName) {
return from(plugin, fileName, fileName);
}
public static BukkitConfigProvider from(Plugin plugin, String fileName, String source) {
return from(new File(plugin.getDataFolder(), fileName), source);
}
}
@@ -1,72 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.source;
import cc.carm.lib.configuration.core.ConfigInitializer;
import org.bukkit.configuration.file.YamlConfiguration;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Unmodifiable;
import java.io.BufferedWriter;
import java.io.File;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
public class BukkitConfigProvider extends CraftConfigProvider {
protected static final char SEPARATOR = '.';
protected BukkitYAMLComments bukkitComments = new BukkitYAMLComments();
public BukkitConfigProvider(@NotNull File file) {
super(file);
}
public void initializeConfig() {
this.configuration = YamlConfiguration.loadConfiguration(file);
this.initializer = new ConfigInitializer<>(this);
}
@Override
public @NotNull CraftSectionWrapper getConfiguration() {
return CraftSectionWrapper.of(this.configuration);
}
@Override
public void save() throws Exception {
configuration.save(getFile());
StringWriter writer = new StringWriter();
this.bukkitComments.writeComments(configuration, new BufferedWriter(writer));
String value = writer.toString(); // config contents
Path toUpdatePath = getFile().toPath();
if (!value.equals(new String(Files.readAllBytes(toUpdatePath), StandardCharsets.UTF_8))) {
Files.write(toUpdatePath, value.getBytes(StandardCharsets.UTF_8));
}
}
@Override
public void setHeaderComment(@Nullable String path, @Nullable List<String> comments) {
this.bukkitComments.setHeaderComments(path, comments);
}
@Override
public void setInlineComment(@NotNull String path, @Nullable String comment) {
this.bukkitComments.setInlineComment(path, comment);
}
@Override
@Nullable
@Unmodifiable
public List<String> getHeaderComment(@Nullable String path) {
return this.bukkitComments.getHeaderComment(path);
}
@Override
public @Nullable String getInlineComment(@NotNull String path) {
return this.bukkitComments.getInlineComment(path);
}
}
@@ -1,146 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.source;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Unmodifiable;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class BukkitYAMLComments {
protected final @NotNull Map<String, List<String>> headerComments = new HashMap<>();
protected final @NotNull Map<String, String> inlineComments = new HashMap<>();
protected @NotNull Map<String, List<String>> getHeaderComments() {
return headerComments;
}
protected @NotNull Map<String, String> getInlineComments() {
return inlineComments;
}
public void setHeaderComments(@Nullable String path, @Nullable List<String> comments) {
if (comments == null) {
getHeaderComments().remove(path);
} else {
getHeaderComments().put(path, comments);
}
}
public void setInlineComment(@NotNull String path, @Nullable String comment) {
if (comment == null) {
getInlineComments().remove(path);
} else {
getInlineComments().put(path, comment);
}
}
@Nullable
@Unmodifiable
public List<String> getHeaderComment(@Nullable String path) {
return Optional.ofNullable(getHeaderComments().get(path)).map(Collections::unmodifiableList).orElse(null);
}
public @Nullable String getInlineComment(@NotNull String path) {
return getInlineComments().get(path);
}
public @Nullable String buildHeaderComments(@Nullable String path, @NotNull String indents) {
List<String> comments = getHeaderComment(path);
if (comments == null || comments.size() == 0) return null;
StringJoiner joiner = new StringJoiner("\n");
for (String comment : comments) {
if (comment.length() == 0) joiner.add(" ");
else joiner.add(indents + "# " + comment);
}
return joiner + "\n";
}
/**
* 从一个文件读取配置并写入注释到某个写入器中。
* 该方法的部分源代码借鉴自 tchristofferson/ConfigUpdater 项目。
*
* @param source 源配置文件
* @param writer 配置写入器
* @throws IOException 当写入发生错误时抛出
*/
public void writeComments(@NotNull YamlConfiguration source, @NotNull BufferedWriter writer) throws IOException {
FileConfiguration temp = new YamlConfiguration(); // 该对象用于临时记录配置内容
String configHeader = buildHeaderComments(null, "");
if (configHeader != null) writer.write(configHeader);
for (String fullKey : source.getKeys(true)) {
Object currentValue = source.get(fullKey);
String indents = getIndents(fullKey);
String headerComments = buildHeaderComments(fullKey, indents);
String inlineComment = getInlineComment(fullKey);
if (headerComments != null) writer.write(headerComments);
String[] splitFullKey = fullKey.split("[" + CraftConfigProvider.SEPARATOR + "]");
String trailingKey = splitFullKey[splitFullKey.length - 1];
if (currentValue instanceof ConfigurationSection) {
ConfigurationSection section = (ConfigurationSection) currentValue;
writer.write(indents + trailingKey + ":");
if (inlineComment != null && inlineComment.length() > 0) {
writer.write(" # " + inlineComment);
}
if (!section.getKeys(false).isEmpty()) {
writer.write("\n");
} else {
writer.write(" {}\n");
if (indents.length() == 0) writer.write("\n");
}
continue;
}
temp.set(trailingKey, currentValue);
String yaml = temp.saveToString();
temp.set(trailingKey, null);
yaml = yaml.substring(0, yaml.length() - 1);
if (inlineComment != null && inlineComment.length() > 0) {
if (yaml.contains("\n")) {
// section为多行内容,需要 InlineComment 加在首行末尾
String[] splitLine = yaml.split("\n", 2);
yaml = splitLine[0] + " # " + inlineComment + "\n" + splitLine[1];
} else {
// 其他情况下就直接加载后面就好。
yaml += " # " + inlineComment;
}
}
writer.write(indents + yaml.replace("\n", "\n" + indents) + "\n");
if (indents.length() == 0) writer.write("\n");
}
writer.close();
}
/**
* 得到一个键的缩进。
* 该方法的源代码来自 tchristofferson/ConfigUpdater 项目。
*
* @param key 键
* @return 该键的缩进文本
*/
protected static String getIndents(String key) {
String[] splitKey = key.split("[" + BukkitConfigProvider.SEPARATOR + "]");
return IntStream.range(1, splitKey.length).mapToObj(i -> " ").collect(Collectors.joining());
}
}
-59
View File
@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>mineconfiguration-bukkit</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<artifactId>mineconfiguration-bukkit-native</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>mineconfiguration-bukkit-base</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
@@ -1,42 +0,0 @@
package cc.carm.lib.mineconfiguration;
import cc.carm.lib.mineconfiguration.bukkit.source.SpigotConfigProvider;
import org.bukkit.plugin.Plugin;
import java.io.File;
import java.io.IOException;
public class MineConfiguration {
public static SpigotConfigProvider from(File file, String source) {
SpigotConfigProvider provider = new SpigotConfigProvider(file);
try {
provider.initializeFile(source);
provider.initializeConfig();
} catch (IOException e) {
e.printStackTrace();
}
return provider;
}
public static SpigotConfigProvider from(File file) {
return from(file, file.getName());
}
public static SpigotConfigProvider from(String fileName) {
return from(fileName, fileName);
}
public static SpigotConfigProvider from(String fileName, String source) {
return from(new File(fileName), source);
}
public static SpigotConfigProvider from(Plugin plugin, String fileName) {
return from(plugin, fileName, fileName);
}
public static SpigotConfigProvider from(Plugin plugin, String fileName, String source) {
return from(new File(plugin.getDataFolder(), fileName), source);
}
}
@@ -1,53 +0,0 @@
package cc.carm.lib.mineconfiguration.bukkit.source;
import cc.carm.lib.configuration.core.ConfigInitializer;
import org.bukkit.configuration.file.YamlConfiguration;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Unmodifiable;
import java.io.File;
import java.util.Collections;
import java.util.List;
public class SpigotConfigProvider extends CraftConfigProvider {
public SpigotConfigProvider(@NotNull File file) {
super(file);
}
@Override
public void initializeConfig() {
this.configuration = YamlConfiguration.loadConfiguration(file);
this.initializer = new ConfigInitializer<>(this);
}
@Override
public void setHeaderComment(@Nullable String path, @Nullable List<String> comments) {
if (path == null) {
this.configuration.options().setHeader(comments);
} else {
this.configuration.setComments(path, comments);
}
}
@Override
public void setInlineComment(@NotNull String path, @Nullable String comment) {
if (comment == null) {
this.configuration.setInlineComments(path, null);
} else {
this.configuration.setComments(path, Collections.singletonList(comment));
}
}
@Override
public @Nullable @Unmodifiable List<String> getHeaderComment(@Nullable String path) {
if (path == null) return Collections.unmodifiableList(this.configuration.options().getHeader());
else return this.configuration.getComments(path);
}
@Override
public @Nullable String getInlineComment(@NotNull String path) {
return String.join(" ", this.configuration.getInlineComments(path));
}
}
+47 -20
View File
@@ -5,31 +5,57 @@
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.4.2</version>
<version>3.1.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${project.jdk.version}</maven.compiler.source>
<maven.compiler.target>${project.jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<artifactId>mineconfiguration-bukkit</artifactId>
<packaging>pom</packaging>
<modules>
<module>base</module>
<module>general</module>
<module>native</module>
</modules>
<packaging>jar</packaging>
<name>MineConfiguration-Bukkit</name>
<description>EasyConfiguration for Bukkit.</description>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>mineconfiguration-common</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>yamlcommentwriter</artifactId>
<version>${deps.yamlcommentwriter.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>13.6.0</version>
<scope>compile</scope>
</dependency>
<!--suppress VulnerableLibrariesLocal -->
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-chat</artifactId>
<version>1.21-R0.4</version>
<scope>provided</scope>
</dependency>
@@ -37,18 +63,19 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.1</version>
<scope>provided</scope>
</dependency>
<!--ProtocolLib for general packet's function support-->
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.8.0</version>
<version>2.11.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,52 @@
package cc.carm.lib.mineconfiguration.bukkit;
import cc.carm.lib.configuration.Configuration;
import cc.carm.lib.configuration.source.ConfigurationHolder;
import cc.carm.lib.mineconfiguration.bukkit.source.BukkitConfigFactory;
import cc.carm.lib.mineconfiguration.bukkit.source.BukkitSource;
import cc.carm.lib.mineconfiguration.common.AbstractConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
public class MineConfiguration extends AbstractConfiguration<ConfigurationHolder<BukkitSource>> {
public static ConfigurationHolder<BukkitSource> from(@NotNull File file,
@Nullable String source) {
return BukkitConfigFactory.from(file).resourcePath(source).build();
}
public static ConfigurationHolder<BukkitSource> from(@NotNull Plugin plugin,
@NotNull String fileName) {
return from(plugin, fileName, null);
}
public static ConfigurationHolder<BukkitSource> from(@NotNull Plugin plugin,
@NotNull String fileName, @Nullable String resource) {
return from(new File(plugin.getDataFolder(), fileName), resource);
}
public MineConfiguration(@NotNull JavaPlugin plugin) {
super(from(plugin, "config.yml"), from(plugin, "messages.yml"));
}
public MineConfiguration(@NotNull JavaPlugin plugin,
@NotNull Configuration configRoot,
@NotNull Configuration messageRoot) {
this(plugin);
initializeConfig(configRoot);
initializeMessage(messageRoot);
}
public MineConfiguration(@NotNull JavaPlugin plugin,
@NotNull Class<? extends Configuration> configRoot,
@NotNull Class<? extends Configuration> messageRoot) {
this(plugin);
initializeConfig(configRoot);
initializeMessage(messageRoot);
}
}
@@ -0,0 +1,53 @@
package cc.carm.lib.mineconfiguration.bukkit.data;
import cc.carm.lib.mineconfiguration.bukkit.value.notify.type.NotifyCache;
import cc.carm.lib.mineconfiguration.bukkit.value.notify.type.NotifyType;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import java.util.Optional;
public class NotifyConfig {
public static @Nullable NotifyConfig deserialize(@NotNull String config) {
return Optional.ofNullable(NotifyCache.deserialize(config)).map(NotifyConfig::of).orElse(null);
}
public static @NotNull NotifyConfig of(@NotNull NotifyCache<?, ?> cache) {
return new NotifyConfig(cache);
}
public static @Nullable NotifyConfig of(@NotNull String key, @Nullable String param, @Nullable String content) {
return Optional.ofNullable(NotifyCache.of(key, param, content)).map(NotifyConfig::of).orElse(null);
}
public static <T extends NotifyType<M>, M> NotifyConfig of(@NotNull T type, @Nullable String param, @Nullable String content) {
return of(type, type.parseMeta(param, content));
}
public static <T extends NotifyType<M>, M> NotifyConfig of(@NotNull T type, @Nullable M meta) {
return of(NotifyCache.of(type, meta));
}
protected final @NotNull NotifyCache<?, ?> cache;
public NotifyConfig(@NotNull NotifyCache<?, ?> cache) {
this.cache = cache;
}
public @NotNull NotifyCache<?, ?> getCache() {
return cache;
}
public void execute(@NotNull Player player, @NotNull Map<String, Object> placeholders) {
getCache().execute(player, placeholders);
}
public String serialize() {
return getCache().serialize();
}
}
@@ -1,6 +1,7 @@
package cc.carm.lib.mineconfiguration.bukkit.data;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Contract;
@@ -35,15 +36,29 @@ public class SoundConfig {
this.pitch = pitch;
}
public void playTo(Player player) {
public void playTo(@NotNull Player player) {
playTo(player, player.getLocation());
}
public void playTo(@NotNull Player player, @NotNull Location location) {
if (type == null) return;
player.playSound(player.getLocation(), type, volume, pitch);
player.playSound(location, type, volume, pitch);
}
public void playAt(@NotNull Location location) {
if (type == null) return;
if (location.getWorld() == null) return;
location.getWorld().playSound(location, type, volume, pitch);
}
public void playToAll() {
Bukkit.getOnlinePlayers().forEach(this::playTo);
}
public void playToAll(@NotNull Location location) {
Bukkit.getOnlinePlayers().forEach(player -> playTo(player, location));
}
public @NotNull String getTypeName() {
return typeName;
}
@@ -85,7 +100,7 @@ public class SoundConfig {
@Contract("null -> null")
public static @Nullable SoundConfig deserialize(@Nullable String string) throws Exception {
if (string == null) return null;
if (string == null || string.isEmpty()) return null;
String[] args = string.contains(":") ? string.split(":") : new String[]{string};
if (args.length < 1) return null;
@@ -0,0 +1,147 @@
package cc.carm.lib.mineconfiguration.bukkit.data;
import cc.carm.lib.configuration.source.section.ConfigureSection;
import cc.carm.lib.configuration.value.text.PreparedText;
import cc.carm.lib.mineconfiguration.bukkit.utils.MessageUtils;
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredTitle;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Range;
import java.util.LinkedHashMap;
import java.util.Map;
public class TitleConfig {
public static @NotNull TitleConfig of(@Nullable String line1, @Nullable String line2) {
return new TitleConfig(line1, line2);
}
public static @NotNull TitleConfig of(@Nullable String line1, @Nullable String line2,
int fadeIn, int stay, int fadeOut) {
return new TitleConfig(line1, line2, fadeIn, stay, fadeOut);
}
protected @Nullable String line1;
protected @Nullable String line2;
protected @Range(from = 0L, to = Integer.MAX_VALUE) int fadeIn = 10;
protected @Range(from = 0L, to = Integer.MAX_VALUE) int stay = 60;
protected @Range(from = 0L, to = Integer.MAX_VALUE) int fadeOut = 10;
protected TitleConfig(@Nullable String line1, @Nullable String line2) {
this.line1 = line1;
this.line2 = line2;
}
protected TitleConfig(@Nullable String line1, @Nullable String line2, int fadeIn, int stay, int fadeOut) {
this.line1 = line1;
this.line2 = line2;
this.fadeIn = fadeIn;
this.stay = stay;
this.fadeOut = fadeOut;
}
public int stay() {
return stay;
}
public void stay(int stay) {
this.stay = stay;
}
public @Nullable String line1() {
return line1;
}
public void line1(@Nullable String line1) {
this.line1 = line1;
}
public @Nullable String line2() {
return line2;
}
public void line2(@Nullable String line2) {
this.line2 = line2;
}
public int fadeIn() {
return fadeIn;
}
public void fadeIn(int fadeIn) {
this.fadeIn = fadeIn;
}
public int fadeOut() {
return fadeOut;
}
public void fadeOut(int fadeOut) {
this.fadeOut = fadeOut;
}
public boolean isStandardTime() {
return this.fadeIn == 10 && this.stay == 60 && this.fadeOut == 10;
}
public void send(@NotNull Player player,
@NotNull Map<String, Object> placeholders,
@Nullable ConfiguredTitle.TitleConsumer sendConsumer) {
send(
player,
this.fadeIn < 0 ? 10 : this.fadeIn,
this.stay < 0 ? 60 : this.stay,
this.fadeOut < 0 ? 10 : this.fadeOut,
placeholders,
sendConsumer
);
}
public void send(@NotNull Player player,
@Range(from = 0L, to = Integer.MAX_VALUE) int fadeIn,
@Range(from = 0L, to = Integer.MAX_VALUE) int stay,
@Range(from = 0L, to = Integer.MAX_VALUE) int fadeOut,
@NotNull Map<String, Object> placeholders,
@Nullable ConfiguredTitle.TitleConsumer sendConsumer) {
if (this.line1 == null && this.line2 == null) return;
if (sendConsumer == null) return;
sendConsumer.send(
player, fadeIn, stay, fadeOut,
parseLine(player, this.line1, placeholders),
parseLine(player, this.line2, placeholders)
);
}
protected @NotNull String parseLine(@NotNull Player player, @Nullable String text,
@NotNull Map<String, Object> placeholders) {
return text == null ? "" : MessageUtils.parseMessage(player, PreparedText.setPlaceholders(text, placeholders));
}
public @NotNull Map<String, Object> serialize() {
Map<String, Object> map = new LinkedHashMap<>();
if (this.line1 != null) map.put("line1", this.line1);
if (this.line2 != null) map.put("line2", this.line2);
if (this.fadeIn > 0 && this.fadeIn != 10) map.put("fadeIn", this.fadeIn);
if (this.stay > 0 && this.stay != 60) map.put("stay", this.stay);
if (this.fadeOut > 0 && this.fadeOut != 10) map.put("fadeOut", this.fadeOut);
return map;
}
public static @Nullable TitleConfig deserialize(@NotNull ConfigureSection section) {
String line1 = section.getString("line1");
String line2 = section.getString("line2");
if (line1 == null && line2 == null) return null;
return of(
line1, line2,
section.getInt("fadeIn", -1),
section.getInt("stay", -1),
section.getInt("fadeOut", -1)
);
}
}
@@ -0,0 +1,57 @@
package cc.carm.lib.mineconfiguration.bukkit.source;
import cc.carm.lib.configuration.commentable.Commentable;
import cc.carm.lib.configuration.source.ConfigurationHolder;
import cc.carm.lib.configuration.source.file.FileConfigFactory;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import java.io.File;
public class BukkitConfigFactory extends FileConfigFactory<BukkitSource, ConfigurationHolder<BukkitSource>, BukkitConfigFactory> {
public static BukkitConfigFactory from(@NotNull String path) {
return new BukkitConfigFactory(new File(path));
}
public static BukkitConfigFactory from(@NotNull File file) {
return new BukkitConfigFactory(file);
}
public static BukkitConfigFactory from(@NotNull File parent, @NotNull String configName) {
return new BukkitConfigFactory(new File(parent, configName));
}
public static BukkitConfigFactory from(@NotNull Plugin plugin, @NotNull String configName) {
return from(plugin.getDataFolder(), configName);
}
public BukkitConfigFactory(@NotNull File file) {
super(file);
}
@Override
protected BukkitConfigFactory self() {
return this;
}
@Override
public @NotNull ConfigurationHolder<BukkitSource> build() {
File configFile = this.file;
String sourcePath = this.resourcePath;
Commentable.registerMeta(this.initializer); // Register commentable meta types
return new ConfigurationHolder<BukkitSource>(this.adapters, this.options, this.metadata, this.initializer) {
final @NotNull BukkitSource source = new BukkitSource(this, configFile, sourcePath);
@Override
public @NotNull BukkitSource config() {
return this.source;
}
};
}
}
@@ -0,0 +1,135 @@
package cc.carm.lib.mineconfiguration.bukkit.source;
import cc.carm.lib.configuration.source.section.ConfigureSection;
import org.bukkit.configuration.ConfigurationSection;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.UnmodifiableView;
import java.util.*;
public class BukkitSection implements ConfigureSection {
protected final @NotNull BukkitSource source;
protected final @Nullable BukkitSection parent;
protected final @NotNull String path;
protected final @NotNull ConfigurationSection data;
public BukkitSection(@NotNull BukkitSource source, @Nullable BukkitSection parent,
@NotNull String path, @NotNull ConfigurationSection data) {
this.source = source;
this.parent = parent;
this.path = path;
this.data = data;
}
public @NotNull BukkitSource source() {
return this.source;
}
@Override
public @Nullable BukkitSection parent() {
return this.parent;
}
@Override
public @NotNull String path() {
return this.path;
}
public @NotNull ConfigurationSection data() {
return this.data;
}
@Override
public @NotNull Set<String> getKeys(boolean deep) {
return data().getKeys(deep);
}
@Override
public @NotNull @UnmodifiableView Map<String, Object> getValues(boolean deep) {
Map<String, Object> original = data().getValues(deep);
// wrap all ConfigurationSection
for (Map.Entry<String, Object> entry : original.entrySet()) {
if (entry.getValue() instanceof ConfigurationSection) {
original.put(entry.getKey(), createSection(entry.getKey(), (ConfigurationSection) entry.getValue()));
}
}
return Collections.unmodifiableMap(original);
}
public Map<String, Object> toMap(ConfigurationSection section) {
Map<String, Object> map = new LinkedHashMap<>();
for (String key : section.getKeys(false)) {
Object value = section.get(key);
if (value instanceof ConfigurationSection) {
map.put(key, toMap((ConfigurationSection) value));
} else if (value instanceof BukkitSection) {
map.put(key, toMap(((BukkitSection) value).data()));
} else if (value instanceof List<?>) {
List<Object> list = new ArrayList<>();
for (Object o : (List<?>) value) {
if (o instanceof ConfigurationSection) {
list.add(toMap((ConfigurationSection) o));
} else if (o instanceof BukkitSection) {
list.add(toMap(((BukkitSection) o).data()));
} else {
list.add(o);
}
}
map.put(key, list);
} else {
map.put(key, value);
}
}
return map;
}
@Override
public @NotNull @UnmodifiableView Map<String, Object> asMap() {
return toMap(data());
}
@Override
public void set(@NotNull String path, @Nullable Object value) {
if (value instanceof BukkitSection) { // unwrap
value = ((BukkitSection) value).data();
}
data().set(path, value);
}
@Override
public void remove(@NotNull String path) {
data().set(path, null);
}
@Override
public @Nullable ConfigureSection getSection(@NotNull String path) {
Object value = get(path);
if (value instanceof ConfigureSection) {
return (ConfigureSection) value;
}
return null;
}
public @NotNull BukkitSection createSection(@NotNull String path, @NotNull ConfigurationSection section) {
return new BukkitSection(source(), this, path, section);
}
@Override
public @NotNull BukkitSection createSection(@NotNull String path, @NotNull Map<?, ?> data) {
return createSection(path, data().createSection(path, data));
}
@Override
public @Nullable Object get(@NotNull String path) {
Object value = data().get(path);
if (value instanceof ConfigurationSection) { // wrap
return createSection(path, (ConfigurationSection) value);
}
return value;
}
}
@@ -0,0 +1,109 @@
package cc.carm.lib.mineconfiguration.bukkit.source;
import cc.carm.lib.configuration.commentable.Commentable;
import cc.carm.lib.configuration.commentable.CommentableOptions;
import cc.carm.lib.configuration.source.ConfigurationHolder;
import cc.carm.lib.configuration.source.file.FileConfigSource;
import cc.carm.lib.configuration.source.section.ConfigureSection;
import cc.carm.lib.yamlcommentupdater.CommentedSection;
import cc.carm.lib.yamlcommentupdater.CommentedYAMLWriter;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.util.List;
import java.util.Objects;
import java.util.Set;
public class BukkitSource extends FileConfigSource<BukkitSection, YamlConfiguration, BukkitSource>
implements CommentedSection {
protected @Nullable BukkitSection rootSection;
public BukkitSource(@NotNull ConfigurationHolder<? extends BukkitSource> holder,
@NotNull File file, @Nullable String resourcePath) {
super(holder, System.currentTimeMillis(), file, resourcePath);
initialize();
}
public void initialize() {
try {
initializeFile();
onReload();
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
protected @NotNull BukkitSource self() {
return this;
}
@Override
public @NotNull YamlConfiguration original() {
return (YamlConfiguration) section().data(); // #data() of Root Section always returns YamlConfiguration
}
@Override
public @NotNull BukkitSection section() {
return Objects.requireNonNull(rootSection, "Root section has not been initialized");
}
@Override
public void save() throws Exception {
CommentedYAMLWriter writer = new CommentedYAMLWriter(
String.valueOf(this.pathSeparator()), 2,
holder.options().get(CommentableOptions.COMMENT_EMPTY_VALUE)
);
try {
fileWriter(w -> w.write(writer.saveToString(this)));
} catch (Exception ex) {
fileWriter(w -> w.write(original().saveToString()));
}
}
@Override
protected void onReload() throws Exception {
YamlConfiguration configuration = fileReader(YamlConfiguration::loadConfiguration);
this.rootSection = new BukkitSection(this, null, "", configuration);
}
@Override
public String serializeValue(@NotNull String key, @NotNull Object value) {
FileConfiguration temp = new YamlConfiguration();
temp.set(key, value);
return temp.saveToString();
}
@Override
public @Nullable Set<String> getKeys(@Nullable String sectionKey, boolean deep) {
if (sectionKey == null) return section().getKeys(deep);
ConfigureSection sub = section().getSection(sectionKey);
if (sub == null) return null;
return sub.getKeys(deep);
}
@Override
public @Nullable Object getValue(@NotNull String key) {
return get(key);
}
@Override
public @Nullable String getInlineComment(@NotNull String key) {
return Commentable.getInlineComment(holder(), key);
}
@Override
public @Nullable List<String> getHeaderComments(@Nullable String key) {
return Commentable.getHeaderComments(holder(), key);
}
@Override
public @Nullable List<String> getFooterComments(@Nullable String key) {
return Commentable.getFooterComments(holder(), key);
}
}
@@ -1,7 +1,6 @@
package cc.carm.lib.mineconfiguration.bukkit.utils;
import cc.carm.lib.mineconfiguration.common.utils.ColorParser;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import cc.carm.lib.easyplugin.utils.ColorParser;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -10,25 +9,26 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class TextParser {
public class MessageUtils {
@Contract("_,!null,_->!null")
public static @Nullable String parseText(@Nullable CommandSender sender, @Nullable String message, @NotNull Map<String, Object> placeholders) {
private MessageUtils() {
}
@Contract("_,!null->!null")
public static @Nullable String parseMessage(@Nullable CommandSender sender, @Nullable String message) {
if (message == null) return null;
if (sender instanceof Player && hasPlaceholderAPI()) {
message = PlaceholderAPIHelper.parseMessages((Player) sender, message);
}
return ColorParser.parse(ParamsUtils.setPlaceholders(message, placeholders));
return ColorParser.parse(message);
}
public static @NotNull List<String> parseList(@Nullable CommandSender sender, List<String> messages, @NotNull Map<String, Object> placeholders) {
public static @NotNull List<String> parseMessage(@Nullable CommandSender sender, @NotNull List<String> messages) {
if (sender instanceof Player && hasPlaceholderAPI()) {
messages = PlaceholderAPIHelper.parseMessages((Player) sender, messages);
}
return ColorParser.parse(messages.stream().map(s -> ParamsUtils.setPlaceholders(s, placeholders)).collect(Collectors.toList()));
return ColorParser.parse(messages);
}
public static boolean hasPlaceholderAPI() {
@@ -7,6 +7,9 @@ import java.util.List;
public class PlaceholderAPIHelper {
private PlaceholderAPIHelper() {
}
public static String parseMessages(Player player, String message) {
try {
return PlaceholderAPI.setPlaceholders(player, message);
@@ -0,0 +1,71 @@
package cc.carm.lib.mineconfiguration.bukkit.value;
import cc.carm.lib.configuration.value.ValueManifest;
import cc.carm.lib.configuration.value.text.ConfiguredText;
import cc.carm.lib.configuration.value.text.data.TextContents;
import cc.carm.lib.mineconfiguration.bukkit.utils.MessageUtils;
import com.cryptomorin.xseries.messages.ActionBar;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
public class ConfiguredMessage<M> extends ConfiguredText<M, CommandSender> {
@NotNull
public static <M> ConfiguredMessage.Builder<M> create(
@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> compiler
) {
return new Builder<M>().compiler(compiler);
}
public static Builder<String> asString() {
return create((sender, message) -> message)
.parser(MessageUtils::parseMessage)
.dispatcher((sender, message) -> message.forEach(sender::sendMessage));
}
public static ConfiguredMessage<String> ofString() {
return asString().build();
}
public static ConfiguredMessage<String> ofString(@NotNull String... messages) {
return asString().defaults(messages).build();
}
public ConfiguredMessage(@NotNull ValueManifest<TextContents, TextContents> manifest,
@NotNull BiFunction<CommandSender, String, String> parser,
@NotNull BiFunction<CommandSender, String, M> compiler,
@NotNull BiConsumer<CommandSender, List<M>> dispatcher,
@NotNull String[] params) {
super(manifest, parser, compiler, dispatcher, params);
}
public void sendActionBar(@NotNull Player player, Object... values) {
ActionBar.sendActionBar(player, (String) prepare(values).parseLine(player, (sender, message) -> message));
}
public void print(Object... values) {
prepare(values).to(Bukkit.getConsoleSender());
}
public static class Builder<M> extends ConfiguredText.Builder<M, CommandSender, Builder<M>> {
@Override
public @NotNull ConfiguredMessage<M> build() {
return new ConfiguredMessage<>(buildManifest(), this.parser, this.compiler, this.dispatcher, this.params);
}
@Override
public @NotNull ConfiguredMessage.Builder<M> self() {
return this;
}
}
}
@@ -0,0 +1,135 @@
package cc.carm.lib.mineconfiguration.bukkit.value;
import cc.carm.lib.configuration.adapter.ValueAdapter;
import cc.carm.lib.configuration.adapter.ValueType;
import cc.carm.lib.configuration.builder.AbstractConfigBuilder;
import cc.carm.lib.configuration.source.ConfigurationHolder;
import cc.carm.lib.configuration.value.ValueManifest;
import cc.carm.lib.configuration.value.standard.ConfiguredValue;
import cc.carm.lib.mineconfiguration.bukkit.data.SoundConfig;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.Optional;
public class ConfiguredSound extends ConfiguredValue<SoundConfig> {
public static @NotNull Builder create() {
return new Builder();
}
public static @NotNull ConfiguredSound of(Sound sound) {
return create().defaults(sound).build();
}
public static @NotNull ConfiguredSound of(Sound sound, float volume) {
return create().defaults(sound, volume).build();
}
public static @NotNull ConfiguredSound of(Sound sound, float volume, float pitch) {
return create().defaults(sound, volume, pitch).build();
}
public static @NotNull ConfiguredSound of(String soundName) {
return create().defaults(soundName).build();
}
public static @NotNull ConfiguredSound of(String soundName, float volume) {
return create().defaults(soundName, volume).build();
}
public static @NotNull ConfiguredSound of(String soundName, float volume, float pitch) {
return create().defaults(soundName, volume, pitch).build();
}
public static final ValueType<SoundConfig> SOUND_TYPE = ValueType.of(SoundConfig.class);
public static final ValueAdapter<SoundConfig> SOUND_ADAPTER = new ValueAdapter<>(SOUND_TYPE,
(holder, type, value) -> value.serialize(),
(holder, type, value) -> {
String conf = holder.deserialize(String.class, value);
return SoundConfig.deserialize(conf);
}
);
public ConfiguredSound(@NotNull ValueManifest<SoundConfig, SoundConfig> manifest, @NotNull ValueAdapter<SoundConfig> adapter) {
super(manifest, adapter);
}
public void set(@NotNull Sound sound) {
set(sound, 1.0f);
}
public void set(@NotNull Sound sound, float volume) {
set(sound, volume, 1.0f);
}
public void set(@NotNull Sound sound, float volume, float pitch) {
set(new SoundConfig(sound.name(), sound, volume, pitch));
}
public void playTo(@NotNull Player player) {
Optional.ofNullable(get()).ifPresent(c -> c.playTo(player));
}
public void playToAll() {
Optional.ofNullable(get()).ifPresent(SoundConfig::playToAll);
}
public void playAt(Location location) {
Optional.ofNullable(get()).ifPresent(s -> s.playAt(location));
}
public static class Builder extends AbstractConfigBuilder<SoundConfig, SoundConfig, ConfiguredSound, ConfigurationHolder<?>, Builder> {
protected @NotNull ValueAdapter<SoundConfig> adapter = SOUND_ADAPTER;
protected Builder() {
super(ConfigurationHolder.class, SOUND_TYPE);
}
public @NotNull Builder adapter(@NotNull ValueAdapter<SoundConfig> adapter) {
this.adapter = adapter;
return this;
}
public @NotNull Builder defaults(@NotNull Sound sound, float volume, float pitch) {
return defaults(new SoundConfig(sound.name(), sound, volume, pitch));
}
public @NotNull Builder defaults(@NotNull Sound sound, float volume) {
return defaults(sound, volume, 1.0f);
}
public @NotNull Builder defaults(@NotNull Sound sound) {
return defaults(sound, 1.0f);
}
public @NotNull Builder defaults(@NotNull String soundName, float volume, float pitch) {
return defaults(new SoundConfig(soundName, volume, pitch));
}
public @NotNull Builder defaults(@NotNull String soundName, float volume) {
return defaults(soundName, volume, 1.0f);
}
public @NotNull Builder defaults(@NotNull String soundName) {
return defaults(soundName, 1.0f);
}
@Override
protected @NotNull Builder self() {
return this;
}
@Override
public @NotNull ConfiguredSound build() {
return new ConfiguredSound(buildManifest(), this.adapter);
}
}
}
@@ -0,0 +1,226 @@
package cc.carm.lib.mineconfiguration.bukkit.value;
import cc.carm.lib.configuration.adapter.ValueAdapter;
import cc.carm.lib.configuration.adapter.ValueType;
import cc.carm.lib.configuration.builder.AbstractConfigBuilder;
import cc.carm.lib.configuration.source.ConfigurationHolder;
import cc.carm.lib.configuration.source.section.ConfigureSection;
import cc.carm.lib.configuration.value.ValueManifest;
import cc.carm.lib.configuration.value.standard.ConfiguredValue;
import cc.carm.lib.configuration.value.text.function.TextParser;
import cc.carm.lib.mineconfiguration.bukkit.data.TitleConfig;
import com.cryptomorin.xseries.messages.Titles;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Range;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.UnaryOperator;
public class ConfiguredTitle extends ConfiguredValue<TitleConfig> {
public static final @NotNull ConfiguredTitle.TitleConsumer DEFAULT_TITLE_CONSUMER = Titles::sendTitle;
public static Builder create() {
return new Builder();
}
public static ConfiguredTitle of(@Nullable String line1, @Nullable String line2) {
return create().defaults(line1, line2).build();
}
public static ConfiguredTitle of(@Nullable String line1, @Nullable String line2,
int fadeIn, int stay, int fadeOut) {
return create().defaults(line1, line2).fadeIn(fadeIn).stay(stay).fadeOut(fadeOut).build();
}
public static final ValueType<TitleConfig> TITLE_TYPE = ValueType.of(TitleConfig.class);
public static final ValueAdapter<TitleConfig> TITLE_ADAPTER = new ValueAdapter<>(TITLE_TYPE,
(holder, type, value) -> value.serialize(),
(holder, type, value) -> {
ConfigureSection section = holder.deserialize(ConfigureSection.class, value);
return TitleConfig.deserialize(section);
}
);
protected final @NotNull ConfiguredTitle.TitleConsumer sendConsumer;
protected final @NotNull UnaryOperator<String> paramBuilder;
protected final @NotNull String[] params;
public ConfiguredTitle(@NotNull ValueManifest<TitleConfig, TitleConfig> manifest, ValueAdapter<TitleConfig> adapter,
@NotNull UnaryOperator<String> paramBuilder, @NotNull String[] params,
@NotNull ConfiguredTitle.TitleConsumer sendConsumer) {
super(manifest, adapter);
this.paramBuilder = paramBuilder;
this.sendConsumer = sendConsumer;
this.params = params;
}
public void set(Consumer<TitleConfig> handler) {
TitleConfig conf = get();
handler.accept(conf);
set(conf);
}
public void setLine1(@Nullable String line1) {
set(conf -> conf.line1(line1));
}
public void setLine2(@Nullable String line2) {
set(conf -> conf.line2(line2));
}
public void setFadeIn(int fadeIn) {
set(conf -> conf.fadeIn(fadeIn));
}
public void setStay(int stay) {
set(conf -> conf.stay(stay));
}
public void setFadeOut(int fadeOut) {
set(conf -> conf.fadeOut(fadeOut));
}
public void send(@NotNull Player player, Object... values) {
send(player, this.params, values);
}
public void send(@NotNull Player player, @NotNull String[] params, @NotNull Object[] values) {
send(player, TextParser.buildParams(paramBuilder, params, values));
}
public void send(@NotNull Player player, @NotNull Map<String, Object> placeholders) {
TitleConfig config = get();
if (config != null) config.send(player, placeholders, sendConsumer);
}
public void sendToAll(Object... values) {
sendToAll(this.params, values);
}
public void sendToAll(@NotNull String[] params, @NotNull Object[] values) {
sendToAll(TextParser.buildParams(paramBuilder, params, values));
}
public void sendToAll(@NotNull Map<String, Object> placeholders) {
TitleConfig config = get();
if (config == null) return;
Bukkit.getOnlinePlayers().forEach(onlinePlayer -> send(onlinePlayer, placeholders));
}
public void sendToEach(@NotNull Function<@NotNull Player, Object[]> eachValues) {
sendToEach(null, eachValues);
}
public void sendToEach(@Nullable Predicate<Player> limiter,
@NotNull Function<@NotNull Player, Object[]> eachValues) {
Predicate<Player> predicate = Optional.ofNullable(limiter).orElse(r -> true);
Bukkit.getOnlinePlayers().stream().filter(predicate)
.forEach(r -> send(r, eachValues.apply(r)));
}
@FunctionalInterface
public interface TitleConsumer {
/**
* 向目标玩家发送标题文字
*
* @param player 目标玩家
* @param fadeIn 淡入时间 (ticks)
* @param stay 保留时间 (ticks)
* @param fadeOut 淡出时间 (ticks)
* @param line1 第一行文字
* @param line2 第二行文字
*/
void send(@NotNull Player player,
@Range(from = 0L, to = Integer.MAX_VALUE) int fadeIn,
@Range(from = 0L, to = Integer.MAX_VALUE) int stay,
@Range(from = 0L, to = Integer.MAX_VALUE) int fadeOut,
@NotNull String line1, @NotNull String line2);
}
public static class Builder extends AbstractConfigBuilder<TitleConfig, TitleConfig, ConfiguredTitle, ConfigurationHolder<?>, Builder> {
protected @NotNull ValueAdapter<TitleConfig> adapter = TITLE_ADAPTER;
protected @NotNull TitleConfig title = TitleConfig.of(null, null);
protected @NotNull String[] params = new String[0];
protected @NotNull ConfiguredTitle.TitleConsumer sendConsumer = DEFAULT_TITLE_CONSUMER;
protected @NotNull UnaryOperator<String> paramFormatter = s -> "%(" + s + ")";
protected Builder() {
super(ConfigurationHolder.class, TITLE_TYPE);
defaults(() -> this.title);
}
public @NotNull Builder adapter(@NotNull ValueAdapter<TitleConfig> adapter) {
this.adapter = adapter;
return this;
}
public @NotNull Builder defaults(Consumer<TitleConfig> handler) {
handler.accept(this.title);
return this;
}
public @NotNull Builder defaults(@Nullable String line1, @Nullable String line2) {
return line1(line1).line2(line2);
}
public @NotNull Builder line1(@Nullable String line1) {
return defaults(t -> t.line1(line1));
}
public @NotNull Builder line2(@Nullable String line2) {
return defaults(t -> t.line2(line2));
}
public @NotNull Builder fadeIn(@Range(from = 0L, to = Integer.MAX_VALUE) int fadeIn) {
return defaults(t -> t.fadeIn(fadeIn));
}
public @NotNull Builder stay(@Range(from = 0L, to = Integer.MAX_VALUE) int stay) {
return defaults(t -> t.stay(stay));
}
public @NotNull Builder fadeOut(@Range(from = 0L, to = Integer.MAX_VALUE) int fadeOut) {
return defaults(t -> t.fadeOut(fadeOut));
}
public @NotNull Builder params(String... params) {
this.params = params;
return this;
}
public @NotNull Builder params(@NotNull List<String> params) {
return params(params.toArray(new String[0]));
}
public @NotNull Builder whenSend(@NotNull ConfiguredTitle.TitleConsumer consumer) {
this.sendConsumer = consumer;
return this;
}
@Override
protected @NotNull Builder self() {
return this;
}
@Override
public @NotNull ConfiguredTitle build() {
return new ConfiguredTitle(buildManifest(), this.adapter, this.paramFormatter, this.params, this.sendConsumer);
}
}
}
@@ -0,0 +1,216 @@
package cc.carm.lib.mineconfiguration.bukkit.value.item;
import cc.carm.lib.configuration.adapter.ValueAdapter;
import cc.carm.lib.configuration.adapter.ValueType;
import cc.carm.lib.configuration.builder.AbstractConfigBuilder;
import cc.carm.lib.configuration.source.ConfigurationHolder;
import cc.carm.lib.configuration.source.section.ConfigureSection;
import cc.carm.lib.configuration.value.ValueManifest;
import cc.carm.lib.configuration.value.standard.ConfiguredValue;
import cc.carm.lib.easyplugin.utils.ColorParser;
import com.cryptomorin.xseries.XItemStack;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Consumer;
public class ConfiguredItem extends ConfiguredValue<ItemStack> {
public static Builder create() {
return new Builder();
}
public static final @NotNull ValueType<ItemStack> ITEM_TYPE = ValueType.of(ItemStack.class);
public static final ValueAdapter<ItemStack> ITEM_ADAPTER = new ValueAdapter<>(ITEM_TYPE,
(holder, type, value) -> XItemStack.serialize(value),
(holder, type, value) -> {
ConfigureSection section = (ConfigureSection) value;
return XItemStack.deserialize(section.asMap());
}
);
protected final @NotNull BiFunction<Player, String, String> parser;
protected final @NotNull String[] params;
public ConfiguredItem(@NotNull ValueManifest<ItemStack, ItemStack> manifest, ValueAdapter<ItemStack> adapter,
@NotNull BiFunction<Player, String, String> parser, @NotNull String[] params) {
super(manifest, adapter);
this.parser = parser;
this.params = params;
}
@Override
public @NotNull Optional<@Nullable ItemStack> optional() {
return Optional.ofNullable(super.get());
}
@Override
public @Nullable ItemStack get() {
return optional().map(ItemStack::clone).orElse(null);
}
public @Nullable ItemStack get(Consumer<ItemStack> modifier) {
return optional().map(item -> {
modifier.accept(item);
return item;
}).orElse(null);
}
public @Nullable ItemStack get(@Nullable Player player) {
return get(player, new HashMap<>());
}
public @Nullable ItemStack get(@Nullable Player player, @NotNull Object... values) {
return prepare(values).get(player);
}
public @Nullable ItemStack get(@Nullable Player player,
@NotNull Map<String, Object> placeholders) {
return prepare().placeholders(placeholders).get(player);
}
public @Nullable Map<Integer, ItemStack> give(@NotNull Player player, @NotNull Object... values) {
return prepare(values).give(player);
}
public @NotNull PreparedItem prepare(@NotNull Object... values) {
return PreparedItem.of(player -> get()).parser(parser).params(params).placeholders(values);
}
public void modifyItem(Consumer<ItemStack> modifier) {
ItemStack item = get();
if (item == null) return;
modifier.accept(item);
set(item);
}
public void modifyMeta(Consumer<ItemMeta> modifier) {
modifyItem(item -> {
ItemMeta meta = item.getItemMeta();
modifier.accept(meta);
item.setItemMeta(meta);
});
}
public void setName(@Nullable String name) {
modifyMeta(meta -> meta.setDisplayName(name));
}
public void setLore(@Nullable List<String> lore) {
modifyMeta(meta -> meta.setLore(lore));
}
public void setLore(String... lore) {
if (lore.length == 0) setLore((List<String>) null);
else setLore(Arrays.asList(lore));
}
public static class Builder extends AbstractConfigBuilder<ItemStack, ItemStack, ConfiguredItem, ConfigurationHolder<?>, Builder> {
protected @Nullable ItemStack item = null;
protected @NotNull String[] params = new String[0];
protected @NotNull BiFunction<Player, String, String> parser = (player, message) -> ColorParser.parse(message);
public Builder() {
super(ConfigurationHolder.class, ITEM_TYPE);
defaults(() -> item);
}
@Override
public @NotNull Builder defaults(@Nullable ItemStack item) {
this.item = item;
return this;
}
public Builder defaults(@NotNull Material type) {
return defaults(new ItemStack(type));
}
public Builder defaults(Consumer<ItemStack> consumer) {
if (this.item == null) return self();
consumer.accept(this.item);
return self();
}
public Builder defaultMeta(Consumer<ItemMeta> consumer) {
return defaults(stack -> {
ItemMeta meta = stack.getItemMeta();
consumer.accept(meta);
stack.setItemMeta(meta);
});
}
public Builder defaultType(@NotNull Material type) {
return defaults(new ItemStack(type));
}
public Builder defaultName(@Nullable String name) {
return defaultMeta(meta -> meta.setDisplayName(name));
}
@SuppressWarnings("deprecation")
public Builder defaultDataID(short dataID) {
return defaults(stack -> stack.setDurability(dataID));
}
public Builder defaultLore(@NotNull String... lore) {
return defaultLore(Arrays.asList(lore));
}
public Builder defaultLore(@NotNull List<String> lore) {
return defaultMeta(meta -> meta.setLore(lore));
}
public Builder defaultEnchants(@NotNull Map<Enchantment, Integer> enchants) {
return defaultMeta(meta -> enchants.forEach((enchant, level) -> meta.addEnchant(enchant, level, true)));
}
public Builder defaultEnchant(@NotNull Enchantment enchant, int level) {
return defaultEnchants(Collections.singletonMap(enchant, level));
}
public Builder defaultFlags(@NotNull Set<ItemFlag> flags) {
return defaultMeta(meta -> flags.forEach(meta::addItemFlags));
}
public Builder defaultFlags(@NotNull ItemFlag... flags) {
return defaultFlags(new LinkedHashSet<>(Arrays.asList(flags)));
}
public Builder parser(@NotNull BiFunction<Player, String, String> parser) {
this.parser = parser;
return self();
}
public Builder params(@NotNull String... params) {
this.params = params;
return self();
}
public Builder params(@NotNull List<String> params) {
this.params = params.toArray(new String[0]);
return self();
}
@Override
protected @NotNull Builder self() {
return this;
}
@Override
public @NotNull ConfiguredItem build() {
return new ConfiguredItem(buildManifest(), ITEM_ADAPTER, parser, params);
}
}
}
@@ -0,0 +1,138 @@
package cc.carm.lib.mineconfiguration.bukkit.value.item;
import cc.carm.lib.configuration.value.text.data.TextContents;
import cc.carm.lib.configuration.value.text.function.ContentHandler;
import cc.carm.lib.mineconfiguration.bukkit.value.ConfiguredMessage;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import java.util.function.BiConsumer;
import java.util.function.Function;
public abstract class ItemModifier<S extends ItemModifier<S, R>, R>
extends ContentHandler<Player, S> {
protected final @NotNull Function<@NotNull Player, @Nullable ItemStack> itemProvider;
protected @NotNull BiConsumer<ItemStack, Player> itemConsumer;
protected @NotNull BiConsumer<ItemMeta, Player> metaConsumer;
protected ItemModifier(@NotNull Function<@NotNull Player, @Nullable ItemStack> itemProvider) {
super();
this.itemProvider = itemProvider;
this.itemConsumer = (item, player) -> {
};
this.metaConsumer = (meta, player) -> {
};
this.lineSeparator = " ";
}
public abstract @Nullable R get(Player player);
public void applyTo(@Nullable ItemStack item, @Nullable Player player) {
if (item == null) return;
ItemMeta meta = item.getItemMeta();
if (meta == null) return;
String name = meta.getDisplayName();
if (!name.isEmpty()) {
meta.setDisplayName(parse(player, name));
}
List<String> parsedLore = parseLore(player, meta.getLore());
if (!parsedLore.isEmpty()) {
meta.setLore(parsedLore);
}
metaConsumer.accept(meta, player);
item.setItemMeta(meta);
itemConsumer.accept(item, player);
}
public S handleMeta(@NotNull BiConsumer<ItemMeta, Player> modifier) {
this.metaConsumer = this.metaConsumer.andThen(modifier);
return self();
}
public S handleItem(@NotNull BiConsumer<ItemStack, Player> modifier) {
this.itemConsumer = this.itemConsumer.andThen(modifier);
return self();
}
public S insert(@NotNull String key, @NotNull ConfiguredMessage<?> message,
@NotNull Object... values) {
return insert(key, receiver -> message.parse(receiver, values));
}
public S amount(int amount) {
return handleItem((item, player) -> item.setAmount(amount));
}
public S addEnchantment(Enchantment e) {
return addEnchantment(e, 1);
}
public S addEnchantment(Enchantment e, int level) {
return addEnchantment(e, level, true);
}
public S addEnchantment(Enchantment e, int level, boolean ignoreLevelRestriction) {
return handleMeta((meta, player) -> meta.addEnchant(e, level, ignoreLevelRestriction));
}
public S addItemFlags(ItemFlag... flags) {
return handleMeta((meta, player) -> meta.addItemFlags(flags));
}
public S glow() {
return addItemFlags(ItemFlag.HIDE_ENCHANTS).addEnchantment(Enchantment.DURABILITY);
}
/**
* @param owner 玩家名
* @return this
* @deprecated Use {@link #setSkullOwner(OfflinePlayer)} instead.
*/
@Deprecated
public S setSkullOwner(String owner) {
return handleMeta((meta, player) -> {
if (!(meta instanceof SkullMeta)) return;
SkullMeta skullMeta = (SkullMeta) meta;
skullMeta.setOwner(owner);
});
}
public S setSkullOwner(UUID owner) {
return setSkullOwner(Bukkit.getOfflinePlayer(owner));
}
public S setSkullOwner(OfflinePlayer owner) {
return handleMeta((meta, player) -> {
if (!(meta instanceof SkullMeta)) return;
SkullMeta skullMeta = (SkullMeta) meta;
skullMeta.setOwningPlayer(owner);
});
}
public List<String> parseLore(@Nullable Player player, @Nullable List<String> current) {
if (current == null || current.isEmpty()) return new ArrayList<>();
List<String> parsed = new ArrayList<>();
handle(TextContents.of(current, new HashMap<>()), player, parsed::add);
return parsed;
}
}
@@ -0,0 +1,50 @@
package cc.carm.lib.mineconfiguration.bukkit.value.item;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import java.util.function.Function;
public class PreparedItem extends ItemModifier<PreparedItem, ItemStack> {
public static PreparedItem of(@NotNull Function<@NotNull Player, @Nullable ItemStack> itemProvider) {
return new PreparedItem(itemProvider);
}
public static PreparedItem of(@Nullable ItemStack item) {
return of(player -> item);
}
public PreparedItem(@NotNull Function<@NotNull Player, @Nullable ItemStack> itemProvider) {
super(itemProvider);
}
public @Nullable ItemStack get(@Nullable Player player) {
@Nullable ItemStack item = itemProvider.apply(player);
if (item == null) return null;
applyTo(item, player);
return item;
}
public @Nullable Map<Integer, ItemStack> give(Player player) {
@Nullable ItemStack item = get(player);
if (item == null) return null;
return player.getInventory().addItem(item);
}
public boolean giveOrDrop(Player player) {
@Nullable Map<Integer, ItemStack> left = give(player);
if (left == null) return false;
left.values().forEach(item -> player.getWorld().dropItem(player.getLocation(), item));
return true;
}
@Override
public PreparedItem self() {
return this;
}
}
@@ -0,0 +1,164 @@
package cc.carm.lib.mineconfiguration.bukkit.value.notify;
import cc.carm.lib.configuration.adapter.ValueAdapter;
import cc.carm.lib.configuration.adapter.ValueType;
import cc.carm.lib.configuration.builder.AbstractConfigBuilder;
import cc.carm.lib.configuration.source.ConfigurationHolder;
import cc.carm.lib.configuration.value.ValueManifest;
import cc.carm.lib.configuration.value.standard.ConfiguredList;
import cc.carm.lib.configuration.value.text.function.TextParser;
import cc.carm.lib.mineconfiguration.bukkit.data.NotifyConfig;
import cc.carm.lib.mineconfiguration.bukkit.data.SoundConfig;
import cc.carm.lib.mineconfiguration.bukkit.data.TitleConfig;
import cc.carm.lib.mineconfiguration.bukkit.value.notify.type.NotifyType;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Range;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.UnaryOperator;
public class ConfiguredNotify extends ConfiguredList<NotifyConfig> {
public static NotifyBuilder create() {
return new NotifyBuilder();
}
public static final ValueType<NotifyConfig> NOTIFY_TYPE = ValueType.of(NotifyConfig.class);
public static final ValueAdapter<NotifyConfig> NOTIFY_ADAPTER = new ValueAdapter<>(NOTIFY_TYPE,
(holder, type, value) -> value.serialize(),
(holder, type, value) -> {
String conf = holder.deserialize(String.class, value);
return NotifyConfig.deserialize(conf);
}
);
protected final @NotNull UnaryOperator<String> paramBuilder;
protected final @NotNull String[] params;
public ConfiguredNotify(@NotNull ValueManifest<List<NotifyConfig>, NotifyConfig> manifest,
@NotNull ValueAdapter<NotifyConfig> adapter,
@NotNull UnaryOperator<String> paramBuilder, @NotNull String[] params) {
super(manifest, ArrayList::new, adapter);
this.paramBuilder = paramBuilder;
this.params = params;
}
public @NotNull PreparedNotify prepare(@NotNull Object... values) {
return new PreparedNotify(getNotNull(), TextParser.buildParams(paramBuilder, this.params, values));
}
public void send(@NotNull Player player, @NotNull Object... values) {
prepare(values).to(player);
}
public void send(@NotNull Iterable<? extends Player> players, @NotNull Object... values) {
prepare(values).to(players);
}
public void sendAll(@NotNull Object... values) {
prepare(values).toAll();
}
public static class NotifyBuilder extends AbstractConfigBuilder<List<NotifyConfig>, NotifyConfig, ConfiguredNotify, ConfigurationHolder<?>, NotifyBuilder> {
protected final @NotNull List<NotifyConfig> notifications = new ArrayList<>();
protected @NotNull String[] params = new String[0];
protected @NotNull ValueAdapter<NotifyConfig> adapter = NOTIFY_ADAPTER;
protected @NotNull UnaryOperator<String> paramFormatter = s -> "%(" + s + ")";
protected NotifyBuilder() {
super(ConfigurationHolder.class, new ValueType<List<NotifyConfig>>() {
});
}
@Override
protected @NotNull ConfiguredNotify.NotifyBuilder self() {
return this;
}
@Override
public @NotNull ConfiguredNotify build() {
return new ConfiguredNotify(buildManifest(), this.adapter, this.paramFormatter, this.params);
}
public NotifyBuilder adapter(@NotNull ValueAdapter<NotifyConfig> adapter) {
this.adapter = adapter;
return this;
}
public NotifyBuilder defaultMessages(@NotNull String... messages) {
return defaultMessages(Arrays.asList(messages));
}
public NotifyBuilder defaultMessages(@NotNull List<String> messages) {
for (String message : messages) {
notifications.add(NotifyConfig.of(NotifyType.Standard.MESSAGE, message));
}
return defaults(this.notifications);
}
public NotifyBuilder defaultActionBar(@NotNull String message) {
notifications.add(NotifyConfig.of(NotifyType.Standard.ACTIONBAR, message));
return defaults(this.notifications);
}
public NotifyBuilder defaultSound(@NotNull Sound sound, float volume, float pitch) {
return defaultSound(sound.name(), volume, pitch);
}
public NotifyBuilder defaultSound(@NotNull Sound sound, float volume) {
return defaultSound(sound, volume, 1.0f);
}
public NotifyBuilder defaultSound(@NotNull Sound sound) {
return defaultSound(sound, 1.0f);
}
public NotifyBuilder defaultSound(@NotNull String soundName, float volume, float pitch) {
notifications.add(NotifyConfig.of(NotifyType.Standard.SOUND, new SoundConfig(soundName, volume, pitch)));
return defaults(this.notifications);
}
public NotifyBuilder defaultSound(@NotNull String soundName, float volume) {
return defaultSound(soundName, volume, 1.0f);
}
public NotifyBuilder defaultSound(@NotNull String soundName) {
return defaultSound(soundName, 1.0f);
}
public NotifyBuilder defaultTitle(@Nullable String line1, @Nullable String line2,
@Range(from = 0L, to = Integer.MAX_VALUE) int fadeIn,
@Range(from = 0L, to = Integer.MAX_VALUE) int stay,
@Range(from = 0L, to = Integer.MAX_VALUE) int fadeOut) {
notifications.add(NotifyConfig.of(NotifyType.Standard.TITLE, TitleConfig.of(line1, line2, fadeIn, stay, fadeOut)));
return defaults(this.notifications);
}
public NotifyBuilder defaultTitle(@Nullable String line1, @Nullable String line2) {
return defaultTitle(line1, line2, 10, 60, 10);
}
public NotifyBuilder params(String... params) {
this.params = params;
return this;
}
public NotifyBuilder params(@NotNull List<String> params) {
return params(params.toArray(new String[0]));
}
public NotifyBuilder formatParam(UnaryOperator<String> paramFormatter) {
this.paramFormatter = paramFormatter;
return this;
}
}
}
@@ -0,0 +1,45 @@
package cc.carm.lib.mineconfiguration.bukkit.value.notify;
import cc.carm.lib.mineconfiguration.bukkit.data.NotifyConfig;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.Map;
public class PreparedNotify {
protected final @NotNull List<NotifyConfig> notifications;
protected final @NotNull Map<String, Object> placeholders;
protected PreparedNotify(@NotNull List<NotifyConfig> notifications, @NotNull Map<String, Object> placeholders) {
this.notifications = notifications;
this.placeholders = placeholders;
}
/**
* 向某位接收者发送消息
*
* @param receiver 消息的接收者
*/
public void to(@NotNull Player receiver) {
notifications.forEach(config -> config.execute(receiver, placeholders));
}
/**
* 向某位接收者发送消息
*
* @param receivers 消息的接收者们
*/
public void to(@NotNull Iterable<? extends Player> receivers) {
receivers.forEach(this::to);
}
public void toAll() {
to(Bukkit.getOnlinePlayers());
}
}
@@ -0,0 +1,62 @@
package cc.carm.lib.mineconfiguration.bukkit.value.notify.type;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class NotifyCache<T extends NotifyType<M>, M> {
// Notify config format: [TYPE(@PARAM)] CONTENTS...
public static final @NotNull Pattern CONFIG_FORMAT = Pattern.compile("\\[(?<type>[^@\\]]+)(@(?<param>[^]]+))?] (?<content>.*)");
public static @Nullable NotifyCache<?, ?> deserialize(@NotNull String config) {
// parse config with config_format
Matcher matcher = CONFIG_FORMAT.matcher(config.trim());
if (!matcher.matches()) return of("MESSAGE", null, config);
return of(matcher.group("type"), matcher.group("param"), matcher.group("content"));
}
public static @Nullable NotifyCache<?, ?> of(@NotNull String key, @Nullable String param, @Nullable String content) {
NotifyType<?> type = NotifyType.get(key);
if (type == null) return null;
return NotifyCache.of(type, param, content);
}
public static <T extends NotifyType<M>, M> NotifyCache<T, M> of(@NotNull T type, @Nullable String param, @Nullable String content) {
return new NotifyCache<>(type, type.parseMeta(param, content));
}
public static <T extends NotifyType<M>, M> NotifyCache<T, M> of(@NotNull T type, @Nullable M meta) {
return new NotifyCache<>(type, meta);
}
protected final @NotNull T type;
protected final @Nullable M meta;
public NotifyCache(@NotNull T type, @Nullable M meta) {
this.type = type;
this.meta = meta;
}
public @NotNull T getType() {
return type;
}
public @Nullable M getMeta() {
return meta;
}
public void execute(@NotNull Player player, @NotNull Map<String, Object> placeholders) {
type.execute(player, meta, placeholders);
}
public String serialize() {
return type.serializeConfig(meta);
}
}
@@ -0,0 +1,91 @@
package cc.carm.lib.mineconfiguration.bukkit.value.notify.type;
import cc.carm.lib.configuration.value.text.function.TextParser;
import cc.carm.lib.mineconfiguration.bukkit.utils.MessageUtils;
import cc.carm.lib.mineconfiguration.bukkit.value.notify.type.standard.SoundNotify;
import cc.carm.lib.mineconfiguration.bukkit.value.notify.type.standard.StringNotify;
import cc.carm.lib.mineconfiguration.bukkit.value.notify.type.standard.TitleNotify;
import com.cryptomorin.xseries.messages.ActionBar;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
public abstract class NotifyType<M> {
public interface Standard {
StringNotify MESSAGE = StringNotify.of("MESSAGE", Player::sendMessage, content -> Optional.ofNullable(content).orElse(" "));
StringNotify MSG = StringNotify.of("MSG", Player::sendMessage);
StringNotify ACTIONBAR = StringNotify.of("ACTIONBAR", ActionBar::sendActionBar);
TitleNotify TITLE = new TitleNotify("TITLE");
SoundNotify SOUND = new SoundNotify("SOUND");
static NotifyType<?>[] values() {
return new NotifyType<?>[]{MESSAGE, MSG, ACTIONBAR, TITLE, SOUND};
}
static NotifyType<?> valueOf(String name) {
return Arrays.stream(values()).filter(type -> type.key.equalsIgnoreCase(name)).findFirst().orElse(null);
}
}
public static final Set<NotifyType<?>> TYPES = new HashSet<>(Arrays.asList(Standard.values()));
public static NotifyType<?> get(@NotNull String key) {
return TYPES.stream().filter(type -> type.key.equalsIgnoreCase(key)).findFirst().orElse(null);
}
protected final @NotNull String key;
protected final @NotNull Class<M> metaClass;
protected NotifyType(@NotNull String key, @NotNull Class<M> metaClass) {
this.key = key;
this.metaClass = metaClass;
}
public @NotNull String getKey() {
return key;
}
public @NotNull Class<M> getMetaClass() {
return metaClass;
}
/**
* Parse metadata from string.
* <br> e.g. "[TYPE-KEY@PARAM] CONTENTS..."
*
* @param param The param of the notify config.
* @param content The content of the notify config.
* @return The parsed metadata.
*/
public abstract @Nullable M parseMeta(@Nullable String param, @Nullable String content);
/**
* Serialize the metadata to singleton string to storage on configs.
*
* @param meta The parsed metadata.
* @return The serialized string.
*/
public abstract @NotNull String serializeConfig(@Nullable M meta);
/**
* Execute the notify content to specific player.
*
* @param player The player who receive the notification.
* @param meta The parsed metadata.
*/
public abstract void execute(@NotNull Player player, @Nullable M meta, @NotNull Map<String, Object> placeholders);
@Contract("_, _, null -> null; _, _, !null -> !null")
protected String setPlaceholders(@NotNull Player player, @NotNull Map<String, Object> placeholders,
@Nullable String content) {
if (content == null) return null;
return MessageUtils.parseMessage(player, TextParser.setPlaceholders(content, placeholders));
}
}
@@ -0,0 +1,50 @@
package cc.carm.lib.mineconfiguration.bukkit.value.notify.type.standard;
import cc.carm.lib.mineconfiguration.bukkit.data.SoundConfig;
import cc.carm.lib.mineconfiguration.bukkit.value.notify.type.NotifyType;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
public class SoundNotify extends NotifyType<SoundConfig> {
public SoundNotify(@NotNull String key) {
super(key, SoundConfig.class);
}
@Override
public @Nullable SoundConfig parseMeta(@Nullable String param, @Nullable String content) {
if (content == null) return null;
String[] args = param == null ? new String[0] : param.split(",");
try {
return new SoundConfig(content.trim(),
(args.length >= 1) ? Float.parseFloat(args[0]) : 1,
(args.length >= 2) ? Float.parseFloat(args[1]) : 1
);
} catch (Exception exception) {
exception.printStackTrace();
return null;
}
}
@Override
public @NotNull String serializeConfig(@Nullable SoundConfig meta) {
if (meta == null) return "[" + key + "] ";
if (meta.getVolume() == 1 && meta.getPitch() == 1) {
return "[" + key + "] " + meta.getTypeName();
} else {
return "[" + key + "@" + +meta.getVolume() + "," + meta.getPitch() + "] " + meta.getTypeName();
}
}
@Override
public void execute(@NotNull Player player, @Nullable SoundConfig meta, @NotNull Map<String, Object> placeholders) {
if (meta != null) meta.playTo(player);
}
}
@@ -0,0 +1,52 @@
package cc.carm.lib.mineconfiguration.bukkit.value.notify.type.standard;
import cc.carm.lib.mineconfiguration.bukkit.value.notify.type.NotifyType;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.UnaryOperator;
public abstract class StringNotify extends NotifyType<String> {
public static StringNotify of(String key, BiConsumer<Player, String> consumer) {
return of(key, consumer, (content) -> "[" + key + "] " + (content == null ? " " : content));
}
public static StringNotify of(String key,
BiConsumer<Player, String> consumer,
UnaryOperator<String> serializer) {
return new StringNotify(key) {
@Override
public @NotNull String serializeConfig(@Nullable String meta) {
return serializer.apply(meta);
}
@Override
public void send(@NotNull Player player, @NotNull String parsedContent) {
consumer.accept(player, parsedContent);
}
};
}
protected StringNotify(String key) {
super(key, String.class);
}
public abstract void send(@NotNull Player player, @NotNull String parsedContent);
@Override
public @Nullable String parseMeta(@Nullable String param, @Nullable String content) {
return content;
}
@Override
public void execute(@NotNull Player player, @Nullable String content, @NotNull Map<String, Object> placeholders) {
if (content == null) return;
send(player, setPlaceholders(player, placeholders, content));
}
}
@@ -0,0 +1,68 @@
package cc.carm.lib.mineconfiguration.bukkit.value.notify.type.standard;
import cc.carm.lib.mineconfiguration.bukkit.data.TitleConfig;
import cc.carm.lib.mineconfiguration.bukkit.value.notify.type.NotifyType;
import com.cryptomorin.xseries.messages.Titles;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class TitleNotify extends NotifyType<TitleConfig> {
//Param format fadeIn,stay,fadeOut
public static final Pattern PARAM_FORMAT = Pattern.compile("(?<fadeIn>\\d+),(?<stay>\\d+),(?<fadeOut>\\d+)");
public TitleNotify(String key) {
super(key, TitleConfig.class);
}
@Override
public @Nullable TitleConfig parseMeta(@Nullable String param, @Nullable String content) {
if (content == null) return null;
String[] lines = content.split("\\{n}");
if (lines.length == 0) return null;
String line1 = lines[0];
String line2 = lines.length > 1 ? lines[1] : null;
if (param == null) {
return TitleConfig.of(line1, line2);
}
Matcher paramMatcher = PARAM_FORMAT.matcher(param);
if (!paramMatcher.matches()) {
return TitleConfig.of(line1, line2);
}
return TitleConfig.of(
line1, line2,
Integer.parseInt(paramMatcher.group("fadeIn")),
Integer.parseInt(paramMatcher.group("stay")),
Integer.parseInt(paramMatcher.group("fadeOut"))
);
}
@Override
public @NotNull String serializeConfig(@Nullable TitleConfig meta) {
if (meta == null || (meta.line1() == null && meta.line2() == null)) return "[" + key + "] ";
String line1 = meta.line1() == null ? "" : meta.line1();
String line2 = meta.line2() == null ? "" : meta.line2();
if (meta.isStandardTime()) {
return "[" + key + "] " + line1 + "{n}" + line2;
} else
return "[" + key + "@" + meta.fadeIn() + "," + meta.stay() + "," + meta.fadeOut() + "] " + line1 + "{n}" + line2;
}
@Override
public void execute(@NotNull Player player, @Nullable TitleConfig meta, @NotNull Map<String, Object> placeholders) {
if (meta != null) meta.send(player, placeholders, Titles::sendTitle);
}
}
+23 -39
View File
@@ -5,44 +5,24 @@
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>1.4.2</version>
<version>3.1.4</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${project.jdk.version}</maven.compiler.source>
<maven.compiler.target>${project.jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<artifactId>mineconfiguration-bungee</artifactId>
<packaging>jar</packaging>
<name>MineConfiguration-Bungee</name>
<description>EasyConfiguration for BungeeCord.</description>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>easyconfiguration-core</artifactId>
<version>${easyconfiguration.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<type>javadoc</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>mineconfiguration-common</artifactId>
@@ -50,22 +30,26 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>configured-yaml</artifactId>
<version>${deps.configured.version}</version>
<scope>compile</scope>
</dependency>
<!--suppress VulnerableLibrariesLocal -->
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.21-R0.4</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
@@ -1,97 +0,0 @@
package cc.carm.lib.mineconfiguration;
import cc.carm.lib.mineconfiguration.bungee.source.BungeeConfigProvider;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.JsonConfiguration;
import net.md_5.bungee.config.YamlConfiguration;
import java.io.File;
import java.io.IOException;
public class MineConfiguration {
protected static BungeeConfigProvider create(File file, String source, ConfigurationProvider loader) {
BungeeConfigProvider provider = new BungeeConfigProvider(file, loader);
try {
provider.initializeFile(source);
provider.initializeConfig();
} catch (IOException e) {
e.printStackTrace();
}
return provider;
}
public static BungeeConfigProvider from(File file, String source) {
return fromYAML(file, source);
}
public static BungeeConfigProvider from(File file) {
return from(file, file.getName());
}
public static BungeeConfigProvider from(String fileName) {
return from(fileName, fileName);
}
public static BungeeConfigProvider from(String fileName, String source) {
return from(new File(fileName), source);
}
public static BungeeConfigProvider from(Plugin plugin, String fileName) {
return from(plugin, fileName, fileName);
}
public static BungeeConfigProvider from(Plugin plugin, String fileName, String source) {
return from(new File(plugin.getDataFolder(), fileName), source);
}
public static BungeeConfigProvider fromYAML(File file, String source) {
return create(file, source, ConfigurationProvider.getProvider(YamlConfiguration.class));
}
public static BungeeConfigProvider fromYAML(String fileName, String source) {
return fromYAML(new File(fileName), source);
}
public static BungeeConfigProvider fromYAML(File file) {
return fromYAML(file, file.getName());
}
public static BungeeConfigProvider fromYAML(String fileName) {
return fromYAML(fileName, fileName);
}
public static BungeeConfigProvider fromYAML(Plugin plugin, String fileName) {
return fromYAML(plugin, fileName, fileName);
}
public static BungeeConfigProvider fromYAML(Plugin plugin, String fileName, String source) {
return fromYAML(new File(plugin.getDataFolder(), fileName), source);
}
public static BungeeConfigProvider fromJSON(File file, String source) {
return create(file, source, ConfigurationProvider.getProvider(JsonConfiguration.class));
}
public static BungeeConfigProvider fromJSON(String fileName, String source) {
return fromJSON(new File(fileName), source);
}
public static BungeeConfigProvider fromJSON(File file) {
return fromJSON(file, file.getName());
}
public static BungeeConfigProvider fromJSON(String fileName) {
return fromJSON(fileName, fileName);
}
public static BungeeConfigProvider fromJSON(Plugin plugin, String fileName) {
return fromJSON(plugin, fileName, fileName);
}
public static BungeeConfigProvider fromJSON(Plugin plugin, String fileName, String source) {
return fromJSON(new File(plugin.getDataFolder(), fileName), source);
}
}
@@ -1,35 +0,0 @@
package cc.carm.lib.mineconfiguration.bungee;
import cc.carm.lib.mineconfiguration.bungee.builder.BungeeConfigBuilder;
import cc.carm.lib.mineconfiguration.bungee.source.BungeeConfigProvider;
import cc.carm.lib.mineconfiguration.bungee.source.BungeeSectionWrapper;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import cc.carm.lib.configuration.core.value.impl.CachedConfigValue;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public abstract class BungeeConfigValue<T> extends CachedConfigValue<T> {
public static @NotNull BungeeConfigBuilder builder() {
return new BungeeConfigBuilder();
}
public BungeeConfigValue(@Nullable BungeeConfigProvider provider, @Nullable String configPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@Nullable T defaultValue) {
super(provider, configPath, headerComments, inlineComments, defaultValue);
}
public BungeeConfigProvider getBukkitProvider() {
ConfigurationProvider<?> provider = getProvider();
if (provider instanceof BungeeConfigProvider) return (BungeeConfigProvider) getProvider();
else throw new IllegalStateException("Provider is not a SpigotConfigProvider");
}
public BungeeSectionWrapper getBukkitConfig() {
return getBukkitProvider().getConfiguration();
}
}
@@ -0,0 +1,55 @@
package cc.carm.lib.mineconfiguration.bungee;
import cc.carm.lib.configuration.Configuration;
import cc.carm.lib.configuration.source.ConfigurationHolder;
import cc.carm.lib.configuration.source.yaml.YAMLConfigFactory;
import cc.carm.lib.configuration.source.yaml.YAMLSource;
import cc.carm.lib.mineconfiguration.common.AbstractConfiguration;
import net.md_5.bungee.api.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import java.io.File;
public class MineConfiguration extends AbstractConfiguration<ConfigurationHolder<YAMLSource>> {
public MineConfiguration(@NotNull Plugin plugin) {
this(plugin.getDataFolder());
}
public MineConfiguration(@NotNull Plugin plugin,
@NotNull Configuration configRoot,
@NotNull Configuration messageRoot) {
this(plugin.getDataFolder(), configRoot, messageRoot);
}
public MineConfiguration(@NotNull Plugin plugin,
@NotNull Class<? extends Configuration> configRoot,
@NotNull Class<? extends Configuration> messageRoot) {
this(plugin.getDataFolder(), configRoot, messageRoot);
}
public MineConfiguration(@NotNull File pluginDataFolder) {
super(
YAMLConfigFactory.from(pluginDataFolder, "config.yml").build(),
YAMLConfigFactory.from(pluginDataFolder, "messages.yml").build()
);
}
public MineConfiguration(@NotNull File pluginDataFolder,
@NotNull Configuration configRoot,
@NotNull Configuration messageRoot) {
this(pluginDataFolder);
initializeConfig(configRoot);
initializeMessage(messageRoot);
}
public MineConfiguration(@NotNull File pluginDataFolder,
@NotNull Class<? extends Configuration> configRoot,
@NotNull Class<? extends Configuration> messageRoot) {
this(pluginDataFolder);
initializeConfig(configRoot);
initializeMessage(messageRoot);
}
}
@@ -1,13 +0,0 @@
package cc.carm.lib.mineconfiguration.bungee.builder;
import cc.carm.lib.mineconfiguration.bungee.source.BungeeConfigProvider;
import cc.carm.lib.configuration.core.builder.AbstractConfigBuilder;
public abstract class AbstractBungeeBuilder<T, B extends AbstractBungeeBuilder<T, B>>
extends AbstractConfigBuilder<T, B, BungeeConfigProvider> {
public AbstractBungeeBuilder() {
super(BungeeConfigProvider.class);
}
}
@@ -1,14 +0,0 @@
package cc.carm.lib.mineconfiguration.bungee.builder;
import cc.carm.lib.mineconfiguration.bungee.builder.message.BungeeMessageBuilder;
import cc.carm.lib.configuration.core.builder.ConfigBuilder;
import org.jetbrains.annotations.NotNull;
public class BungeeConfigBuilder extends ConfigBuilder {
public @NotNull BungeeMessageBuilder createMessage() {
return new BungeeMessageBuilder();
}
}
@@ -1,43 +0,0 @@
package cc.carm.lib.mineconfiguration.bungee.builder.message;
import cc.carm.lib.mineconfiguration.bungee.data.MessageText;
import cc.carm.lib.mineconfiguration.common.builder.message.MessageConfigBuilder;
import cc.carm.lib.mineconfiguration.common.utils.ColorParser;
import net.md_5.bungee.api.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.function.BiFunction;
public class BungeeMessageBuilder extends MessageConfigBuilder<CommandSender, MessageText> {
public BungeeMessageBuilder() {
super(CommandSender.class, MessageText.class);
}
@Override
public @NotNull <M> BungeeMessageValueBuilder<M> asValue(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> parser) {
return new BungeeMessageValueBuilder<>(parser);
}
@Override
public @NotNull <M> BungeeMessageListBuilder<M> asList(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> parser) {
return new BungeeMessageListBuilder<>(parser);
}
public @NotNull
BungeeMessageValueBuilder<String> asStringValue() {
return asValue(defaultParser()).whenSend(CommandSender::sendMessage);
}
public @NotNull
BungeeMessageListBuilder<String> asStringList() {
return asList(defaultParser()).whenSend((r, m) -> m.forEach(r::sendMessage));
}
protected static @NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable String> defaultParser() {
return (receiver, message) -> ColorParser.parse(message);
}
}
@@ -1,36 +0,0 @@
package cc.carm.lib.mineconfiguration.bungee.builder.message;
import cc.carm.lib.mineconfiguration.bungee.data.MessageText;
import cc.carm.lib.mineconfiguration.bungee.value.ConfiguredMessageList;
import cc.carm.lib.mineconfiguration.common.builder.message.MessageListBuilder;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import net.md_5.bungee.api.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Optional;
import java.util.function.BiFunction;
public class BungeeMessageListBuilder<M>
extends MessageListBuilder<M, CommandSender, MessageText, BungeeMessageListBuilder<M>> {
public BungeeMessageListBuilder(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> parser) {
super(CommandSender.class, MessageText::of, parser);
}
@Override
protected @NotNull BungeeMessageListBuilder<M> getThis() {
return this;
}
@Override
public @NotNull ConfiguredMessageList<M> build() {
return new ConfiguredMessageList<>(
this.provider, this.path, this.headerComments, this.inlineComment,
Optional.ofNullable(this.defaultValue).orElse(MessageText.of(new ArrayList<>())),
ParamsUtils.formatParams(this.paramFormatter, this.params),
this.messageParser, this.sendFunction
);
}
}
@@ -1,37 +0,0 @@
package cc.carm.lib.mineconfiguration.bungee.builder.message;
import cc.carm.lib.mineconfiguration.bungee.data.MessageText;
import cc.carm.lib.mineconfiguration.bungee.value.ConfiguredMessage;
import cc.carm.lib.mineconfiguration.common.builder.message.MessageValueBuilder;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import net.md_5.bungee.api.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Optional;
import java.util.function.BiFunction;
public class BungeeMessageValueBuilder<M>
extends MessageValueBuilder<M, CommandSender, MessageText, BungeeMessageValueBuilder<M>> {
public BungeeMessageValueBuilder(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> parser) {
super(CommandSender.class, MessageText::new, parser);
}
@Override
protected @NotNull BungeeMessageValueBuilder<M> getThis() {
return this;
}
@Override
public @NotNull ConfiguredMessage<M> build() {
return new ConfiguredMessage<>(
this.provider, this.path, this.headerComments, this.inlineComment,
Optional.ofNullable(this.defaultValue).orElse(MessageText.of("")),
ParamsUtils.formatParams(this.paramFormatter, this.params),
this.messageParser, this.sendHandler
);
}
}
@@ -1,35 +0,0 @@
package cc.carm.lib.mineconfiguration.bungee.data;
import cc.carm.lib.mineconfiguration.common.data.AbstractText;
import net.md_5.bungee.api.CommandSender;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class MessageText extends AbstractText<CommandSender> {
public MessageText(@NotNull String message) {
super(CommandSender.class, message);
}
@Contract("!null,-> !null")
public static @Nullable MessageText of(@Nullable String message) {
if (message == null) return null;
else return new MessageText(message);
}
public static @NotNull List<MessageText> of(@Nullable List<String> messages) {
if (messages == null || messages.isEmpty()) return new ArrayList<>();
else return messages.stream().map(MessageText::of).collect(Collectors.toList());
}
public static @NotNull List<MessageText> of(@NotNull String... messages) {
return of(Arrays.asList(messages));
}
}
@@ -1,74 +0,0 @@
package cc.carm.lib.mineconfiguration.bungee.source;
import cc.carm.lib.configuration.core.ConfigInitializer;
import cc.carm.lib.configuration.core.source.impl.FileConfigProvider;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Unmodifiable;
import java.io.File;
import java.io.IOException;
import java.util.List;
public class BungeeConfigProvider extends FileConfigProvider<BungeeSectionWrapper> {
protected ConfigurationProvider loader;
protected Configuration configuration;
protected ConfigInitializer<BungeeConfigProvider> initializer;
public BungeeConfigProvider(@NotNull File file, ConfigurationProvider loader) {
super(file);
this.loader = loader;
}
public void initializeConfig() throws IOException {
this.configuration = getLoader().load(file);
this.initializer = new ConfigInitializer<>(this);
}
@Override
public @NotNull BungeeSectionWrapper getConfiguration() {
return BungeeSectionWrapper.of(configuration);
}
@Override
protected void onReload() throws Exception {
this.configuration = getLoader().load(file);
}
@Override
public void save() throws Exception {
getLoader().save(configuration, file);
}
@Override
public void setHeaderComment(@Nullable String path, @Nullable List<String> comments) {
}
@Override
public void setInlineComment(@NotNull String path, @Nullable String comment) {
}
@Override
public @Nullable @Unmodifiable List<String> getHeaderComment(@Nullable String path) {
return null;
}
@Override
public @Nullable String getInlineComment(@NotNull String path) {
return null;
}
@Override
public @NotNull ConfigInitializer<BungeeConfigProvider> getInitializer() {
return this.initializer;
}
public ConfigurationProvider getLoader() {
return loader;
}
}
@@ -1,70 +0,0 @@
package cc.carm.lib.mineconfiguration.bungee.source;
import cc.carm.lib.configuration.core.source.ConfigurationWrapper;
import net.md_5.bungee.config.Configuration;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.stream.Collectors;
public class BungeeSectionWrapper implements ConfigurationWrapper {
private final Configuration section;
private BungeeSectionWrapper(@NotNull Configuration section) {
this.section = section;
}
@Contract("!null->!null")
public static @Nullable BungeeSectionWrapper of(@Nullable Configuration section) {
return section == null ? null : new BungeeSectionWrapper(section);
}
@Override
public @NotNull Set<String> getKeys(boolean deep) {
return new LinkedHashSet<>(section.getKeys());
}
@Override
public @NotNull Map<String, Object> getValues(boolean deep) {
return section.getKeys().stream()
.collect(Collectors.toMap(key -> key, section::get, (a, b) -> b, LinkedHashMap::new));
}
@Override
public void set(@NotNull String path, @Nullable Object value) {
this.section.set(path, value);
}
@Override
public boolean contains(@NotNull String path) {
return this.section.contains(path);
}
@Override
public @Nullable Object get(@NotNull String path) {
return this.section.get(path);
}
@Override
public boolean isList(@NotNull String path) {
return get(path) instanceof List<?>;
}
@Override
public @Nullable List<?> getList(@NotNull String path) {
return this.section.getList(path);
}
@Override
public boolean isConfigurationSection(@NotNull String path) {
return get(path) instanceof Configuration;
}
@Override
public @Nullable ConfigurationWrapper getConfigurationSection(@NotNull String path) {
return of(this.section.getSection(path));
}
}
@@ -1,51 +1,64 @@
package cc.carm.lib.mineconfiguration.bungee.value;
import cc.carm.lib.mineconfiguration.bungee.BungeeConfigValue;
import cc.carm.lib.mineconfiguration.bungee.builder.message.BungeeMessageValueBuilder;
import cc.carm.lib.mineconfiguration.bungee.data.MessageText;
import cc.carm.lib.mineconfiguration.common.value.ConfigMessage;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import cc.carm.lib.configuration.value.ValueManifest;
import cc.carm.lib.configuration.value.text.ConfiguredText;
import cc.carm.lib.configuration.value.text.data.TextContents;
import cc.carm.lib.easyplugin.utils.ColorParser;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
public class ConfiguredMessage<M> extends ConfigMessage<M, MessageText, CommandSender> {
public class ConfiguredMessage extends ConfiguredText<BaseComponent[], CommandSender> {
@NotNull
public static <M> BungeeMessageValueBuilder<@Nullable M> create(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> messageParser) {
return BungeeConfigValue.builder().createMessage().asValue(messageParser);
public static ConfiguredMessage.Builder create() {
return new Builder();
}
public static BungeeMessageValueBuilder<String> asString() {
return BungeeConfigValue.builder().createMessage().asStringValue();
public static ConfiguredMessage ofString(@NotNull String... messages) {
return create().defaults(messages).build();
}
public static ConfiguredMessage<String> ofString() {
return asString().build();
public ConfiguredMessage(@NotNull ValueManifest<TextContents, TextContents> manifest,
@NotNull BiFunction<CommandSender, String, String> parser,
@NotNull BiFunction<CommandSender, String, BaseComponent[]> compiler,
@NotNull BiConsumer<CommandSender, List<BaseComponent[]>> dispatcher,
@NotNull String[] params) {
super(manifest, parser, compiler, dispatcher, params);
}
public static ConfiguredMessage<String> ofString(@NotNull String defaultMessage) {
return asString().defaults(defaultMessage).build();
public void print(Object... values) {
prepare(values).to(ProxyServer.getInstance().getConsole());
}
public ConfiguredMessage(@Nullable ConfigurationProvider<?> provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@NotNull MessageText defaultMessage, @NotNull String[] params,
@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> messageParser,
@NotNull BiConsumer<@NotNull CommandSender, @NotNull M> sendFunction) {
super(provider, sectionPath, headerComments, inlineComments, MessageText.class, defaultMessage, params, messageParser, sendFunction, MessageText::of);
}
public static class Builder extends ConfiguredText.Builder<BaseComponent[], CommandSender, Builder> {
@Override
public void broadcast(@NotNull Map<String, Object> placeholders) {
ProxyServer.getInstance().getPlayers().forEach(pl -> send(pl, placeholders));
send(ProxyServer.getInstance().getConsole(), placeholders);
public Builder() {
super();
this.parser = (sender, message) -> ColorParser.parse(message);
this.compiler = (sender, message) -> new BaseComponent[]{new TextComponent(message)};
this.dispatcher = (sender, message) -> {
for (BaseComponent[] component : message) {
sender.sendMessage(component);
}
};
}
@Override
public @NotNull ConfiguredMessage build() {
return new ConfiguredMessage(buildManifest(), this.parser, this.compiler, this.dispatcher, this.params);
}
@Override
public @NotNull ConfiguredMessage.Builder self() {
return this;
}
}
@@ -1,46 +0,0 @@
package cc.carm.lib.mineconfiguration.bungee.value;
import cc.carm.lib.mineconfiguration.bungee.BungeeConfigValue;
import cc.carm.lib.mineconfiguration.bungee.builder.message.BungeeMessageListBuilder;
import cc.carm.lib.mineconfiguration.bungee.data.MessageText;
import cc.carm.lib.mineconfiguration.common.value.ConfigMessageList;
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
public class ConfiguredMessageList<M> extends ConfigMessageList<M, MessageText, CommandSender> {
@NotNull
public static <M> BungeeMessageListBuilder<M> create(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> messageParser) {
return BungeeConfigValue.builder().createMessage().asList(messageParser);
}
public static BungeeMessageListBuilder<String> asStrings() {
return BungeeConfigValue.builder().createMessage().asStringList();
}
public static ConfiguredMessageList<String> ofStrings(@NotNull String... defaultMessages) {
return asStrings().defaults(defaultMessages).build();
}
public ConfiguredMessageList(@Nullable ConfigurationProvider<?> provider, @Nullable String sectionPath,
@Nullable List<String> headerComments, @Nullable String inlineComments,
@NotNull List<MessageText> messages, @NotNull String[] params,
@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> messageParser,
@NotNull BiConsumer<@NotNull CommandSender, @NotNull List<M>> sendFunction) {
super(provider, sectionPath, headerComments, inlineComments, MessageText.class, messages, params, messageParser, sendFunction, MessageText::of);
}
public void broadcast(@NotNull Map<String, Object> placeholders) {
ProxyServer.getInstance().getPlayers().forEach(pl -> send(pl, placeholders));
send(ProxyServer.getInstance().getConsole(), placeholders);
}
}
+73 -65
View File
@@ -4,23 +4,26 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.jdk.version>8</project.jdk.version>
<maven.compiler.source>${project.jdk.version}</maven.compiler.source>
<maven.compiler.target>${project.jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<easyconfiguration.version>3.1.0</easyconfiguration.version>
<deps.configured.version>4.2.0</deps.configured.version>
<deps.yamlcommentwriter.version>1.2.1</deps.yamlcommentwriter.version>
<deps.easyplugin.version>1.5.13</deps.easyplugin.version>
</properties>
<groupId>cc.carm.lib</groupId>
<artifactId>mineconfiguration-parent</artifactId>
<version>1.4.2</version>
<version>3.1.4</version>
<packaging>pom</packaging>
<modules>
<module>common</module>
<module>platform/bungee</module>
<module>platform/bukkit</module>
<module>platform/bungee</module>
<module>platform/adventure</module>
</modules>
<name>MineConfiguration</name>
@@ -38,7 +41,7 @@
</developers>
<scm>
<connection>scm:git:git@github.com:CarmJos/Easy.MineConfiguration</connection>
<connection>scm:git:git@github.com:CarmJos/MineConfiguration</connection>
<developerConnection>scm:git:git@github.com:CarmJos/MineConfiguration.git</developerConnection>
<url>https://github.com/CarmJos/MineConfiguration</url>
<tag>HEAD</tag>
@@ -64,9 +67,13 @@
<repositories>
<repository>
<id>carm-repo</id>
<name>Carm's Repo</name>
<url>https://repo.carm.cc/repository/maven-public/</url>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://s01.oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
@@ -75,13 +82,13 @@
</repository>
<repository>
<id>nexus</id>
<url>https://mvn.lumine.io/repository/maven-public/</url>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
<id>lumine</id>
<url>https://mvn.lumine.io/repository/maven-public/</url>
</repository>
</repositories>
@@ -102,7 +109,7 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
<version>26.1.0</version>
<scope>provided</scope>
</dependency>
@@ -115,7 +122,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.5.5</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
@@ -123,7 +130,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
@@ -143,7 +150,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<version>3.3.1</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
@@ -151,6 +158,36 @@
<goals>deploy</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<source>${project.jdk.version}</source>
<target>${project.jdk.version}</target>
<encoding>UTF-8</encoding>
<compilerArgument>-parameters</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
@@ -159,7 +196,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<version>3.12.0</version>
<configuration>
<classifier>javadoc</classifier>
<detectJavaApiLink>false</detectJavaApiLink>
@@ -185,42 +222,10 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>UTF-8</encoding>
<compilerArgument>-parameters</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<version>3.6.2</version>
<executions>
<execution>
<phase>package</phase>
@@ -261,18 +266,21 @@
<profiles>
<profile>
<id>ossrh</id>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<id>central</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.10.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
+6
View File
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}