Skip to content

Add transfer packet backport (1.20.5 for 1.7.10)#299

Merged
Lyfts merged 1 commit into
masterfrom
transfer-packet
May 23, 2026
Merged

Add transfer packet backport (1.20.5 for 1.7.10)#299
Lyfts merged 1 commit into
masterfrom
transfer-packet

Conversation

@alppp
Copy link
Copy Markdown
Contributor

@alppp alppp commented May 20, 2026

backports 1.20.5 ClientboundTransferPacket to 1.7.10, allowing servers to seamlessly redirect players to another server:port without requiring BungeeCord/Velocity or other proxies. Migrated from Hodgepodge PR GTNewHorizons/Hodgepodge#833 per review feedback that a public API feature belongs in ServerUtilities.

  • server sends host+port via ServerUtilities NetworkWrapper on the serverutilities channel
  • client disconnects cleanly and reconnects to the target server
  • /transfer [port] command (op level 3)
  • TransferHelper.transfer() public API for programmatic use
  • config: enableTransferPacket toggle, transferWhitelist for allowed hosts
  • compatible with BungeeCord/Velocity/Bukkit proxies

wire format on the serverutilities channel:

Field Value
Channel serverutilities
Direction Server to Client
Discriminator 0x0D

Wire Format

Uses ServerUtilities DataOut/DataIn serialization:

Field Type Description
host String (DataOut.writeString) Hostname or IP address (UTF-8, length-prefixed)
port int (DataOut.writeInt) Port number 1-65535

the client disconnect uses a deferred GuiTransferring screen to avoid a packet processing race in modded runTick -- updateController() can still dispatch stale packets after loadWorld(null) nulls the world, so the actual GuiConnecting is created in updateScreen() which runs after updateController in the tick cycle.

technically they could be done without this however it would be a hacky workaround for velocity, and would be a hit or miss. (higher chance of crash in dense populated gregtech machines area, and this just removes that chance)

An example can be seen here:

2026-04-14.20-43-53_compressed.mp4

@Lyfts Lyfts merged commit 3f6c58d into master May 23, 2026
1 check passed
@Lyfts Lyfts deleted the transfer-packet branch May 23, 2026 17:35
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.

2 participants