Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
SunThroughGrates
Sunlight passes through iron cage floors and grates, so crops grow under an iron ceiling. Solid roofs still block the sun.
| Last updated | 2 weeks ago |
| Total downloads | 163 |
| Total rating | 1 |
| Categories | Building Mods Tweaks Deep North Update Server-side Client-side |
| Dependency string | redwyvern-SunThroughGrates-1.0.0 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2351README
SunThroughGrates
Let sunlight through iron cage floors and grates, so you can farm under an iron ceiling.
In vanilla Valheim, crops won't grow under anything you've built ("No sun"), even see-through iron cage floors. With this mod, iron cage floors, walls and grates let the sun through. Wood, stone and every other roof still block it as usual.
Installation
Install with r2modman or
another Thunderstore mod manager, or copy SunThroughGrates.dll into
BepInEx/plugins/.
Install it on every client, and on the dedicated server if you use one. Plant growth is calculated by whoever owns the plant, which is usually the nearest player rather than the server. A player without the mod sees "No sun" under the grate.
Configuration
BepInEx/config/nickweedon.SunThroughGrates.cfg:
| Section | Key | Default | Description |
|---|---|---|---|
| General | Ignored prefabs | iron_floor_1x1,iron_floor_2x2,iron_grate,iron_wall_1x1,iron_wall_2x2 |
Comma-separated prefab names that let sunlight through |
You can add other building pieces by prefab name. Changes apply live, for example from the in-game Configuration Manager. The config isn't synced between server and clients, so keep the list the same for everyone.
How it works
Vanilla Plant.HaveRoof() casts one ray 100 m straight up against the
Default, static_solid and piece layers. Any hit counts as a roof. This
mod replaces that check with a Harmony prefix that casts the same ray but
skips colliders that belong to an ignored prefab. With an empty list, it
behaves exactly like vanilla.
The idea of replacing HaveRoof with a custom raycast comes from kaaremai's
Better plant sky.
This is an independent implementation. The two mods patch the same method,
so don't install both.
Compatibility
- Built against Valheim 1.0.17 and BepInExPack 5.4.2351.
- Conflicts with any other mod that replaces
Plant.HaveRoof, such as Better plant sky.
Building from source
Requires the .NET 8 SDK. VALHEIM_INSTALL must point at a folder laid out like
a Valheim install, containing BepInEx/core/ and valheim_Data/Managed/:
VALHEIM_INSTALL=/path/to/Valheim \
dotnet build SunThroughGrates/SunThroughGrates.csproj -c Release
Output: SunThroughGrates/bin/Release/SunThroughGrates.dll. To build the
Thunderstore package, see CONTRIBUTING.md.
Links
- Source and issues: https://github.com/redwyvern/SunThroughGrates
- Contributing: CONTRIBUTING.md
- Changelog: CHANGELOG.md
- License: MIT