CommonProxy
基本信息
| 属性 | 值 |
|---|---|
| 路径 | baubles.common.CommonProxy |
| 类型 | class |
| 接口 | IGuiHandler |
| 包名 | baubles.common |
字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyHandler |
KeyHandler |
客户端实际赋值,服务端为 null |
方法
| 方法 | 行为 |
|---|---|
registerHandlers |
空实现;预留钩子 |
getClientGuiElement(ID, player, world, x, y, z) |
服务端调用时返回 null(client-side 在 ClientProxy 中实现) |
getServerGuiElement(ID, player, world, x, y, z) |
当 ID == Baubles.GUI 时返回 ContainerPlayerExpanded(参数 isServer=!world.isRemote) |
getClientWorld() |
服务端返回 null;客户端在 ClientProxy 中覆写 |
registerKeyBindings() |
空实现;客户端在 ClientProxy 中覆写 |
用途
被 Baubles.@SidedProxy 引用(clientSide = baubles.client.ClientProxy、serverSide = baubles.common.CommonProxy),根据运行环境提供不同的 GUI 与 keybinding 注册实现。