Repository navigation
Ask for input with BentoBox prompts instead of Bukkit conversations - #185
Merged
Merged
Conversation
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
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 for removal. This addon used it, throughConversationUtils, every time it asked a player to type something.What
ConversationUtilskeeps 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(orfalsefor 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: falsein 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 ownconversations.confirm-string,deny-string,exit-string,cancel-string,numeric-only,not-valid-valueandprefixkeys 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.
createIDStringInputstill 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 ofChatColor.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:
com.github.MockBukkit:MockBukkit:v1.21-SNAPSHOT→org.mockbukkit.mockbukkit:mockbukkit-v26.3:4.119.0; Mockito 5.11.0 → 5.20.0.repo.codemc.io).build.ymlused JDK 17 withsetup-java@v1, now JDK 25 (Temurin) withsetup-java@v4;modrinth-publish.ymlJDK 21 → 25.addon.ymlapi-version1.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.versionis3.25.0-SNAPSHOTbecause 3.25.0 is not released yet. Change it to3.25.0before releasing this addon.Testing
ConversationUtilsTest(10 tests) covers each method on the chat path, including cancel and a refused ID.mvn verify: 92 tests pass.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