RimWorld

RimWorld

Not enough ratings
Craft Output Sanitizer
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.6
File Size
Posted
163.780 KB
24 Aug @ 3:29pm
1 Change Note ( view )

Subscribe to download
Craft Output Sanitizer

In 1 collection by Toxic Yui
Toxic Yui's Mods
9 items
Description
Craft Output Sanitizer
300 mods and you don't know why are you producing 10 Pants instead of 1?!
Stop surprise duplicates when crafting weapons & apparel.

What it does
  • Guarantees that recipes declaring 1 weapon/apparel produce exactly one.
  • Neutralizes accidental extra stacks from mod interactions (e.g., stack size edits).
  • Decides what to do with extras: Destroy or Drop (forbidden).
  • Per-bench opt-out (Settings → Exclusions) with search + checkboxes.
  • Optional in-world toasts and detailed action logs for quick testing.
  • Lightweight: by default it runs only during crafting, not on map load.

Settings
- Force single output for Weapons/Apparel (when recipe declares 1) - Destroy extras (instead of dropping them forbidden) - Only sanitize during crafting (recommended) - Log actions - Show action toasts - Revert logging to defaults (quiet) - Exclude specific workbenches (search + checkboxes)

Why I made this mod?

I play with many efficiency/speed/mastery mods (EG, Quality Bionics, Archotech Expanded, plus Vanilla Expanded Skills). In that setup, crafting “1” sometimes produced 2–4 items (e.g., pants duplicating), this error made me quit Rimworld for a time (this was an error I faced in 1,6). Now that I'm experienced, COS fixes that edge case. You can see the involved mods in my log screenshot—the lines starting with [COS], and now I'm back on the game to play it!.



How it works
  • Hooks into RimWorld’s crafting pipeline (MakeRecipeProducts → PostProcessProduct).
  • If a recipe declares one weapon/apparel, the mod enforces a single output.
  • Extras (stacks or duplicates) are either destroyed or dropped forbidden—your choice.
  • You can exclude any workbench; excluded benches are never touched.
  • Optional spawn-time guard exists, but is disabled by default for performance.

Compatibility
  • RimWorld 1.6, Harmony-based, no XML overrides.
  • Compatible with most crafting/stack mods. If something still duplicates, enable logs/toasts to see exactly what was sanitized.
  • Safe to add/remove mid-save (does not write permanent data).

Performance
  • Minimal overhead: bench catalog is built lazily (when opening settings).
  • “Only sanitize during crafting” is enabled by default to avoid load-time costs.
  • Logging can slow things down; use “Revert logging to defaults (quiet)” to mute.

FAQ
Q: I crafted 1 item and saw no message. Did it work? A: Yes—no message means no extras existed; nothing needed to be sanitized. Q: How do I verify it’s running? A: Turn on “Log actions” (and “Show action toasts”) in settings, then craft. Turn OFF as soon as you done, this option adds several time to startup if left on Q: A specific bench shouldn’t be affected. A: Exclude it in settings (search by label or defName, then check it). Q: Does it affect traders, loot, or quests? A: No—this targets player crafting outputs only.




Credits & translations
Code/design: ToxicYui. Translations welcome!

License

[ko-fi.com]
6 Comments
Toxic Yui  [author] 25 Aug @ 10:33am 
Sometimes it’s fun, and other times you catch yourself thinking, “I can probably tweak this… and that… and those!” In my case, that's why I spend more time coding than playing during the week, and I save weekends for QoL updates and some actual gameplay (I found coding fun so I don't have a problem with that). But as you know, I even stopped playing just to fix that annoying bug :NZA2_Eagle:
VitaKaninen 25 Aug @ 9:37am 
Lol. It must be nice to have the expertise to just throw together your own mod to fix things whenever you want.
Toxic Yui  [author] 25 Aug @ 9:22am 
Totally get it—this is a classic late-game “Heisenbug.” It won’t show in a clean dev setup, then pops up after hours of play when a few mods interact just right. I tried the whole morning and afternoon to figure out what's causing that issue and said: You know what, let's do a mod to fix it instead, I'm tired. Lol :pigeonface:
VitaKaninen 25 Aug @ 9:13am 
Ok, I guess in all my thousands of hours in the game, I have never had this happen before.

I would have thought this is a bug in the other mods that the other authors should fix.
Toxic Yui  [author] 25 Aug @ 8:44am 
When is it needed? Only when a single-output clothing/weapon recipe (e.g., a shirt) spits out extras due to mod interactions. COS keeps 1 and removes/drops the rest.

Butcher table? Not affected. You’ll still get full meat/leather. It’s listed only because it’s a bill giver; COS targets weapons/apparel. You can also exclude it in Settings.

“Do until X”? Unchanged. COS doesn’t alter vanilla counting or floor checks; it just prevents unintended extra items from being created.

Why I made this mod: I play with many efficiency/speed/mastery mods (EG, Quality Bionics, Archotech Expanded, plus Vanilla Expanded Skills). In that setup, crafting “1” sometimes produced 2–4 items (e.g., pants duplicating). COS fixes that edge case. You can see the involved mods in my log screenshot—the lines starting with [COS].
VitaKaninen 25 Aug @ 3:00am 
Can you give an example for when this is needed? I have never tried to craft a shirt, and it gave me 10 of them. Also, you have the butcher table listed. Does that mean that if I butcher an animal I will get 1 meat, instead of 100?

Or is this supposed to be used when the recipe calls for "Make until", and it doesn't count the items sitting on the floor?