Skip to content

remove spectrum#114

Open
HashimTheArab wants to merge 2 commits intomasterfrom
refactor/remove-spectrum
Open

remove spectrum#114
HashimTheArab wants to merge 2 commits intomasterfrom
refactor/remove-spectrum

Conversation

@HashimTheArab
Copy link
Collaborator

@HashimTheArab HashimTheArab commented Feb 26, 2026

Note

Medium Risk
Medium risk: introduces new connection-swapping logic (TryTransfer) with packet ID translation and state resets, which can affect gameplay/network correctness during transfers; also bumps core networking deps (gophertunnel, go-raknet).

Overview
Removes Spectrum support entirely (deletes spectrum.go and example/spectrum, trims README dependencies, drops Spectrum/legacy-version modules) and updates .gitignore accordingly.

Adds fast upstream transfer support: the player now handles server Transfer packets by dialing a new upstream connection (TryTransfer), swapping ServerConn, invalidating ACKs, and clearing client-visible state (chunks/entities/bossbars/player list/objectives/effects/weather) before resyncing basic gamemode/rules/position and chunk radius.

Implements transfer-safe entity ID handling by tracking client vs server runtime/unique IDs (ClientRuntimeId, ClientUniqueId, IDModified) and translating relevant client/server packets during transfers; also adds World.ChunkPositions() and WorldUpdaterComponent.ResetForTransfer() to reset stale world-updater state.

Written by Cursor Bugbot for commit fdce35d. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

int32(math.Floor(float64(gameData.PlayerPosition.Z()))) >> 4,
},
Radius: uint32(chunkRadius * 16),
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NetworkChunkPublisherUpdate position uses chunk coordinates instead of block

High Severity

The NetworkChunkPublisherUpdate.Position field is a protocol.BlockPos and expects block coordinates, but the >> 4 shift converts block coordinates to chunk coordinates. For a player at X=100, Z=200, the position would incorrectly be set to (6, 0, 12) instead of (100, 0, 200). This means after a fast transfer, the chunk publisher center would be far from the player's actual position, preventing chunks from loading around them.

Fix in Cursor Fix in Web

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