RecycleCore
Preview item recycling, preserve partial batches, protect selected items and confirm deletion. English/Russian. Based on RecyclePlus.RecycleCore
Item recycling for Valheim with a resource preview, explicit deletion and item protection.
By Ketanol. Built for Valheim 1.0.7 and BepInExPack Valheim 5.4.2350.
Local inventory operations and the Russian/English interface are covered by an isolated runtime test. Multiplayer and inventory overhaul compatibility still require separate testing.
Features
- Pick up an item with the inventory cursor and press Delete to preview recycling.
- A RecycleCore button opens the same preview.
- Choose the quantity and see each returned material before confirming.
- Upgrade costs are included. Returns are rounded down after aggregation.
- Complete crafting batches are consumed; any remainder stays in the inventory.
- No room for all returned materials means the operation is cancelled.
- Ctrl + Delete toggles protection on the held item. Protection can also be changed in the preview.
- Equipped and quest items are protected; optional hotbar and prefab exclusions are configurable.
- Permanent deletion has its own explicit confirmation and returns no resources.
- Russian and English interface; automatic selection follows the game language.
- ServerSync synchronizes resource percentage, exclusions and deletion policy when the mod is installed on the server.
Installation
- Install BepInExPack Valheim 5.4.2350 or later.
- Disable RecyclePlus before enabling RecycleCore. RecycleCore declares the original mod incompatible to prevent overlapping actions.
- Put
RecycleCore.dllinBepInEx/plugins/RecycleCore/. - Launch once to create
BepInEx/config/Ketanol.RecycleCore.cfg.
No separate ServerSync DLL is required: its source is compiled into this plugin.
Behaviour and boundaries
- Operations work only on the local player's inventory. Move items out of containers first.
- Recipes with alternative ingredients are not automatically refunded: the original ingredient cannot reliably be inferred.
- If a crafting recipe does not exist or its return is zero, recycling is disabled. Deletion remains a separate choice if server policy permits it.
- The inventory is staged using Valheim's own stacking methods, then committed in one change while preserving existing ItemData identities.
- The commit updates the inventory list and invokes its change notification once. Mods which rely specifically on intercepting
Inventory.AddItem/RemoveItemon the live player inventory require compatibility testing. - Client-side recycling is not a server anti-cheat system. ServerSync synchronizes policy; it does not move item ownership to the server.
- Item protection is saved in item custom data. Compatibility with other mods that overwrite custom data or merge stacks needs verification.
- Keyboard and mouse are the initial input target; controller navigation has not been implemented.
Build
Requires .NET SDK 9 or later and a local Valheim installation plus BepInEx.
.\build.ps1 -GamePath 'E:\SteamLibrary\steamapps\common\Valheim' -BepInExPath 'PATH_TO_PROFILE\BepInEx'
The build script runs accounting checks, compiles against the installed game's actual DLLs and creates dist/RecycleCore-1.0.1.zip. It does not install or publish the mod.
Individual commands:
dotnet run --project tests/RecycleMath.Tests.csproj -c Release
dotnet build RecycleCore.csproj -c Release -p:GamePath=PATH_TO_VALHEIM -p:BepInExPath=PATH_TO_BEPINEX
Game DLLs and BepInEx binaries are intentionally not included in the source archive. See VALIDATION.md and tests/results/ for the recorded validation scope; tests/runtime/ contains the optional isolated in-game test runner.
Credits
Based on RecyclePlus by TastyChickenLegs, published under the Unlicense: https://github.com/TastyChickenLegs/RecyclePlus
RecyclePlus also credits aedenthorn for the original recycling code/idea and VirutaCode for its trashcan asset. RecycleCore uses its own code-built interface and does not bundle the original trashcan images or sounds.
ServerSync by Tykea / blaxxun-boop, MIT-0: https://github.com/blaxxun-boop/ServerSync
See THIRD_PARTY_NOTICES.md and licenses/.


