Skip to content

feat: Add /servers command for server selection#3

Merged
indra87g merged 6 commits into
mainfrom
feature/server-selector
Sep 23, 2025
Merged

feat: Add /servers command for server selection#3
indra87g merged 6 commits into
mainfrom
feature/server-selector

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

This change adds a new /servers command 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

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.
@google-labs-jules

Copy link
Copy Markdown
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.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

indra87g and others added 5 commits September 23, 2025 18:19
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.
@indra87g indra87g marked this pull request as ready for review September 23, 2025 11:59
@indra87g indra87g merged commit 4b82d46 into main Sep 23, 2025
1 check passed
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