add new prefixed line methods for error, info, success, and warning components#286
Conversation
|
This PR contains changes that modified the public API. To update the reference ABI dumps: ./gradlew updateKotlinAbi
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
Adds convenience overloads to append new lines with standard status prefixes (error/info/success/warning) when building Adventure components.
Changes:
- Add synchronous
appendNew*PrefixedLine { ... }overloads for error/info/success/warning component builders. - Minor formatting changes in the affected builder color interfaces.
- Remove the generated
VanillaAdvancementKeysKotlin source from the core API module.
Reviewed changes
Copilot reviewed 5 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
surf-api-core/surf-api-core/src/main/kotlin/dev/slne/surf/api/core/messages/builder/colors/WarningComponentBuilderColor.kt |
Adds appendNewWarningPrefixedLine { ... } overload. |
surf-api-core/surf-api-core/src/main/kotlin/dev/slne/surf/api/core/messages/builder/colors/SuccessComponentBuilderColor.kt |
Adds appendNewSuccessPrefixedLine { ... } overload. |
surf-api-core/surf-api-core/src/main/kotlin/dev/slne/surf/api/core/messages/builder/colors/InfoComponentBuilderColor.kt |
Adds appendNewInfoPrefixedLine { ... } overload. |
surf-api-core/surf-api-core/src/main/kotlin/dev/slne/surf/api/core/messages/builder/colors/ErrorComponentBuilderColor.kt |
Adds appendNewErrorPrefixedLine { ... } overload. |
surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/generated/VanillaAdvancementKeys.kt |
Deletes the generated advancement key constants source file from the API module. |
|
|
||
| interface WarningComponentBuilderColor : ComponentBuilderColor { | ||
| fun SurfComponentBuilder.appendWarningPrefix() = append(Colors.WARNING_PREFIX) | ||
|
|
There was a problem hiding this comment.
There is trailing whitespace on this otherwise blank line (likely introduced by the edit). Please remove the spaces to avoid ktlint/formatting failures and noisy diffs.
|
|
||
| interface SuccessComponentBuilderColor : ComponentBuilderColor { | ||
| fun SurfComponentBuilder.appendSuccessPrefix() = append(Colors.SUCCESS_PREFIX) | ||
|
|
There was a problem hiding this comment.
There is trailing whitespace on this otherwise blank line (likely introduced by the edit). Please remove the spaces to avoid ktlint/formatting failures and noisy diffs.
|
|
||
| interface InfoComponentBuilderColor : ComponentBuilderColor { | ||
| fun SurfComponentBuilder.appendInfoPrefix() = append(Colors.INFO_PREFIX) | ||
|
|
There was a problem hiding this comment.
There is trailing whitespace on this otherwise blank line (likely introduced by the edit). Please remove the spaces to avoid ktlint/formatting failures and noisy diffs.
|
|
||
| interface ErrorComponentBuilderColor : ComponentBuilderColor { | ||
| fun SurfComponentBuilder.appendErrorPrefix() = append(Colors.ERROR_PREFIX) | ||
|
|
There was a problem hiding this comment.
There is trailing whitespace on this otherwise blank line (likely introduced by the edit). Please remove the spaces to avoid ktlint/formatting failures and noisy diffs.
| fun SurfComponentBuilder.appendNewErrorPrefixedLine() = appendNewline().appendErrorPrefix() | ||
| fun SurfComponentBuilder.appendNewErrorPrefixedLine(block: SurfComponentBuilder.() -> Unit) = | ||
| appendNewline().appendErrorPrefix().append(block) |
There was a problem hiding this comment.
In addition to adding these prefixed-line builder overloads, this PR also removes the generated VanillaAdvancementKeys from the core API module. That deletion is unrelated to the stated PR goal and is a breaking change for any downstream users relying on those constants; please either revert that removal or explicitly document/migrate it (e.g., provide a deprecated shim or replacement type).
…rror, info, success, and warning components
…tions' into feat/more-component-builder-functions # Conflicts: # gradle.properties
No description provided.