FiresClippy
Forces m_clipGround + m_clipEverything ON for hammer-selected pieces AND suppresses RandomPieceRotation during player placement, so modded vegetation/decor hover-snaps cleanly and respects your aim. D
模組介紹 作者原文
FiresClippy
Tiny mod that fixes two annoyances when placing modded vegetation / decorative props with the hammer:
- Clip flags — every hammer-selected piece's placement-ghost m_clipGround and m_clipEverything are forced to true. The ghost snaps cleanly to terrain / surfaces instead of bouncing around or refusing to place.
- Random rotation — RandomPieceRotation.Awake() (the vanilla component that randomizes rotation on world-position seed) is suppressed during player placement, so the rotation you aim with the hammer actually sticks. Naturally-spawned vegetation in the world still rotates normally — only the placement path is gated.
If you've ever hammer-selected a modded plant / decoration / shrub and watched it either refuse to hover-place or land at the wrong rotation — Clippy fixes both, for every prefab, with zero per-prefab config and no list maintenance.
Need help, found a bug, want a feature?
What this mod does
| Feature | What you get |
|---------|--------------|
| Auto-clip on selection | Whenever your hammer has a piece selected (vanilla menu or any selection mod like InfinityHammer / Gizmo Reloaded / MoreVanillaBuildPrefabs), Clippy flips m_clipGround = true and m_clipEverything = true on the placement ghost every frame. The ghost then takes the direct-snap-to-raycast-hit code path vanilla pieces with the flag already set use. |
| RandomPieceRotation suppress | Some modded prefabs (a lot of Balrond's nature assets, for example) carry vanilla's RandomPieceRotation MonoBehaviour. When the player places the piece, that component's Awake() overrides the rotation you aimed with the hammer. Clippy gates the component's Awake with a static suppress counter that's bumped around Player.SetupPlacementGhost and Player.PlacePiece, so player-placed instances keep your rotation. Naturally-spawned world vegetation is unaffected — only the placement path is gated. |
| Runtime toggle | Default keybind F8 flips both features on/off together. State persists across sessions. A center-screen Hud message tells you which mode you're in (silenceable in config). The two features have separate config bools so you can run one without the other by editing the cfg directly. |
| No prefab pollution | Clippy only touches the placement ghost's Piece component, never the source prefab. Toggle off and the next selection returns to vanilla behavior; the original flag values are restored live without needing to re-select. Once a piece is actually placed in the world the flags don't matter anyway — they only affect the hover preview. |
| Works with everything | Vanilla hammer, InfinityHammer, MVBP, Gizmo, any mod that goes through Player.UpdatePlacementGhost / Player.PlacePiece. No mod-specific hooks. |
Why it works
Vanilla's Player.UpdatePlacementGhost branches on the selected piece's m_clipGround and m_clipEverything bools:
- Either flag true → ghost snaps to the raycast hit point. Used by every terrain modifier and grounded vanilla piece. Works for any prefab regardless of collider shape.
- Both flags false → ghost floats 50 m away from the surface then uses Collider.ClosestPoint to slide back to the hover position. Works well for closed-mesh building pieces. Fails on anything with sparse / no colliders — which is most modded vegetation and decorative props.
Clippy runs a Harmony prefix on UpdatePlacementGhost that toggles those bools on the ghost (not the source prefab) before vanilla reads them. Cost is two bool writes per frame in build mode. Out of build mode, zero cost.
Installation
- Install BepInEx — the BepInExPack_Valheim is the standard one.
- Drop Clippy.dll into BepInEx/plugins.
- Start the game once. It will create BepInEx/config/com.Fire.Clippy.cfg with the three settings below.
Client-side mod. Server doesn't need it. Other players don't need it.
Config
| Key | Default | What it does |
|-----|---------|--------------|
| AutoClipEnabled | true | Force m_clipGround / m_clipE
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: