Skip to content

Fix compilation errors caused by Kyori Adventure API ClickEvent.Payload removal - #1

Draft
Faboit1 with Copilot wants to merge 6 commits into
mainfrom
copilot/fix-incompatible-class-change-error
Draft

Fix compilation errors caused by Kyori Adventure API ClickEvent.Payload removal#1
Faboit1 with Copilot wants to merge 6 commits into
mainfrom
copilot/fix-incompatible-class-change-error

Conversation

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown

The project was failing to compile due to missing payloadType() and payload() methods on ClickEvent, as the newer ClickEvent.Payload API is not present in the currently targeted version of the Kyori Adventure API.

Changes

  • MineDownParser.java: Replaced payload type inference and casting logic with a direct pass-through of the string value using ClickEvent.value().
  • MineDownStringifier.java: Updated definitions building to pull the payload directly via clickEvent.value() rather than switching on ClickEvent.Payload subclasses.
  • Replacer.java: Replaced custom/text payload handling with direct string replacement on clickEvent.value().

Example

Previously, click event payloads were handled using types:

ClickEvent.Payload payload = clickEvent.payload();
if (payload instanceof ClickEvent.Payload.Text) { ... }

Now, they are retrieved directly as strings:

String payload = clickEvent.value();

Copilot AI added 2 commits June 24, 2026 10:06
…compatibilities

- Copy minedown-adventure source (based on 1.7.6-SNAPSHOT) into
  src/main/java/de/themoep/minedown/adventure/
- Util.java: remove 'implements TextFormat' from TextControl enum so it
  no longer conflicts with sealed TextFormat interface in newer Adventure
- Util.java: change getFormatFromString/getFormatFromLegacy return types
  and getLegacyFormatChar parameter from TextFormat to Object
- Util.java: fix rgbColorsToLegacy to not use removed BuildableComponent
- MineDownParser.java: change all Map.Entry<TextFormat,Boolean> to
  Map.Entry<Object,Boolean> to accommodate non-TextFormat TextControl
- Replacer.java: remove BuildableComponent (removed from Adventure 4.14)
  and replace with TextComponent instanceof check
- Remove external de.themoep:minedown-adventure:1.7.5 dependency and
  repo.minebench.de repository from build.gradle.kts

Fixes IncompatibleClassChangeError (sealed TextFormat) and
NoSuchMethodError (ComponentBuilder.build returning BuildableComponent)
seen on Purpur 26.2 / Paper with Adventure 4.14+.
Copilot AI changed the title fix: vendor patched minedown-adventure to fix Adventure API incompatibilities on Purpur 26.2 fix: vendor patched minedown-adventure to resolve Adventure 4.14+ incompatibilities Jun 24, 2026
Copilot AI requested a review from Faboit1 June 24, 2026 10:09
Copilot AI changed the title fix: vendor patched minedown-adventure to resolve Adventure 4.14+ incompatibilities Add GitHub Actions autocompile workflow Jun 24, 2026
Copilot AI changed the title Add GitHub Actions autocompile workflow Add GitHub Actions build workflow + fix missing minebench repository Jun 24, 2026
Copilot AI changed the title Add GitHub Actions build workflow + fix missing minebench repository Fix build: remove Adventure 4.25.0 ObjectComponent API from vendored MineDown source Jun 24, 2026
Copilot AI changed the title Fix build: remove Adventure 4.25.0 ObjectComponent API from vendored MineDown source Fix compilation errors caused by Kyori Adventure API ClickEvent.Payload removal Jun 24, 2026
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