Repository navigation
Add a prompts API to replace Bukkit conversations - #3140
Merged
Merged
Conversation
Paper has deprecated org.bukkit.conversations for removal. Core used it in 14 files and eight addons use it through copies of ConversationUtils. New package api.prompts asks a player for text, an id, several lines, a number or a confirmation. A prompt is shown as a dialog with a text box where dialogs are supported and island.dialogs.prompts is on, and is asked in chat otherwise, through a core-owned AsyncChatEvent listener. Answers are validated and asked for again when wrong. Core's own prompts now use it: home renaming, the team invite search, the settings reset confirmation, the blueprint bundle name, description and commands, and the picker search, which now also works without dialogs. The old conversation classes and the Conversable overloads on BlueprintManagementPanel stay, deprecated for removal. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe
Split the starting name and the length check out of askName, drop the nested ternary, and use the MANAGEMENT constant throughout. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe
The search prompt now starts from the current search text, and submitting it empty clears the search instead of being refused. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe
|
This was referenced Nov 23, 2026
Merged
tastybento
added a commit
to BentoBoxWorld/Biomes
that referenced
this pull request
Nov 23, 2026
…185) ## 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](BentoBoxWorld/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.com/claude-code) https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Why
Paper has marked
org.bukkit.conversationsas@Deprecated(forRemoval = true)(checked in the 26.3 API jar). Core uses it in 14 files, and eight addons use it through near-identical copies ofConversationUtils/ChatInput.What
A new public package,
world.bentobox.bentobox.api.prompts, that asks a player to type something:Prompts.text(user)Prompts.id(user)Prompts.lines(user)List<String>)Prompts.integer(user, min, max)/Prompts.decimal(user, min, max)Prompts.confirm(user)island.dialogs.promptssetting is on (default), the prompt is a dialog with a text box, pre-filled with the current value. A bad answer re-opens the dialog with the reason and what was typed.AsyncChatEventlistener. It has a cancel word, a done word for multi-line input and a 90 second timeout. It does not use the Bukkit conversation API.onSubmitonly receives a value that passed parsing and everyvalidatecheck.Core call sites converted
/island renamehomeSettingsPanelandSettingsTab)PickerPanelsearch, which was hidden where dialogs are unsupported and now works there in chatBehaviour changes to know about
clearword is gone.prompts.chat.confirm-word, andprotection.panel.reset-to-default.confirm/.instructionsare no longer used.onCancel, because the server is not told about it.Compatibility
Nothing is removed. The nine old conversation classes and the four
Conversableoverloads onBlueprintManagementPanelare kept and marked@Deprecated(since = "3.25.0", forRemoval = true); no addon checked out locally uses them. They will have to be deleted when Paper actually removes the API.Locale and config
island.dialogs.prompts(defaulttrue).prompts.*and four undercommands.admin.blueprint.management), translated into all 23 other locales.Testing
PromptsTest(28),IslandRenamehomeCommandTest(5, new), plus additions toBlueprintManagementPanelTest,SettingsPanelTestandIslandTeamInviteGUITest. Full suite: 3,864+ pass.island.dialogs.prompts: false): single-line, multi-line with done/cancel, confirmation, the 90 second timeout, and commands still working while a prompt waits.Follow-up
Each addon's
ConversationUtilscan keep its method signatures and delegate toPrompts, once it requires BentoBox 3.25.🤖 Generated with Claude Code
https://claude.ai/code/session_01HBXcjai4FihmV4n54fjjMe