Developers - AkselGlyholt/velocity-limbo-handler GitHub Wiki
This page is for developers who want to dive into the internals of VelocityLimboHandler β whether you're contributing, debugging, or just curious about how it works under the hood.
Project Structure
The plugin is written in Java and built for the Velocity Minecraft proxy.
Hereβs a simplified structure of the main components:
velocity-limbo-handler/
βββ src/
β βββ main/
β βββ java/
β βββ com/akselglyholt/velocityLimboHandler/
β βββ VelocityLimboHandler.java <-- Main plugin class
β
β βββ commands/
β βββ CommandBlocker.java <-- Stores blocked commands
β βββ CommandBlockRule.java <-- Command blocking logic
β
β βββ listeners/
β βββ CommandExecuteEventListener.java <-- Handles command blocking events
β βββ ConnectionListener.java <-- Manages player join/leave in the reconnect queue
β
β βββ misc/
β βββ MessageFormater.java <-- Formats messages (e.g. [queue-position])
β βββ Utility.java <-- Helper methods like isServerInMaintenance()
β
β βββ storage/
β βββ PlayerManager.java <-- Manages player queue data and state
Core Flow
-
Startup
VelocityLimboHandler
loads the config and registers event listeners. -
Join Event When a player connects to the Limbo server due to a failed backend, they are queued for reconnection using
PlayerManager
. -
Reconnect Loop A scheduled task checks each serverβs queue and attempts to reconnect the first player if the backend becomes available.
-
Command Handling If a player in Limbo runs a blocked command,
CommandExecuteEventListener
checks it againstCommandBlocker
and cancels it if matched.
Building From Source (Maven)
-
Clone the repository:
git clone https://github.com/AkselGlyholt/velocity-limbo-handler.git cd velocity-limbo-handler
-
Build with Maven:
mvn clean package
-
The compiled
.jar
will be in:target/
Make sure you have Java 17+ and Maven installed.
Testing Setup
To test the plugin locally:
- Use Velocity with 2β3 dummy backend servers (
lobby
,main
,limbo
) - Simulate a backend outage by stopping
main
- Observe how players are queued in Limbo and reconnected automatically
Contributing
Contributions are welcome!
To contribute:
- Fork the repo
- Create a feature branch
- Make your changes
- Open a pull request with a clear explanation
Keep your code clean, documented, and aligned with the existing style.