Skip to content

Ask for input with BentoBox prompts instead of Bukkit conversations - #185

Merged
tastybento merged 3 commits into
developfrom
feat/prompts-api
Nov 23, 2026
Merged

tastybento merged 3 commits into
developfrom
feat/prompts-api

Conversation

@tastybento

Copy link
Copy Markdown
Member

Why

Paper has marked org.bukkit.conversations as deprecated for removal. This addon used it, through ConversationUtils, every time it asked a player to type something.

What

ConversationUtils keeps its method signatures, so no panel code changes, and now hands the work to the prompts API added in BentoBox 3.25.0 (BentoBox#3140). The player gets a dialog with a text box where the server supports dialogs, and is asked in chat otherwise.

Callers get the same answers as before: the value on success, and null (or false for a confirmation) when the player cancels or does not answer.

Behaviour changes

  • Input is asked for in a dialog by default. Server admins can set island.dialogs.prompts: false in BentoBox's config to keep everything in chat.

  • Error messages for a bad number, and the cancel / done / confirm words in chat, now come from BentoBox's locale (prompts.*). This addon's own conversations.confirm-string, deny-string, exit-string, cancel-string, numeric-only, not-valid-value and prefix keys are no longer used.

  • A confirmation in chat is confirmed only by BentoBox's confirm word; anything else declines.

  • Pressing Escape on a dialog closes it without reopening the panel it came from.

  • Some question texts still say "in chat" or "write 'cancel' to exit", which reads oddly in a dialog. The wording is unchanged in this PR.

  • createIDStringInput still hands the consumer the text exactly as typed (callers sanitize it), and a refused ID still shows the caller's failure message with the sanitized [id].

  • Multi-line input now translates colour codes with BentoBox's Util.translateColorCodes (which also understands hex codes) instead of ChatColor.translateAlternateColorCodes.

Toolchain upgrade

BentoBox 3.25 is built for Java 25, so this addon could not stay on Java 21 / Paper 1.21.11 / BentoBox 3.14.0:

  • Java 21 → 25, Paper API 1.21.11 → 26.3.build.231-stable, BentoBox 3.14.0 → 3.25.0-SNAPSHOT.
  • MockBukkit com.github.MockBukkit:MockBukkit:v1.21-SNAPSHOT → org.mockbukkit.mockbukkit:mockbukkit-v26.3:4.119.0; Mockito 5.11.0 → 5.20.0.
  • maven-shade-plugin 3.6.0 → 3.6.2 and JaCoCo 0.8.10 → 0.8.15, because the old versions cannot read Java 25 class files.
  • Added the BentoBox snapshot repository (repo.codemc.io).
  • Workflows: build.yml used JDK 17 with setup-java@v1, now JDK 25 (Temurin) with setup-java@v4; modrinth-publish.yml JDK 21 → 25.
  • addon.yml api-version 1.20 → 3.25.0.

No source changes were needed for the newer APIs. The build still reports existing deprecation-for-removal warnings (Biome.values(), OldEnum.name(), PotionData, Registry.match, BentoBox.getRanksManager()); they are not addressed here.

Requires BentoBox 3.25.0

bentobox.version is 3.25.0-SNAPSHOT because 3.25.0 is not released yet. Change it to 3.25.0 before releasing this addon.

Testing

  • New ConversationUtilsTest (10 tests) covers each method on the chat path, including cancel and a refused ID. mvn verify: 92 tests pass.
  • Not tested in game. The dialog path cannot be unit tested; the underlying prompts were tested in game for BentoBox#3140.
  • The publish workflows' game-version lists were not changed.

Version

2.3.3 → 2.4.0. The last release is 2.3.2; a new minimum BentoBox, Java and Minecraft is more than a patch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe

tastybento and others added 3 commits November 22, 2026 17:53
Paper has deprecated org.bukkit.conversations for removal. ConversationUtils
keeps its method signatures and now delegates to the prompts API added in
BentoBox 3.25.0, which shows a dialog where the server supports one and
asks in chat otherwise.

Requires BentoBox 3.25.0, so the build moves to Java 25, Paper 26.3 and
MockBukkit 4.119.0, with the shade and JaCoCo plugins updated to read
Java 25 class files. Version 2.4.0.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe
Runs mvn verify on JDK 25 for pushes to develop and master and for pull
requests. No SonarQube Cloud analysis: there is no project for this addon.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe
Four of its tests make a BiomesObject, whose icon needs a server's item
registry. With no server the Bukkit classes failed to initialise and
stayed broken for every later test class, so the suite passed or failed
depending on the order the classes ran in.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe
@tastybento
tastybento merged commit b0bf78d into develop Nov 23, 2026
1 check passed
@tastybento
tastybento deleted the feat/prompts-api branch November 23, 2026 04:34
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.

1 participant