Proxy
基本信息
@SidedProxy 的两端实现。
@SidedProxy(clientSide = "pl.asie.foamfix.ProxyClient",
serverSide = "pl.asie.foamfix.ProxyCommon",
modId = "foamfix")
public static ProxyCommon proxy;
字段类型是 ProxyCommon(基类),客户端时被替换为 ProxyClient。
ProxyCommon
| 方法 | 行 | 说明 |
|---|---|---|
openUrlLinux(URI url) |
11 | 基础实现(服务端侧为无操作) |
static File createFileSafe(String parent, String filename) |
15 | |
static File createFileSafe(File parent, String filename) |
30 |
ProxyClient
| 方法 | 行 | 说明 |
|---|---|---|
openUrlLinux(URI url) |
7 | 覆写,提供 Linux 桌面环境下的 URL 打开实现 |
extends ProxyCommon —— 客户端类继承服务端基类,只覆写差异部分。
与补丁的关系
openUrlLinux 的运行时修复由字节码补丁
LinuxGuiChatBrowsePatch
(目标 net/minecraft/client/gui/GuiChat)完成,
代理类是替代实现路径,二者是不同的注入点。
相关条目
源码
src/main/java/pl/asie/foamfix/ProxyCommon.javasrc/main/java/pl/asie/foamfix/ProxyClient.java