You are viewing a potentially older version of this package. View all versions.
Aquark-ResinFire-1.1.0 icon

ResinFire

Coal braziers burn resin instead of coal. Brazier and torch fuel refills itself from containers within 30 m. Separate lists for fuel and refill, server-side.

By Aquark
Date uploaded a day ago
Version 1.1.0
Download link Aquark-ResinFire-1.1.0.zip
Downloads 39
Dependency string Aquark-ResinFire-1.1.0

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2351 icon
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.2351

README

ResinFire

Two changes for Valheim's fireplaces: two braziers burn resin instead of coal, and five fire pieces keep themselves fuelled from your storage.

Features

1. Resin braziers

Piece Prefab Before After
Hanging Brazier piece_brazierceiling01 Coal Resin
Standing Brazier piece_brazierfloor01 Coal Resin
  • Works on braziers that are already built (leave the area and come back, or restart) and on new ones.
  • Coal is no longer accepted by these two pieces — resin becomes their only fuel.
  • One resin still equals one fuel unit, so burn time is unchanged; you just farm resin instead of coal.
  • The fuel item is configurable: set FuelItem = Coal to go back to vanilla.

2. Self-refilling fires

These five pieces pull fuel out of any container within 30 meters and top themselves up:

Piece Prefab What it pulls
Hanging Brazier piece_brazierceiling01 Resin
Standing Brazier piece_brazierfloor01 Resin
Sconce (wall torch) piece_sconce whatever it burns
Standing iron torch piece_groundtorch whatever it burns
Standing wood torch piece_groundtorchwood whatever it burns
  • Each piece pulls its own fuel item, so the braziers take resin while torches keep taking wood — torches do not need their fuel changed.
  • Refill tops the piece up to its maximum in one go, then waits until it burns some down again.
  • Fires the player switched off are left alone; only burning ones are refuelled.
  • Containers a player currently has open are skipped for that pass (they are owned by the client) and picked up on a later check.
  • Chests, carts and any other Container count; it is a 3D distance, so a chest one floor up still works.

3. Everything is configurable

BepInEx/config/snowfarm.valheim.resinfire.cfg

Section Key Default Meaning
1 - General Enabled true Master switch
2 - Fuel FuelItem Resin Item the FuelPrefabs burn (Coal = vanilla)
2 - Fuel FuelPrefabs piece_brazierceiling01,piece_brazierfloor01 Pieces whose fuel type is replaced
3 - Auto refill RefillPrefabs piece_brazierceiling01,piece_brazierfloor01,piece_sconce,piece_groundtorch,piece_groundtorchwood Pieces that refill themselves
3 - Auto refill Radius 30 Container search radius, meters
3 - Auto refill Interval 5 Seconds between refill checks

The two lists are independent: you can run only the fuel change, only the auto refill, or both, on any mix of pieces.

Other prefab ids you may want:

Piece Prefab
Blue Standing Brazier piece_brazierfloor02
Standing torch, blue / green piece_groundtorchblue / piece_groundtorchgreen
Iron Fire Pit (burns wood) piece_firepit_iron

Install

  • Install BepInExPack Valheim (r2modman handles it).
  • Drop ResinFire.dll into BepInEx/plugins/.
  • Install on the server and on the clients. The refill loop runs on the server; clients need the same data so fuel icons and hover text match.

Performance

There is no Update() and no per-frame patch. A coroutine runs once every Interval seconds on the server: it compares each covered fire against loaded containers by squared distance, and only scans inventory slots for containers inside the radius. With dozens of fires and hundreds of containers this is well under a millisecond per pass.

Compatibility and safety

  • Only the pieces in the two lists are touched. Campfires, hearths, fire pits, bonfires, lanterns and every modded piece are unaffected.
  • Purely runtime: nothing is written to the world file, so uninstalling restores vanilla behaviour (braziers accept coal again, refilling stops).
  • The Iron Fire Pit burns wood and its prefab id does not resolve through ZNetScene.GetPrefab in 1.0, so it is not a default target.
  • Works alongside build/placement mods; no dependencies besides BepInEx.

中文说明

功能一:两个火盆改烧树脂。 吊盆火炉(piece_brazierceiling01)和火盆(piece_brazierfloor01) 原本烧煤,现在改烧树脂,煤加不进去了。已经摆好的火盆重进区域后自动生效,不用拆。燃烧时长不变 (1 树脂 = 1 燃料单位)。

功能二:五个建筑自动补燃料。 上面两个火盆,加上壁挂火把(piece_sconce)、立式铁火炬 (piece_groundtorch)、立式木火炬(piece_groundtorchwood),每 5 秒从 30 米内的箱子/储物建筑里 取燃料补满,不用再手动加。

  • 每个建筑取自己烧的那种燃料:火盆取树脂,木火炬取木头。
  • 玩家手动关掉的火盆不会被补(尊重开关)。
  • 正被玩家打开的箱子那一轮跳过,下一轮再取。
  • 只影响列表里的建筑,营火/壁炉/火坑/篝火/灯笼都不动。
  • 纯运行时改动,卸载后立即恢复原版行为,不污染存档。

配置里可以改燃料种类、两个列表、搜索半径和检查间隔;铁火盆(烧木头、prefab id 在 1.0 里查不到) 默认不处理,蓝色立式火盆 piece_brazierfloor02 想加也可以自己填进列表。

Build

dotnet build -c Release -p:ValheimDir="C:\Program Files (x86)\Steam\steamapps\common\Valheim"

or run pack.ps1 to build and produce ResinFire.zip for Thunderstore.

CHANGELOG

Changelog

1.2.1

  • Fixed auto refill doing nothing when a player had opened the resin chest: opening a container moves ZDO ownership to that player, so the server-side loop could not use it. The server now claims ownership of the container (unless somebody has it open) and of the fireplace itself before refilling.
  • Added a Verbose diagnostic option that logs a per-cycle summary and the reason each fire was skipped (no containers in range, no Resin in range, switched off, fire not owned, ...).
  • Logs once when the plugin is loaded on a non-server peer, because refill only runs on the server.

1.2.0

  • Added the coloured light sources to the fuel change: Blue Standing Brazier (piece_brazierfloor02), Standing Blue-burning Iron Torch (piece_groundtorch_blue) and Standing Green-burning Iron Torch (piece_groundtorch_green) now burn resin instead of Greydwarf Eyes / Guck.
  • The same three pieces are also auto-refilled now, so the refill list covers eight pieces.
  • Startup log now prints what each piece burned before it was changed.
  • Configs upgrading from 1.1.0 get the new default prefab lists once, unless they were edited by hand.

1.1.0

  • Fuel replacement and auto refill are now two separate prefab lists.
  • Default fuel list is only the two coal braziers: Hanging Brazier and Standing Brazier. The Iron Fire Pit is no longer touched (it burns wood and its prefab id did not resolve).
  • Auto refill now also covers the Sconce (wall torch) and the standing torches.
  • Refill pulls whatever item each piece actually burns, instead of always looking for resin.
  • Fuel item is also applied per instance on Awake, so pieces spawned before the prefab patch and prefabs with the component on a child object are covered too.

1.0.0

  • Initial release.
  • Hanging Brazier, Standing Brazier and Iron Fire Pit burn resin instead of coal.
  • Automatic refill from containers within 30 m (configurable radius / interval / prefabs).