Minecraft cross-server plugin suite (Java 8, Maven multi-module). Supports Bukkit/Spigot sub-servers with BungeeCord or Velocity proxy.
Project is discontinued — author graduated and is no longer maintaining. Accept maintenance PRs only.
| Module | Type | Runtime | Key Files |
|---|---|---|---|
yuanluServerDo-common |
Shared library | None (compiled into all) | Channel.java (protocol), ShareData.java |
yuanluServerDo-bukkit |
Bukkit plugin | Bukkit/Spigot/Paper | Main.java, Core.java, cmds/ |
yuanluServerDo-bungeecord |
BungeeCord plugin | BungeeCord proxy | Main.java, Core.java, ConfigManager.java |
yuanluServerDo-velocity |
Velocity plugin | Velocity proxy | Main.java, Core.java, ConfigManager.java |
yuanluServerDo-bukkit-bungeecord |
Shade aggregator | — | Only pom.xml, merges bukkit+bungeecord into one fat JAR |
yuanluServerDo-bukkit-velocity |
Shade aggregator | — | Only pom.xml, merges bukkit+velocity into one fat JAR |
Never add Java source to the two shade aggregator modules. They exist solely for deployment convenience.
- Requires Java 8+ (CI uses 17)
- Uses
maven-shade-pluginwith relocations fororg.bstats - All modules declare
<minimizeJar>true</minimizeJar> - Maven Wrapper included — no need to install Maven globally
# Full build (all modules)
./mvnw -B clean package
# Build specific module and its dependencies
./mvnw -B clean package -pl yuanluServerDo-bukkit -am
# Skip tests (faster build)
./mvnw -B clean package -DskipTests
# Install to local repository
./mvnw -B clean installNote: On Windows, use mvnw.cmd instead of ./mvnw.
Artifacts are generated in each module's target/ directory:
yuanluServerDo-bukkit/target/*.jaryuanluServerDo-bungeecord/target/*.jaryuanluServerDo-velocity/target/*.jaryuanluServerDo-bukkit-bungeecord/target/*.jar(fat JAR)yuanluServerDo-bukkit-velocity/target/*.jar(fat JAR)
Triggered automatically when a release is published on GitHub:
- GitHub Actions runs
mvn -B package --file pom.xml - All 5 JAR artifacts are uploaded to the release page
Workflow file: .github/workflows/Upload Release Asset.yml
Required permissions: The workflow uses gh release upload which requires contents: write permission.
To create a new release:
- Update version in root
pom.xml(e.g.,1.2.2→1.2.3) - Commit and push to
devbranch - Create a new release on GitHub (tag should match version)
- Actions will automatically build and attach JARs
- Channel:
bc:yuanlu-sdo(ShareData.BC_CHANNEL, forced lowercase) - Packet format: 4-byte big-endian int (Channel.ordinal) + 1-byte subId + payload
- Protocol version: Computed from
Channelenum names MD5 hash. Mismatch blocks communication. - Naming convention:
{s|p}{hexId}{C|S}_{name}s=send,p=parse;C=client(Bukkit),S=server(proxy)- Example:
s0C_tpReq= Bukkit sends, subId 0, client side, teleport request
Channelenum = packet type registry + codec + dispatcherDataIn/DataOutuse fixed-size object pools (16 / 128) — never replace with unbuffered streamsWaitMaintain(DelayQueue) handles all timeouts:T_Net(5s),T_User(120s)LRUCache(array-based, not LinkedHashMap) withsynchronized— subclasscreate(K)for lazy loading- Callbacks use custom functional interfaces in
Channel.Package(e.g.,BoolConsumer,BiPlayerConsumer)
preload: trueinconfig.yml→ registers commands duringonLoad()to override Essentials/CMICommandManagerscanscmdspackage by reflection; class names must matchCmdXxx- Command name inferred from class name via camelCase-to-hyphen conversion
config.ymlmessage.*supports three formats:- Plain string (
&color codes) - String list (multi-line)
- Config section with
.json(tellraw) and.msg(fallback) sub-keys
- Plain string (
Main.mes(node, type)uses bitmask:1=no prefix,2=check empty,4=disable JSON
Core.INSTANCEis bothListenerandPluginMessageListenerCLEAR_LISTENERcallbacks fire onPlayerQuitEvent— register cleanup logic there
- Both proxy modules are parallel implementations with nearly identical logic
- Velocity has one extra class:
CmdProxy.java(registers backend commands as proxy commands) - Both use
ConfigManager.javawithConfFile/PlayerConfFileenums for YAML persistence
- Send
TpLoc.s1S_tpLocto target server to prepare spawn location - If different server: call proxy API to switch player connection (
connect()) - Callback returns success/failure to originating server
- WARPs:
warp.ymlin proxy data folder - HOMEs: Per-player
home.ymlunder{uuid}/subdirectories, lazily loaded viaHomesLRU - Server groups:
proxy-config.ymlserver-groupcontrols which servers can teleport to each other - Always delay-save:
WaitMaintainbatches writes; do not call synchronous save in hot paths
| Module | External Dep | Scope |
|---|---|---|
| common | lombok |
provided |
| bukkit | bukkit 1.15.1, bstats-bukkit |
provided / compile |
| bungeecord | bungeecord-api 1.16-R0.5, bstats-bungeecord |
provided / compile |
| velocity | velocity-api 3.3.0-SNAPSHOT, bungeecord-config, bstats-velocity |
provided / compile |
- Parent POM defines
yl-yuanlu-maven.pkg.coding.netrepository for internal artifacts (removed — no longer needed)settings.xmlreferences CODING Maven registry credentials (env vars)
Triggered automatically when a release is published on GitHub:
- GitHub Actions runs
mvn -B package --file pom.xml - All 5 JAR artifacts are uploaded to the release page
Workflow file: .github/workflows/Upload Release Asset.yml
Required permissions: The workflow uses gh release upload which requires contents: write permission.
To create a new release:
- Update version in root
pom.xml(e.g.,1.2.2→1.2.3) - Commit and push to
devbranch - Create a new release on GitHub (tag should match version)
- Actions will automatically build and attach JARs
- No unit tests exist in this repo
- Plugin is integration-tested only by running on actual Minecraft servers
- When modifying protocol (
Channel.java), verify both proxy implementations parse correctly - Bukkit version compatibility spans many MC versions; avoid Bukkit APIs newer than 1.15.1 in common code
- Any change to
Channelenum order or names breaks protocol compatibility — increment version or keep stable - Common module must remain zero Minecraft platform dependency — no Bukkit/Velocity/Bungee imports
- Both proxy modules need parallel changes for feature parity
- Shade aggregator modules (
bukkit-bungeecord,bukkit-velocity) should never get source code