Skip to content

add new prefixed line methods for error, info, success, and warning components#286

Merged
ammodev merged 4 commits into
version/26.1from
feat/more-component-builder-functions
Apr 4, 2026
Merged

add new prefixed line methods for error, info, success, and warning components#286
ammodev merged 4 commits into
version/26.1from
feat/more-component-builder-functions

Conversation

@ammodev

@ammodev ammodev commented Apr 4, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 4, 2026 19:13
@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ API/ABI changes detected!

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 push

After updating, the CI will pass. Make sure the changes are backward compatible.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 VanillaAdvancementKeys Kotlin 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)

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change

Copilot uses AI. Check for mistakes.

interface SuccessComponentBuilderColor : ComponentBuilderColor {
fun SurfComponentBuilder.appendSuccessPrefix() = append(Colors.SUCCESS_PREFIX)

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change

Copilot uses AI. Check for mistakes.

interface InfoComponentBuilderColor : ComponentBuilderColor {
fun SurfComponentBuilder.appendInfoPrefix() = append(Colors.INFO_PREFIX)

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change

Copilot uses AI. Check for mistakes.

interface ErrorComponentBuilderColor : ComponentBuilderColor {
fun SurfComponentBuilder.appendErrorPrefix() = append(Colors.ERROR_PREFIX)

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +13
fun SurfComponentBuilder.appendNewErrorPrefixedLine() = appendNewline().appendErrorPrefix()
fun SurfComponentBuilder.appendNewErrorPrefixedLine(block: SurfComponentBuilder.() -> Unit) =
appendNewline().appendErrorPrefix().append(block)

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
ammodev added 2 commits April 4, 2026 21:19
…tions' into feat/more-component-builder-functions

# Conflicts:
#	gradle.properties
@ammodev ammodev merged commit ce7a99b into version/26.1 Apr 4, 2026
3 of 4 checks passed
@ammodev ammodev deleted the feat/more-component-builder-functions branch April 4, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants