Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KyoriPowered/adventure
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.13.1
Choose a base ref
...
head repository: KyoriPowered/adventure
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.14.0
Choose a head ref

Commits on Apr 2, 2023

  1. Added legacy show achievements

    LOOHP committed Apr 2, 2023
    Copy the full SHA
    a9f6bd5 View commit details

Commits on Apr 7, 2023

  1. feat(api): introduce a way to get viewers of a bossbar

    Co-authored-by: KingOfSquares <19822231+KingOfSquares@users.noreply.github.com>
    kashike and KingOfSquares committed Apr 7, 2023
    Copy the full SHA
    a9870aa View commit details

Commits on Apr 10, 2023

  1. chore: bump to 4.14.0-SNAPSHOT

    kashike authored and zml2008 committed Apr 10, 2023
    Copy the full SHA
    a7e7bc6 View commit details

Commits on Apr 11, 2023

  1. feat(api): add ComponentEncoder

    ComponentEncoder is akin to ComponentSerializer, except it doesn't
    provide deserialization. This is intended to be used in #898.
    
    ComponentSerializer now extends ComponentEncoder, but still overrides
    the methods with exact copies, to keep the javadocs more clear.
    These originals also retain their old `@since` tags.
    rymiel committed Apr 11, 2023
    Copy the full SHA
    2d073b3 View commit details
  2. Merge pull request #899 from KyoriPowered/feat/text-encoder

    ComponentEncoder
    rymiel authored Apr 11, 2023
    Copy the full SHA
    64f8f9f View commit details

Commits on Apr 12, 2023

  1. Copy the full SHA
    159f5fe View commit details
  2. Merge pull request #900 from 4drian3d/fix/added-missing-nullability

    fix: Added missing PermissionChecker nullability checks
    zml2008 authored Apr 12, 2023
    Copy the full SHA
    02ba4f3 View commit details
  3. Merge pull request #894 from KyoriPowered/feature/bossbar-viewers

    feat(api): introduce a way to get viewers of a bossbar
    zml2008 authored Apr 12, 2023
    Copy the full SHA
    b59d5a2 View commit details

Commits on Apr 14, 2023

  1. Initial work on an ANSIComponentSerializer

    Basically so far it's just a thing which pipes together an
    ANSIComponentRenderer from net.kyori.ansi and a ComponentFlattener.
    
    NEEDS MORE TESTS AAAA
    rymiel committed Apr 14, 2023
    Copy the full SHA
    9baeab2 View commit details
  2. Copy the full SHA
    0a2f102 View commit details
  3. Copy the full SHA
    7292c4e View commit details
  4. Copy the full SHA
    92b32f7 View commit details
  5. ansi-serializer: add a Builder

    rymiel committed Apr 14, 2023
    Copy the full SHA
    fd430b8 View commit details
  6. Apply suggestions from code review

    Co-authored-by: zml <zml@stellardrift.ca>
    rymiel and zml2008 committed Apr 14, 2023
    Copy the full SHA
    fab97e1 View commit details
  7. Copy the full SHA
    3f20aaa View commit details

Commits on Apr 18, 2023

  1. Copy the full SHA
    be62730 View commit details
  2. Copy the full SHA
    55101af View commit details

Commits on Apr 22, 2023

  1. Copy the full SHA
    b261357 View commit details
  2. Copy the full SHA
    82d1f43 View commit details
  3. Copy the full SHA
    d26ad3f View commit details
  4. Copy the full SHA
    33c9928 View commit details

Commits on Apr 23, 2023

  1. Implement equals and hashCode

    Camotoy committed Apr 23, 2023
    Copy the full SHA
    2fb657e View commit details

Commits on Apr 24, 2023

  1. Use release version of ansi

    rymiel committed Apr 24, 2023
    Copy the full SHA
    9971900 View commit details
  2. Copy the full SHA
    b766225 View commit details
  3. a few changes

    kashike committed Apr 24, 2023
    Copy the full SHA
    8ea0f70 View commit details
  4. Merge pull request #906 from KyoriPowered/allow-custom-colors-legacy

    feat: allow custom colors in LegacyComponentSerializer
    kashike authored Apr 24, 2023
    Copy the full SHA
    7c19212 View commit details

