Common Proxy
基本信息
net.glease.tc4tweak.CommonProxy —— 服务端侧代理,由
TC4Tweak 的 @Mod.EventHandler 全部委托给它。
网络消息注册(preInit)
3 条消息,全部发往 Side.CLIENT,discriminator 连续编号:
| 类 | disc | 方向 |
|---|---|---|
MessageSendConfiguration |
0 | → CLIENT |
MessageSendConfigurationV2 |
1 | → CLIENT |
TileHoleSyncPacket |
2 | → CLIENT |
客户端往服务端没有注册消息 —— 三条都是单向的(服务端 → 客户端)。
init 里的方块 dispenser 覆写
在 init 中匿名实现 IBlockHandler(dispenseStack(IBlockSource, ItemStack)),
替换某个方块的投掷行为 —— 与 Client Proxy 的反射式覆写不同,
这里是直接接口实现。
方法
| 方法 | 行 | 说明 |
|---|---|---|
| 构造器 | 32 | — |
preInit(FMLPreInitializationEvent) |
36 | 注册 3 条网络消息 |
serverStarted(FMLServerStartedEvent) |
49 | — |
init(FMLInitializationEvent) |
54 | 含 dispenser 覆写 |
postInit(FMLPostInitializationEvent) |
84 | — |
onPlayerLogin(PlayerEvent.PlayerLoggedInEvent) |
98 | 玩家登录 |
相关条目
源码
src/main/java/net/glease/tc4tweak/CommonProxy.java