CartographyTableMapRestrict
Hides the minimap and the map keybind. The world map can only be opened by using a cartography table. Rebuilt for Valheim 1.0.x.
模組介紹 作者原文
Cartography Table Map Restrict — updated for Valheim 1.0.x
Hides the minimap and the map keybind. The world map can only be opened by using
a cartography table. Rebuilt from
aedenthorn/ValheimMods
against Valheim 1.0.15 and BepInEx 5.4.23.
Why the original stopped working
Two things in the original broke on current Valheim:
- Minimap.instance became a property. It used to be a public static field. A DLL compiled
against the old game still looks for a field, so the plugin threw MissingFieldException
the moment a cartography table was used.
- The map toggle was rewritten. Minimap.Update now re-opens the small map on its own
(if (m_mode == MapMode.None) SetMapMode(MapMode.Small);) and gates the toggle behind
m_shownFrames / m_hiddenFrames counters that did not exist before. The original mod fought
this every frame by forcing MapMode.None and calling SetActive(false) in an Update postfix.
What changed in this version
The mod no longer patches Minimap.Update at all. m_smallRoot is touched by exactly two methods
in the game (Minimap.Awake and Minimap.SetMapMode), so a single SetMapMode patch covers
everything, with no per-frame work:
| Patch | Purpose |
|---|---|
| Minimap.SetMapMode prefix | Rewrites any switch to MapMode.Large into MapMode.Small, unless the cartography table asked for it. This is what blocks the map keybind. |
| Minimap.SetMapMode postfix | Keeps m_smallRoot deactivated, hiding the minimap. |
| MapTable.OnRead(Switch, Humanoid, ItemData) postfix | Opens the large map. This is the 3-argument overload wired to the table's read switch — the original patched the 4-argument one, which OnWrite also calls, so saving to the table opened the map too. |
| MapTable.OnRead(..., bool showMessage) prefix | Suppresses the "map synced" message. |
| Minimap.ShowPointOnMap prefix | Stops Minimap.DiscoverLocation from throwing the map open when you find a boss stone. |
Closing still works normally: with the large map open, the map key and Escape both route through
SetMapMode(MapMode.Small), which the prefix leaves alone.
Dedicated server / multiplayer
The mod is client-side only. It is marked [BepInProcess("valheim.exe")], so it will not load
into valheim_server.exe even if the DLL ends up in the server's plugin folder.
- It patches nothing but local UI. It registers no RPCs and touches no ZDO, so it does not
change the network protocol and will not cause a version mismatch or a kick.
- It does not need to be installed on the dedicated server.
- Every player who should have the restriction must install it themselves — a client-side mod
cannot enforce this on anyone else. See BypassServerNoMap below for the enforceable route.
- Map exploration is still recorded while the minimap is hidden (Minimap.UpdateExplore runs
regardless of map mode), and sharing map data through the table is untouched.
Enforcing it for everyone
Valheim's own No Map world modifier is server-enforced, but on its own it also kills the
cartography table: Minimap.SetMapMode clamps every mode to None while Game.m_noMap is set.
With BypassServerNoMap = true (the default) this mod lifts that clamp for the duration of the
table's call, so you can run the server with the nomap modifier and still read the table:
- players without the mod get vanilla no-map — enforced by the server;
- players with the mod additionally get a working cartography table.
Game.UpdateNoMap only runs on spawn and when world modifiers change, so nothing re-closes the map
behind you.
If you are not using the server modifier, leave the modifier off and just have everyone install
the mod — that is the simpler setup.
Config
BepInEx/config/aedenthorn.CartographyTableMapRestrict.cfg
| Key | Default | Meaning |
|---|---|---|
| Enabled | true | Master switch. Can be toggled at runtime. |
| HideMinimap | true | Hide the corner minimap. |
| SuppressMessage | true | Hide the "map synced" message when reading the table. |
| PreventAutoOpen | true | Stop the map force-opening on locat
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。