Commits on Apr 25, 2023

  1. Tiny javadoc fix

    rymiel committed Apr 25, 2023
    Copy the full SHA
    570310d View commit details
  2. Merge pull request #898 from KyoriPowered/feat/ansi-component-serializer

    ANSIComponentSerializer
    rymiel authored Apr 25, 2023
    Copy the full SHA
    62ca6f4 View commit details

Commits on Apr 26, 2023

  1. Copy the full SHA
    d57b461 View commit details
  2. Merge pull request #909 from KyoriPowered/fix/bom-ansi

    bom: Add missed text-serializer-ansi
    rymiel authored Apr 26, 2023
    Copy the full SHA
    7b1a5a6 View commit details

Commits on Apr 28, 2023

  1. feat(key): try to include additional information in error messages wh…

    …en an invalid character has been detected in a Key
    
    Co-authored-by: Jason <11360596+jpenilla@users.noreply.github.com>
    kashike and jpenilla committed Apr 28, 2023
    Copy the full SHA
    bcc3d2d View commit details
  2. Since 4.14.0

    LOOHP committed Apr 28, 2023
    Copy the full SHA
    b37ebb8 View commit details

Commits on Apr 30, 2023

  1. Merge pull request #887 from KyoriPowered/feature/key-errors

    feat(key): try to include additional information in error messages when an invalid character has been detected in a Key
    zml2008 authored Apr 30, 2023
    Copy the full SHA
    0850ada View commit details

Commits on May 2, 2023

  1. Copy the full SHA
    ef1fe46 View commit details
  2. Copy the full SHA
    9a7b7ca View commit details
  3. Merge pull request #914 from KyoriPowered/fix/ansi-versions

    ansi: tiny javadoc since tag fix
    rymiel authored May 2, 2023
    Copy the full SHA
    c87a6e2 View commit details
  4. Copy the full SHA
    e78e7ff View commit details
  5. Merge pull request #911 from KyoriPowered/renovate/patch-release-depe…

    …ndency-changes
    
    chore(deps): Update patch-release dependency changes
    zml2008 authored May 2, 2023
    Copy the full SHA
    0312a78 View commit details
  6. Merge pull request #912 from KyoriPowered/renovate/checkstyle

    chore(deps): Update dependency com.puppycrawl.tools:checkstyle to v10.10.0
    zml2008 authored May 2, 2023
    Copy the full SHA
    e064140 View commit details

Commits on May 6, 2023

  1. TypeAdapters.STRING not needed

    LOOHP committed May 6, 2023
    Copy the full SHA
    e004fea View commit details
  2. Copy the full SHA
    6363af5 View commit details
  3. Copy the full SHA
    27f6aa9 View commit details

Commits on May 7, 2023

  1. Copy the full SHA
    3efb556 View commit details
  2. Merge pull request #916 from emilyy-dev/fix/ansi-use-provided-stuffs

    Fix: ANSI serializer isn't using configured flattener & color level
    kezz authored May 7, 2023
    Copy the full SHA
    c6fb10f View commit details

Commits on May 10, 2023

  1. Copy the full SHA
    019ea1b View commit details
  2. more annotations

    powercasgamer committed May 10, 2023
    Copy the full SHA
    b805c64 View commit details
  3. RegExp annotation

    powercasgamer committed May 10, 2023
    Copy the full SHA
    5d0fd32 View commit details
  4. Copy the full SHA
    64e9571 View commit details
  5. small change

    powercasgamer committed May 10, 2023
    Copy the full SHA
    06ffa8a View commit details
  6. Copy the full SHA
    f77759d View commit details
Showing with 3,651 additions and 1,208 deletions.
  1. +3 −1 .checkstyle/checkstyle.xml
  2. +1 −1 .checkstyle/suppressions.xml
  3. +7 −2 annotation-processors/build.gradle.kts
  4. +1 −1 api/build.gradle.kts
  5. +2 −0 api/src/main/java/net/kyori/adventure/audience/Audience.java
  6. +38 −0 api/src/main/java/net/kyori/adventure/bossbar/BossBar.java
  7. +8 −0 api/src/main/java/net/kyori/adventure/bossbar/BossBarImpl.java
  8. +12 −0 api/src/main/java/net/kyori/adventure/bossbar/BossBarImplementation.java
  9. +43 −0 api/src/main/java/net/kyori/adventure/bossbar/BossBarViewer.java
  10. +6 −3 api/src/main/java/net/kyori/adventure/permission/PermissionChecker.java
  11. +1 −1 api/src/main/java/net/kyori/adventure/permission/PermissionCheckers.java
  12. +32 −0 api/src/main/java/net/kyori/adventure/text/Component.java
  13. +152 −1 api/src/main/java/net/kyori/adventure/text/event/HoverEvent.java
  14. +1 −35 api/src/main/java/net/kyori/adventure/text/format/NamedTextColor.java
  15. +47 −3 api/src/main/java/net/kyori/adventure/text/format/TextColor.java
  16. +19 −0 api/src/main/java/net/kyori/adventure/text/format/TextColorImpl.java
  17. +16 −2 api/src/main/java/net/kyori/adventure/text/renderer/TranslatableComponentRenderer.java
  18. +80 −0 api/src/main/java/net/kyori/adventure/text/serializer/ComponentEncoder.java
  19. +4 −1 api/src/main/java/net/kyori/adventure/text/serializer/ComponentSerializer.java
  20. +52 −0 api/src/main/java/net/kyori/adventure/util/Services.java
  21. +22 −13 api/src/test/java/net/kyori/adventure/text/event/HoverEventTest.java
  22. +3 −1 bom/build.gradle.kts
  23. +3 −3 build-logic/build.gradle.kts
  24. +16 −15 build-logic/src/main/kotlin/adventure.base-conventions.gradle.kts
  25. +2 −3 build-logic/src/main/kotlin/adventure.common-conventions.gradle.kts
  26. +66 −0 build-logic/src/main/kotlin/adventure.json-impl-conventions.gradle.kts
  27. +2 −1 gradle.properties
  28. +15 −13 gradle/libs.versions.toml
  29. BIN gradle/wrapper/gradle-wrapper.jar
  30. +1 −1 gradle/wrapper/gradle-wrapper.properties
  31. +4 −3 gradlew
  32. +1 −1 key/build.gradle.kts
  33. +32 −10 key/src/main/java/net/kyori/adventure/key/Key.java
  34. +23 −4 key/src/main/java/net/kyori/adventure/key/KeyImpl.java
  35. +66 −0 key/src/main/java/net/kyori/adventure/key/KeyPattern.java
  36. +1 −2 key/src/main/java/net/kyori/adventure/key/Namespaced.java
  37. +10 −0 key/src/test/java/net/kyori/adventure/key/KeyTest.java
  38. +2 −2 nbt/src/main/java/net/kyori/adventure/nbt/BinaryTagReaderImpl.java
  39. +8 −1 nbt/src/main/java/net/kyori/adventure/nbt/BinaryTagType.java
  40. +14 −14 nbt/src/main/java/net/kyori/adventure/nbt/BinaryTagTypes.java
  41. +15 −0 nbt/src/main/java/net/kyori/adventure/nbt/ByteArrayBinaryTag.java
  42. +17 −2 nbt/src/main/java/net/kyori/adventure/nbt/ByteBinaryTag.java
  43. +10 −10 nbt/src/main/java/net/kyori/adventure/nbt/CompoundTagSetter.java
  44. +15 −0 nbt/src/main/java/net/kyori/adventure/nbt/DoubleBinaryTag.java
  45. +14 −0 nbt/src/main/java/net/kyori/adventure/nbt/EndBinaryTag.java
  46. +15 −0 nbt/src/main/java/net/kyori/adventure/nbt/FloatBinaryTag.java
  47. +15 −0 nbt/src/main/java/net/kyori/adventure/nbt/IntArrayBinaryTag.java
  48. +15 −0 nbt/src/main/java/net/kyori/adventure/nbt/IntBinaryTag.java
  49. +21 −2 nbt/src/main/java/net/kyori/adventure/nbt/ListBinaryTag.java
  50. +15 −0 nbt/src/main/java/net/kyori/adventure/nbt/LongArrayBinaryTag.java
  51. +15 −0 nbt/src/main/java/net/kyori/adventure/nbt/LongBinaryTag.java
  52. +15 −0 nbt/src/main/java/net/kyori/adventure/nbt/ShortBinaryTag.java
  53. +15 −0 nbt/src/main/java/net/kyori/adventure/nbt/StringBinaryTag.java
  54. +13 −13 nbt/src/main/java/net/kyori/adventure/nbt/TagStringReader.java
  55. +5 −5 nbt/src/test/java/net/kyori/adventure/nbt/BigTest.java
  56. +12 −12 nbt/src/test/java/net/kyori/adventure/nbt/ListBinaryTagTest.java
  57. +13 −13 nbt/src/test/java/net/kyori/adventure/nbt/ReadWriteTest.java
  58. +70 −70 nbt/src/test/java/net/kyori/adventure/nbt/StringIOTest.java
  59. +1 −1 readme.md
  60. +1 −1 ...te3/src/main/java/net/kyori/adventure/serializer/configurate3/HoverEventShowEntitySerializer.java
  61. +1 −1 ...rate3/src/main/java/net/kyori/adventure/serializer/configurate3/HoverEventShowItemSerializer.java
  62. +1 −2 ...r-configurate3/src/main/java/net/kyori/adventure/serializer/configurate3/TextColorSerializer.java
  63. +4 −4 ...igurate3/src/test/java/net/kyori/adventure/serializer/configurate3/HoverEventSerializersTest.java
  64. +1 −1 ...te4/src/main/java/net/kyori/adventure/serializer/configurate4/HoverEventShowEntitySerializer.java
  65. +1 −1 ...rate4/src/main/java/net/kyori/adventure/serializer/configurate4/HoverEventShowItemSerializer.java
  66. +1 −2 ...r-configurate4/src/main/java/net/kyori/adventure/serializer/configurate4/TextColorSerializer.java
  67. +4 −4 ...igurate4/src/test/java/net/kyori/adventure/serializer/configurate4/HoverEventSerializersTest.java
  68. +5 −2 settings.gradle.kts
  69. +7 −4 text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/internal/TagInternals.java
  70. +47 −0 text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/TagPattern.java
  71. +5 −4 text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/resolver/Formatter.java
  72. +5 −4 text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/resolver/Placeholder.java
  73. +9 −8 text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/resolver/TagResolver.java
  74. +1 −2 ...minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/standard/ColorTagResolver.java
  75. +4 −4 text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/standard/HoverTag.java
  76. +1 −1 text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/standard/TransitionTag.java
  77. +10 −0 text-serializer-ansi/build.gradle.kts
  78. +132 −0 ...rializer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializer.java
  79. +175 −0 ...izer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializerImpl.java
  80. +5 −14 ...a → text-serializer-ansi/src/main/java/net/kyori/adventure/text/serializer/ansi/package-info.java
  81. +61 −0 ...izer-ansi/src/test/java/net/kyori/adventure/text/serializer/ansi/ANSIComponentSerializerTest.java
  82. +1 −2 text-serializer-gson-legacy-impl/build.gradle.kts
  83. +8 −1 .../main/java/net/kyori/adventure/text/serializer/gson/legacyimpl/NBTLegacyHoverEventSerializer.java
  84. +7 −53 ...n/java/net/kyori/adventure/text/serializer/gson/legacyimpl/NBTLegacyHoverEventSerializerImpl.java
  85. +1 −4 text-serializer-gson/build.gradle.kts
  86. +18 −18 ...rializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ComponentSerializerImpl.java
  87. +17 −9 ...rializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/GsonComponentSerializer.java
  88. +4 −4 ...izer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/GsonComponentSerializerImpl.java
  89. +53 −0 ...n/src/main/java/net/kyori/adventure/text/serializer/gson/JSONComponentSerializerProviderImpl.java
  90. +5 −46 ...lizer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/LegacyHoverEventSerializer.java
  91. +3 −2 text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/SerializerFactory.java
  92. +11 −11 ...-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ShowEntitySerializer.java
  93. +12 −12 text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ShowItemSerializer.java
  94. +34 −26 text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/StyleSerializer.java
  95. +2 −2 text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/TextColorSerializer.java
  96. +1 −0 ...urces/META-INF/services/net.kyori.adventure.text.serializer.json.JSONComponentSerializer$Provider
  97. +49 −0 ...serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/ColorDownsamplingTest.java
  98. +0 −104 ...izer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/GsonComponentSerializerTest.java
  99. +0 −67 text-serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/GsonTest.java
  100. +0 −74 ...erializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/ShowItemSerializerTest.java
  101. +0 −215 text-serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/StyleTest.java
  102. +11 −0 text-serializer-json-legacy-impl/build.gradle.kts
  103. +45 −0 .../main/java/net/kyori/adventure/text/serializer/json/legacyimpl/NBTLegacyHoverEventSerializer.java
  104. +108 −0 ...n/java/net/kyori/adventure/text/serializer/json/legacyimpl/NBTLegacyHoverEventSerializerImpl.java
  105. +29 −0 ...n-legacy-impl/src/main/java/net/kyori/adventure/text/serializer/json/legacyimpl/package-info.java
  106. +61 −0 text-serializer-json/build.gradle.kts
  107. +7 −8 ...son/src/jmh/java/net/kyori/adventure/text/serializer/json}/ComponentDeserializationBenchmark.java
  108. +4 −5 ...-json/src/jmh/java/net/kyori/adventure/text/serializer/json}/ComponentSerializationBenchmark.java
  109. +70 −0 ...zer-json/src/main/java/net/kyori/adventure/text/serializer/json/DummyJSONComponentSerializer.java
  110. +72 −0 ...erializer-json/src/main/java/net/kyori/adventure/text/serializer/json/JSONComponentConstants.java
  111. +136 −0 ...rializer-json/src/main/java/net/kyori/adventure/text/serializer/json/JSONComponentSerializer.java
  112. +45 −0 ...-json/src/main/java/net/kyori/adventure/text/serializer/json/JSONComponentSerializerAccessor.java
  113. +79 −0 ...lizer-json/src/main/java/net/kyori/adventure/text/serializer/json/LegacyHoverEventSerializer.java
  114. +4 −0 text-serializer-json/src/main/java/net/kyori/adventure/text/serializer/json/package-info.java
  115. +26 −26 ...r-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json}/BlockNBTComponentTest.java
  116. +14 −14 ...-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json}/EntityNBTComponentTest.java
  117. +56 −0 ...-serializer-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json/Issue788Test.java
  118. +3 −3 ...serializer-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json}/Issue792Test.java
  119. +82 −0 ...n/src/testFixtures/java/net/kyori/adventure/text/serializer/json/JSONComponentSerializerTest.java
  120. +6 −3 ...er-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json}/KeybindComponentTest.java
  121. +22 −15 ...izer-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json}/ScoreComponentTest.java
  122. +19 −8 ...er-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json/SelectorComponentTest.java
  123. +100 −0 ...erializer-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json/SerializerTest.java
  124. +116 −0 ...r-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json/ShowItemSerializerTest.java
  125. +14 −14 ...json/src/testFixtures/java/net/kyori/adventure/text/serializer/json}/StorageNBTComponentTest.java
  126. +152 −0 text-serializer-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json/StyleTest.java
  127. +36 −35 ...lizer-json/src/testFixtures/java/net/kyori/adventure/text/serializer/json}/TextComponentTest.java
  128. +29 −28 ...on/src/testFixtures/java/net/kyori/adventure/text/serializer/json}/TranslatableComponentTest.java
  129. +225 −0 ...erializer-legacy/src/main/java/net/kyori/adventure/text/serializer/legacy/CharacterAndFormat.java
  130. +114 −0 ...lizer-legacy/src/main/java/net/kyori/adventure/text/serializer/legacy/CharacterAndFormatImpl.java
  131. +63 −0 ...alizer-legacy/src/main/java/net/kyori/adventure/text/serializer/legacy/CharacterAndFormatSet.java
  132. +12 −1 ...er-legacy/src/main/java/net/kyori/adventure/text/serializer/legacy/LegacyComponentSerializer.java
  133. +35 −62 ...egacy/src/main/java/net/kyori/adventure/text/serializer/legacy/LegacyComponentSerializerImpl.java
  134. +9 −11 ...java → text-serializer-legacy/src/main/java/net/kyori/adventure/text/serializer/legacy/Reset.java
  135. +13 −0 ...egacy/src/test/java/net/kyori/adventure/text/serializer/legacy/LegacyComponentSerializerTest.java
