feat: Add /servers command for server selection#3
Merged
Conversation
This commit introduces a new `/servers` command that allows players to select a server from a configurable list. The server list is managed in a new `servers.yml` file. When a player executes the `/servers` command, a UI with a list of servers is displayed. Upon selecting a server, a 3-second countdown is initiated, with a message displayed on the player's screen. If the player moves during the countdown, the teleportation is cancelled. Otherwise, the player is transferred to the selected server. This feature is implemented using the `FormConstructor` library for the UI, a `PluginTask` for the countdown, and a `PlayerMoveEvent` listener to handle movement cancellation.
Contributor
Author
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll acknowledge your comments with a 👀 emoji and then get to work. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! I will automatically address your feedback. For any comments you don't want me to act on, just include (aside). For security, I will only act on instructions from the user who triggered this task for this pull request. |
|
|
This commit introduces a new `/servers` command that allows players to select a server from a configurable list. The server list is managed in a new `servers.yml` file. When a player executes the `/servers` command, a UI with a list of servers is displayed. Upon selecting a server, a 3-second countdown is initiated, with a message displayed on the player's screen. If the player moves during the countdown, the teleportation is cancelled. Otherwise, the player is transferred to the selected server. This feature is implemented using the `FormConstructor` library for the UI, a `PluginTask` for the countdown, and a `PlayerMoveEvent` listener to handle movement cancellation. Fixes compilation errors by: - Updating the FormConstructor dependency information in `pom.xml`. - Correcting the import path in `ServersCommand.java`. - Fixing a syntax error in `pom.xml` (unclosed `repositories` tag).
This commit introduces a new `/servers` command that allows players to select a server from a configurable list. The server list is managed in a new `servers.yml` file. When a player executes the `/servers` command, a UI with a list of servers is displayed. Upon selecting a server, a 3-second countdown is initiated, with a message displayed on the player's screen. If the player moves during the countdown, the teleportation is cancelled. Otherwise, the player is transferred to the selected server. This feature is implemented using the `FormConstructor` library for the UI, a `PluginTask` for the countdown, and a `PlayerMoveEvent` listener to handle movement cancellation. Fixes compilation errors by: - Updating the FormConstructor dependency information in `pom.xml` to use the correct repository (JitPack) and group/artifact IDs for version 2.0.0. - Correcting the import path in `ServersCommand.java`. - Fixing a syntax error in `pom.xml` (unclosed `repositories` tag).
This commit refactors the server selector feature to use Nukkit's built-in FormAPI instead of the external `FormConstructor` library, which was causing persistent compilation issues. The functionality remains identical: - A `/servers` command displays a UI with a list of servers from `servers.yml`. - Selecting a server starts a 3-second countdown. - Moving during the countdown cancels the teleport. - Otherwise, the player is transferred to the selected server. The implementation has been updated to use `FormWindowSimple` for the UI and a `PlayerFormRespondedEvent` listener to handle player input, removing the need for the external dependency.
This commit refactors the server selector feature to use Nukkit's built-in FormAPI instead of the external `FormConstructor` library, which was causing persistent compilation issues. The functionality remains identical: - A `/servers` command displays a UI with a list of servers from `servers.yml`. - Selecting a server starts a 3-second countdown. - Moving during the countdown cancels the teleport. - Otherwise, the player is transferred to the selected server. This also fixes compilation errors related to incompatible types when reading the server list from the configuration by using the correct `List<Map>` data type.
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.
This change adds a new
/serverscommand that allows players to select a server from a configurable list. The feature includes a countdown before teleportation and cancellation on movement.PR created automatically by Jules for task 6622423159182004386