Quick-LAN
一款用于 Minecraft 的 Fabric 客户端模组,可在离线模式下加载单人世界时自动将其开放为局域网游戏——无需每次暂停并点击“对局域网开放”。
功能
-
自动开放局域网 — 世界加载完成后,模组会自动在 25565 端口将其发布到局域网。
-
全员离线模式身份 — 所有登录的玩家(包括房主)都会被分配一个基于其用户名生成的确定性离线 UUID(与原版针对盗版/离线账户使用的方案相同),因此局域网玩家加入时无需经过 Mojang 认证。不过,正版账号仍然可以加入。
-
跨主机一致的玩家数据 — 如果多人轮流担任同一世界的房主(例如在一台机器上使用共享/符号链接的世界文件夹,或在多台机器之间复制),无论当前谁拥有该世界,每位玩家的物品栏、位置和统计数据都会始终绑定在其各自的用户名上。这解决了 Minecraft 26.1+ 版本中的一个行为:否则,游戏会将当前房主的数据重定向到最后一次作为房主的那个 UUID 所对应的数据。
-
游戏模式跟随房主 — 新加入的玩家将始终以房主当前的游戏模式开始游戏。
要求
|
|
| Minecraft |
26.1.2 |
| Fabric Loader |
0.19.3 |
| Fabric API |
0.154.0+26.1.2 |
工作原理
Quick-LAN 完全通过 Mixin 实现,目标为游戏的客户端/集成服务器端:
-
ExampleClientMixin — 注入到 IntegratedServer#tickServer,等待客户端连接和玩家完全就绪后,禁用服务器身份验证,并使用房主当前的游戏模式调用 publishServer(...)。
-
ServerLoginPacketListenerImplMixin — 拦截登录期间的配置文件分配(startClientVerification),并将所有连接玩家的配置文件重写为基于离线的配置文件,无论他们是否进行了在线认证。
-
IntegratedServerMixin — 禁用了游戏内置的“单人所有者”身份快捷方式(isSingleplayerOwner),否则会导致当前房主继承并最终覆盖之前会话中保存为世界所有者的玩家数据。禁用此功能后,每位玩家的数据都严格根据其自身名称生成的 UUID 查找,无论是否为房主。
已知限制
-
由于完全禁用了“单人所有者”身份快捷方式,与其相关的便利功能也被禁用——例如,房主不再受到 /kick 命令的自动保护,也不会自动获得提升的权限。如果你的群组使用命令且需要房主拥有管理员权限,请显式授予(例如通过 ops.json)。
-
本模组旨在用于非正式的、受信任的局域网游戏(例如由小型群体轮流担任房主的共享世界文件夹)。它不会增加任何额外的安全性——只要世界被发布,本地网络上的任何人都可以加入。
Quick-LAN
A Fabric client-side mod for Minecraft that automatically opens singleplayer worlds to LAN in offline mode as soon as you load in — no need to open the pause menu and click "Open to LAN" every time.
Features
-
Auto-opens to LAN — as soon as your world finishes loading, the mod publishes it to LAN on port 25565 automatically.
-
Offline-mode identity for everyone — every player who logs in (host included) is assigned a deterministic offline UUID derived from their username (the same scheme vanilla uses for cracked/offline accounts), so no Mojang authentication is required for LAN players to join. Premium accounts can still join though.
-
Consistent player data across hosts — if multiple people take turns hosting the same world (e.g. a shared/symlinked world folder on one machine, or copied between machines), each player's inventory, position, and stats stay tied to their own username no matter who currently has the world open. This works around a Minecraft 26.1+ behavior where the game would otherwise redirect the current host's data to whichever UUID last hosted the world.
-
Gamemode matches the host — new players who join always start in whatever gamemode the host is currently in.
Requirements
|
|
| Minecraft |
26.1.2 |
| Fabric Loader |
0.19.3 |
| Fabric API |
0.154.0+26.1.2 |
How it works
Quick-LAN is implemented entirely through Mixins targeting the client/integrated-server side of the game:
ExampleClientMixin — injects into IntegratedServer#tickServer, waiting until the client connection and player are fully ready, then disables server authentication and calls publishServer(...) using the host's current gamemode.
ServerLoginPacketListenerImplMixin — intercepts profile assignment during login (startClientVerification) and rewrites it to an offline-derived profile for every connecting player, regardless of whether they authenticated online or not.
IntegratedServerMixin — disables the game's built-in "singleplayer owner" identity shortcut (isSingleplayerOwner), which otherwise causes the currently-hosting player to inherit — and eventually overwrite — whichever player's data was saved as the world's owner in a previous session. With this disabled, every player's data is looked up strictly by their own name-derived UUID, host or not.
Known limitations
- Since the "singleplayer owner" identity shortcut is fully disabled, convenience behaviors tied to it are also disabled — for example, the host is no longer automatically protected from
/kick or automatically granted elevated permissions. If your group uses commands and needs the host to have operator permissions, grant them explicitly (e.g. via ops.json).
- This mod is intended for informal, trusted LAN play (e.g. a shared world folder used by a small group taking turns hosting). It does not add any additional security — anyone on your local network can join while the world is published.
评论 0
登录后参与评分
还没有评论,来抢沙发吧