4 changes: 3 additions & 1 deletion .checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -274,7 +274,9 @@
-->

<!-- https://gitlab.com/stellardrift/stylecheck/-/blob/trunk/src/main/java/ca/stellardrift/stylecheck/AnnotationsCloseToType.java -->
<module name="AnnotationsCloseToType"/>
<module name="AnnotationsCloseToType">
<property name="typeUseAnnotations" value="NotNull, Nullable, Pattern, RegExp, KeyPattern, KeyPattern.Namespace, KeyPattern.Value"/>
</module>

<!-- https://checkstyle.org/config_javadoc.html#WriteTag -->
<!-- https://gitlab.com/stellardrift/stylecheck/-/blob/trunk/src/main/java/ca/stellardrift/stylecheck/FilteringWriteTag.java -->
2 changes: 1 addition & 1 deletion .checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<suppress files="api[\\/]src[\\/]main[\\/]java[\\/]net[\\/]kyori[\\/]adventure[\\/]Adventure.java" checks="SummaryJavadoc"/>

<!-- no javadoc on test and internal classes -->
<suppress files="src[\\/](test|jmh)[\\/]java[\\/].*" checks="(FilteringWriteTag|JavadocPackage|MissingJavadoc.*)"/>
<suppress files="src[\\/](test(?:Fixtures)?|jmh)[\\/]java[\\/].*" checks="(FilteringWriteTag|JavadocPackage|MissingJavadoc.*)"/>
<suppress files="api[\\/]src[\\/]main[\\/]java[\\/]net[\\/]kyori[\\/]adventure[\\/]internal[\\/].*" checks="(FilteringWriteTag|JavadocPackage|MissingJavadoc.*)"/>
<suppress files="minimessage[\\/]src[\\/]main[\\/]java[\\/]net[\\/]kyori[\\/]adventure[\\/]text[\\/]minimessage[\\/]parser[\\/].*" checks="(FilteringWriteTag|JavadocPackage|MissingJavadoc.*)"/>

