📡 네트워크 동기화 및 페이로드 (Minecraft 26.2)
📌 저장소 소스 면책 조항: 본 위키의 문서는 CurseForge 및 Modrinth의 공개 릴리스 빌드보다 앞선 최신 미출시 커밋이나 개발 기능을 포함할 수 있는 저장소의 현재 소스 코드 상태를 반영합니다.
1. Official Infobox
| Parameter | Technical Details |
|---|---|
| Subsystem Name | Network Synchronization Protocol |
| Payload Class | PotionLimitSyncPayload.java |
| Payload Identifier | potion-stacker:sync_limit |
| Protocol Phase | Play (clientbound S2C) |
| Codec Implementation | StreamCodec<RegistryFriendlyByteBuf, PotionLimitSyncPayload> |
| Client Receiver | PotionStackerFabricClient.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 fromPotionStackerManagerand sends aPotionLimitSyncPayloadto the connecting client.Client-Side State Storage: Upon packet receipt on the client,
PotionStackerFabricClientqueues a task on the Minecraft client render thread (context.client().execute(...)) to updatePotionStackerManager.setClientLimit(potionLimit, stewLimit).In-Game Administrator Mutation: An administrator executes
/gamerule potion-stacker-addon:potion_limit 32.DynamicGameRuleManagerdetects the value change and invokesPotionStackerManager.setLimits(...).Full Multi-Client Broadcast & Menu Refresh: The server loops through all online players (
server.getPlayerList().getPlayers()), dispatchesPotionLimitSyncPayload, and invokesbroadcastFullState()on every player's open container and inventory menus.
3. Mathematical Formulas & Network Bandwidth
$$B = \text{VarIntBytes}(P_{\text{limit}}) + \text{VarIntBytes}(S_{\text{limit}})$$
For default settings ($P = 16, S = 16$): $$B = 1 + 1 = 2\text{ bytes}$$
Even at the maximum safe limit ($39{,}768{,}215$): $$B = 4 + 4 = 8\text{ bytes}$$
4. Visual ASCII Diagrams & Packet Lifecycle
[ Client ] [ Dedicated Server ]
| |
|----------------- C2S Login / Handshake -------------------->|
| |
| ServerPlayConnectionEvents.JOIN
| |
| Query PotionStackerManager
| pLimit=16, sLimit=16
| |
|<--- S2C PotionLimitSyncPayload(16, 16) ---------------------|
|
Receive Packet
context.client().execute()
PotionStackerManager.setClientLimit(16, 16)
|
Client GUI & Tooltips Synchronized