Skip to content

Commit 05c434e

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 5ef4505 + 364db67 commit 05c434e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/en/posts/docs/anvillib/04_network.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public record UpdatePacket(String data) implements ISensitiveBiPacket {
224224

225225
- Each packet class **must** declare static `TYPE` (`CustomPacketPayload.Type`) and `STREAM_CODEC` fields —
226226
`NetworkRegistrar` reads them via reflection;
227-
- `handleOnClient` and `handleOnServer` callbacks are automatically dispatched to the main thread via
227+
- `handleOnClient`, `handleOnServer` and `handleOnBothSide` callbacks are automatically dispatched to the main thread via
228228
`ctx.enqueueWork()` — no manual queuing needed;
229229
- It is recommended to place packets for different `PacketProtocol` values in separate sub-packages (e.g.,
230230
`network.play`, `network.configuration`) each with their own `@Network` annotation;

‎src/posts/docs/anvillib/04_network.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public record UpdatePacket(String data) implements ISensitiveBiPacket {
222222
## 六、注意事项
223223

224224
- 每个网络包类**必须**声明静态的 `TYPE`(`CustomPacketPayload.Type`)和 `STREAM_CODEC` 字段,`NetworkRegistrar` 通过反射读取它们;
225-
- `handleOnClient` 和 `handleOnServer` 的回调默认会通过 `ctx.enqueueWork()` 在主线程执行,无需手动排队;
225+
- `handleOnClient`、 `handleOnServer` 和 `handleOnBothSide` 的回调默认会通过 `ctx.enqueueWork()` 在主线程执行,无需手动排队;
226226
- 建议为不同 `PacketProtocol` 的包分别建立子包(如 `network.play`、`network.configuration`)并各自添加 `@Network` 注解;
227227
- `NetworkRegistrar.register` 仅扫描同一 JAR 内的类,跨模组包不会被扫描。
228228

0 commit comments

Comments
 (0)