9 changes: 7 additions & 2 deletions annotation-processors/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -8,6 +8,11 @@ dependencies {
api(libs.jetbrainsAnnotations)
}

tasks.withType(AbstractPublishToMaven::class) {
isEnabled = false
tasks {
withType(AbstractPublishToMaven::class).configureEach {
isEnabled = false
}
copyJavadoc {
isEnabled = false
}
}
2 changes: 1 addition & 1 deletion api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ plugins {

configurations {
testCompileOnly {
extendsFrom(compileOnlyApi.forUseAtConfigurationTime().get())
extendsFrom(compileOnlyApi.get())
}
}

2 changes: 2 additions & 0 deletions api/src/main/java/net/kyori/adventure/audience/Audience.java
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@
import java.util.function.Predicate;
import java.util.stream.Collector;
import net.kyori.adventure.bossbar.BossBar;
import net.kyori.adventure.bossbar.BossBarViewer;
import net.kyori.adventure.chat.ChatType;
import net.kyori.adventure.chat.SignedMessage;
import net.kyori.adventure.identity.Identified;
@@ -83,6 +84,7 @@
* and any new methods will be stubbed by default.</p>
*
* @see ForwardingAudience
* @see BossBarViewer
* @since 4.0.0
*/
public interface Audience extends Pointered {
38 changes: 38 additions & 0 deletions api/src/main/java/net/kyori/adventure/bossbar/BossBar.java
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
package net.kyori.adventure.bossbar;

import java.util.Set;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.ComponentLike;
import net.kyori.adventure.util.Index;
@@ -379,6 +380,43 @@ default float percent() {
@Contract("_ -> this")
@NotNull BossBar removeListener(final @NotNull Listener listener);

/**
* Gets an unmodifiable view of the viewers of this bossbar.
*
* <p>The returned value may be empty if this method is unsupported.</p>
*
* @return an unmodifiable view of the viewers of this bossbar
* @since 4.14.0
*/
@UnmodifiableView
@NotNull Iterable<? extends BossBarViewer> viewers();

/**
* Show this bossbar to {@code viewer}.
*
* @param viewer the viewer
* @return the bossbar
* @see Audience#showBossBar(BossBar)
* @since 4.14.0
*/
default @NotNull BossBar addViewer(final @NotNull Audience viewer) {
viewer.showBossBar(this);
return this;
}

/**
* Hide this bossbar from {@code viewer}.
*
* @param viewer the viewer
* @return the bossbar
* @see Audience#hideBossBar(BossBar)
* @since 4.14.0
*/
default @NotNull BossBar removeViewer(final @NotNull Audience viewer) {
viewer.hideBossBar(this);
return this;
}

/**
* A listener for changes that happen on a {@link BossBar}.
*
Original file line number Diff line number Diff line change
@@ -266,6 +266,14 @@ public boolean hasFlag(final @NotNull Flag flag) {
return this;
}

@Override
public @NotNull Iterable<? extends BossBarViewer> viewers() {
if (this.implementation != null) {
return this.implementation.viewers();
}
return Collections.emptyList();
}

private void forEachListener(final @NotNull Consumer<Listener> consumer) {
for (final Listener listener : this.listeners) {
consumer.accept(listener);
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@
*/
package net.kyori.adventure.bossbar;

import java.util.Collections;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

@@ -47,6 +48,17 @@ public interface BossBarImplementation {
return BossBarImpl.ImplementationAccessor.get(bar, type);
}

/**
* Gets the viewers of this bossbar.
*
* @return the viewers of this bossbar
* @since 4.14.0
*/
@ApiStatus.Internal
default @NotNull Iterable<? extends BossBarViewer> viewers() {
return Collections.emptyList();
}

/**
* A {@link BossBarImplementation} service provider.
*
43 changes: 43 additions & 0 deletions api/src/main/java/net/kyori/adventure/bossbar/BossBarViewer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* This file is part of adventure, licensed under the MIT License.
*
* Copyright (c) 2017-2023 KyoriPowered
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.kyori.adventure.bossbar;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.UnmodifiableView;

/**
* Something that can view a {@link BossBar}.
*
* @since 4.14.0
*/
public interface BossBarViewer {
/**
* Gets an unmodifiable view of all known currently active bossbars.
*
* @return an unmodifiable view of all known currently active bossbars
* @since 4.14.0
*/
@UnmodifiableView
@NotNull Iterable<? extends BossBar> activeBossBars();
}
Original file line number Diff line number Diff line change
@@ -30,6 +30,8 @@
import net.kyori.adventure.util.TriState;
import org.jetbrains.annotations.NotNull;

import static java.util.Objects.requireNonNull;

/**
* Something that has permissions.
*
@@ -50,7 +52,8 @@ public interface PermissionChecker extends Predicate<String> {
* @return a {@link PermissionChecker}
* @since 4.8.0
*/
static @NotNull PermissionChecker always(final TriState state) {
static @NotNull PermissionChecker always(final @NotNull TriState state) {
requireNonNull(state);
if (state == TriState.TRUE) return PermissionCheckers.TRUE;
if (state == TriState.FALSE) return PermissionCheckers.FALSE;
return PermissionCheckers.NOT_SET;
@@ -63,10 +66,10 @@ public interface PermissionChecker extends Predicate<String> {
* @return a tri-state result
* @since 4.8.0
*/
@NotNull TriState value(final String permission);
@NotNull TriState value(final @NotNull String permission);

@Override
default boolean test(final String permission) {
default boolean test(final @NotNull String permission) {
return this.value(permission) == TriState.TRUE;
}
}
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ private Always(final TriState value) {
}

@Override
public @NotNull TriState value(final String permission) {
public @NotNull TriState value(final @NotNull String permission) {
return this.value;
}

32 changes: 32 additions & 0 deletions api/src/main/java/net/kyori/adventure/text/Component.java
Original file line number Diff line number Diff line change
@@ -192,6 +192,38 @@ public interface Component extends ComponentBuilderApplicable, ComponentLike, Ex
return Component.text().append(component).build();
}

/**
* Joins {@code components} using the configuration in {@code configBuilder}.
*
* @param configBuilder the join configuration
* @param components the components
* @return the resulting component
* @see JoinConfiguration#noSeparators()
* @see JoinConfiguration#separator(ComponentLike)
* @see JoinConfiguration#separators(ComponentLike, ComponentLike)
* @since 4.14.0
*/
@Contract(pure = true)
static @NotNull Component join(final JoinConfiguration.@NotNull Builder configBuilder, final @NotNull ComponentLike@NotNull... components) {
return join(configBuilder, Arrays.asList(components));
}

/**
* Joins {@code components} using the configuration in {@code configBuilder}.
*
* @param configBuilder the join configuration
* @param components the components
* @return the resulting component
* @see JoinConfiguration#noSeparators()
* @see JoinConfiguration#separator(ComponentLike)
* @see JoinConfiguration#separators(ComponentLike, ComponentLike)
* @since 4.14.0
*/
@Contract(pure = true)
static @NotNull Component join(final JoinConfiguration.@NotNull Builder configBuilder, final @NotNull Iterable<? extends ComponentLike> components) {
return JoinConfigurationImpl.join(configBuilder.build(), components);
}

/**
* Joins {@code components} using the configuration in {@code config}.
*
Loading