Feat/some new nice to have things#251
Conversation
|
This PR contains changes that modified the public API. To update the reference ABI dumps: ./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git pushAfter updating, the CI will pass. Make sure the changes are backward compatible. |
There was a problem hiding this comment.
Pull request overview
This PR adds small “nice-to-have” API conveniences across the core messaging utilities and Bukkit utilities, primarily to streamline Adventure component/sound usage, inventory UI building, and PacketEvents packet sending.
Changes:
- Add new messaging helpers:
Audience.sendActionBar { ... }andSurfComponentBuilder.translatable(...). - Add convenience aliases:
AdventureSound(core) andBukkitSound(bukkit), plus an inventoryView.outlineItemhelper. - Add Bukkit utility extensions for sending PacketEvents packets and a
Location.readableString(...)formatter.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| surf-api-core/.../SurfComponentBuilder.kt | Adds translatable(...) builder helper and adjusts message imports. |
| surf-api-core/.../sound-extensions.kt | Adds AdventureSound typealias next to existing Sound DSL helpers. |
| surf-api-core/.../audience-extension.kt | Adds Audience.sendActionBar { ... } DSL-style extension and minor formatting. |
| surf-api-bukkit/.../bukkit-util.kt | Adds PacketEvents packet send helpers, Location.readableString, and BukkitSound alias. |
| surf-api-bukkit/.../inventory/framework/extensions.kt | Adds View.outlineItem convenience for UI outlines. |
| gradle.properties | Bumps project version to 1.21.11-2.67.1. |
...kit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/util/bukkit-util.kt
Outdated
Show resolved
Hide resolved
...kit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/util/bukkit-util.kt
Outdated
Show resolved
Hide resolved
...kit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/util/bukkit-util.kt
Outdated
Show resolved
Hide resolved
...ukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/inventory/framework/extensions.kt
Show resolved
Hide resolved
...re-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/adventure/sound-extensions.kt
Show resolved
Hide resolved
...-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/builder/SurfComponentBuilder.kt
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
This PR contains changes that modified the public API. To update the reference ABI dumps: ./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git pushAfter updating, the CI will pass. Make sure the changes are backward compatible. |
1 similar comment
|
This PR contains changes that modified the public API. To update the reference ABI dumps: ./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git pushAfter updating, the CI will pass. Make sure the changes are backward compatible. |
|
This PR contains changes that modified the public API. To update the reference ABI dumps: ./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git pushAfter updating, the CI will pass. Make sure the changes are backward compatible. |
This pull request introduces several enhancements and utility additions to the Bukkit and core API modules. The main focus is on extending messaging and inventory frameworks, improving packet handling, and adding new convenience functions and type aliases for clarity and ease of use.
Messaging and Audience Extensions:
sendActionBarextension toAudiencefor sending action bar messages using aSurfComponentBuilderblock.Audienceextension functions, including better error handling and formatting fordisplayNameand permission checks.translatablefunction toSurfComponentBuilderfor appending translatable components with color and decoration support.AdventureSoundtype alias forSoundto clarify usage in the core API.Inventory and Bukkit Utilities:
outlineItemproperty toViewfor generating a gray stained glass pane with an empty display name, useful for inventory UI outlines.Playerobject usingPacketEvents, and areadableStringextension forLocationfor improved debugging and logging. Also introducedBukkitSoundtype alias forSound.Dependency and Import Updates:
Version Update:
gradle.propertiesfrom1.21.11-2.67.0to1.21.11-2.67.1.