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.
PlanBuildDupeFix
Server-side fix for PlanBuild on dedicated servers: a portal or sign plan built by the server no longer stays behind to be built again, so the plan totem cannot stamp out endless portals. Stacked copies are removed on world load.
By Qua8ion
| Date uploaded | a day ago |
| Version | 1.0.0 |
| Download link | Qua8ion-PlanBuildDupeFix-1.0.0.zip |
| Downloads | 14 |
| Dependency string | Qua8ion-PlanBuildDupeFix-1.0.0 |
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.2351MathiasDecrock-PlanBuild
PlanBuild enables you to plan, copy and share your building creations in Valheim with ease. Includes terrain tools and immersion items.
Preferred version: 0.19.1README
PlanBuildDupeFix
A server-side fix for PlanBuild on dedicated servers. Portal and sign plans built by the server are built once and disappear, as they should, instead of being built over and over.
The bug
To build a plan, PlanBuild places the real piece, writes its text (a portal's tag, a sign's text) and only then removes the plan. The materials live in the plan and go away with it.
The game signs that text with the local platform user, and a dedicated server has none, so writing the text fails. The real piece is already standing, but the plan is never removed and still holds its materials. A plan totem builds it again 3 seconds later, and again, and again: an endless stack of portals in one spot. Every copy torn down with a hammer gives back a third of the cost.
It happens whenever the server owns the plan — for example with server-side simulation mods, which hand objects to the server once their owner walks away. On our server one portal plan turned into 107 portals in six and a half minutes. Signs in blueprints have the same problem.
What this mod does
- Text without a platform user. When there is no platform user (a dedicated server), portal tags and sign texts are written without an author instead of failing. PlanBuild then finishes the build and removes the plan. Where a platform user exists (every client), the game's own code runs unchanged.
- Safety net. If building a plan still fails for any other reason, the plan is removed, so the build cannot be repeated. The materials of such a plan are lost, which is better than endless copies.
- Cleanup. When the world loads, portals that have no creator and stand two or more at one spot are removed. These are the copies left by the bug: portals placed by players always have a creator. The plan they came from stays and now builds once. Can be turned off in the config.
Installation
Server only. Players do not need it, and it does not check versions, so clients without it connect as usual.
- Mod manager: install it on the server.
- Manual: put
PlanBuildDupeFix.dllintoBepInEx/pluginson the server.
Config
BepInEx/config/qua8ion.valheim.planbuilddupefix.cfg
[Cleanup] RemoveStackedPortalCopies(defaulttrue) — remove stacked portal copies when the world loads.
Log
- On start:
Portal and sign text is set without a platform user; a plan whose build fails is removed; stacked portal copies are removed on world load. - When a plan is built by the server:
Set portal text without a platform user (N so far)(the first 20, then every hundredth). - Cleanup:
Removed N portal copies without a creator stacked at (x, y, z).
CHANGELOG
Changelog
1.0.1
- XPortal lists a portal plan as a portal and keeps the entry after the plan is built, so an unnamed "portal" stays
in everyone's target list. Within 2 seconds the server now removes such entries: plans, and entries whose object
was removed. Can be turned off with
[Cleanup] CleanXPortalList.
1.0.0
- First release. Portal and sign plans built by a dedicated server are built once and removed, instead of staying behind and being built again every time the plan totem checks them.
- A plan whose build fails for any other reason is removed, so the build cannot be repeated.
- Portals without a creator stacked at one spot (copies left by the bug) are removed when the world loads.