📡 Sincronização de Rede e Payloads (Minecraft 26.2)
📌 Isenção de responsabilidade da fonte do repositório: A documentação nesta Wiki reflete o estado atual do código-fonte no repositório, que pode incluir commits recentes não lançados ou recursos em desenvolvimento à frente dos lançamentos públicos no CurseForge e Modrinth.
1. Official Infobox
| Parameter | Technical Details |
|---|---|
| Subsystem Name | Network Synchronization Protocol |
| Payload Class | StewLimitSyncPayload.java |
| Payload Identifier | stew-stacker:sync_limit |
| Protocol Phase | Play (clientbound S2C) |
| Codec Implementation | StreamCodec<RegistryFriendlyByteBuf, StewLimitSyncPayload> |
| Client Receiver | StewStackerFabricClient.java |
| Server Dispatch Events | ServerPlayConnectionEvents.JOIN, DynamicGameRuleManager listener |
| Menu Synchronization | broadcastFullState() on containerMenu and inventoryMenu |
2. Step-by-Step Player Workflow & Synchronization Lifecycle
Initial Player Connection (Handshake): When a player connects to the dedicated server,
ServerPlayConnectionEvents.JOINtriggers. The server queries current active limits fromStewStackerManagerand sends aStewLimitSyncPayloadto the connecting client.Client-Side State Storage: Upon packet receipt on the client,
StewStackerFabricClientqueues a task on the Minecraft client render thread (context.client().execute(...)) to updateStewStackerManager.setClientLimit(stewLimit).In-Game Administrator Mutation: An administrator executes
/gamerule stew-stacker-addon:stew_limit 32.DynamicGameRuleManagerdetects the change and invokesStewStackerManager.setLimit(...).Full Multi-Client Broadcast & Menu Refresh: The server loops through all online players (
server.getPlayerList().getPlayers()), dispatchesStewLimitSyncPayload, and invokesbroadcastFullState()on container and inventory menus.
3. Mathematical Formulas & Network Bandwidth
$$B = \text{VarIntBytes}(S_{\text{limit}})$$
For default settings ($S = 16$): $$B = 1\text{ byte}$$
Even at the maximum safe limit ($39{,}768{,}215$): $$B = 4\text{ bytes}$$
4. Visual ASCII Diagrams & Packet Lifecycle
[ Client ] [ Dedicated Server ]
| |
|----------------- C2S Login / Handshake -------------------->|
| |
| ServerPlayConnectionEvents.JOIN
| |
| Query StewStackerManager
| sLimit=16
| |
|<--- S2C StewLimitSyncPayload(16) ---------------------------|
|
Receive Packet
context.client().execute()
StewStackerManager.setClientLimit(16)
|
Client GUI & Tooltips Synchronized