{"id":44960963,"url":"https://github.com/phobos-dthorga/mod-pz-phobos-lib","last_synced_at":"2026-04-02T18:30:54.849Z","repository":{"id":338804441,"uuid":"1159246241","full_name":"phobos-dthorga/mod-pz-phobos-lib","owner":"phobos-dthorga","description":"Shared utility library for Project Zomboid Build 42 mods — sandbox access, fluid helpers, quality tracking, hazard systems, and reset tools.","archived":false,"fork":false,"pushed_at":"2026-03-23T07:32:26.000Z","size":8719,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-23T10:13:25.555Z","etag":null,"topics":["build-42","game-mod","library","lua","mod-framework","modding","project-zomboid","project-zomboid-mod"],"latest_commit_sha":null,"homepage":"https://steamcommunity.com/sharedfiles/filedetails/?id=3668598865","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phobos-dthorga.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-16T13:54:45.000Z","updated_at":"2026-03-23T07:32:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/phobos-dthorga/mod-pz-phobos-lib","commit_stats":null,"previous_names":["phobos-dthorga/mod-pz-phobos-lib"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/phobos-dthorga/mod-pz-phobos-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phobos-dthorga%2Fmod-pz-phobos-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phobos-dthorga%2Fmod-pz-phobos-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phobos-dthorga%2Fmod-pz-phobos-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phobos-dthorga%2Fmod-pz-phobos-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phobos-dthorga","download_url":"https://codeload.github.com/phobos-dthorga/mod-pz-phobos-lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phobos-dthorga%2Fmod-pz-phobos-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31312911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-42","game-mod","library","lua","mod-framework","modding","project-zomboid","project-zomboid-mod"],"created_at":"2026-02-18T13:04:52.114Z","updated_at":"2026-04-02T18:30:54.832Z","avatar_url":"https://github.com/phobos-dthorga.png","language":"Lua","readme":"\u003c!--\n  ________________________________________________________________________\n / Copyright (c) 2026 Phobos A. D'thorga                                \\\n |                                                                        |\n |           /\\_/\\                                                         |\n |         =/ o o \\=    Phobos' PZ Modding                                |\n |          (  V  )     All rights reserved.                              |\n |     /\\  / \\   / \\                                                      |\n |    /  \\/   '-'   \\   This source code is part of the Phobos            |\n |   /  /  \\  ^  /\\  \\  mod suite for Project Zomboid (Build 42).         |\n |  (__/    \\_/ \\/  \\__)                                                  |\n |     |   | |  | |     Unauthorised copying, modification, or            |\n |     |___|_|  |_|     distribution of this file is prohibited.          |\n |                                                                        |\n \\________________________________________________________________________/\n--\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"poster.png\" alt=\"PhobosLib\" width=\"400\"\u003e\n\u003c/p\u003e\n\n# PhobosLib\n\n![CI](https://github.com/phobos-dthorga/mod-pz-phobos-lib/actions/workflows/ci.yml/badge.svg)\n\n**Version:** 1.18.1 | **Requires:** Project Zomboid Build 42.14.0+\n\n\u003e **Players:** Subscribe on [Steam Workshop](https://steamcommunity.com/sharedfiles/filedetails/?id=3668598865) — this mod is required by [Phobos' Industrial Pathways: Biomass](https://steamcommunity.com/sharedfiles/filedetails/?id=3668197831).\n\u003e\n\u003e **Modders \u0026 Developers:** Full API reference in [docs/](docs/). Bug reports and feature requests via [GitHub Issues](https://github.com/phobos-dthorga/mod-pz-phobos-lib/issues).\n\nA shared utility library for Project Zomboid mods (Build 42 focused).\n\n**Used by:** [Phobos' Industrial Pathways: Biomass](https://github.com/phobos-dthorga/mod-pz-chemistry-pathways) ([Workshop](https://steamcommunity.com/sharedfiles/filedetails/?id=3668197831)) — 301-recipe industrial chemistry and biomass processing suite\n\n## Goals\n- Provide stable, reusable helpers (sandbox vars, API probing, world scan, fluid helpers, etc.)\n- Reduce duplicated Lua glue code across mods\n- Improve resilience to minor B42 API changes through safe wrappers\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/architecture/images/modules-banner.png\" alt=\"PhobosLib Modules\" width=\"200\"\u003e\n\u003c/p\u003e\n\n## Modules\n\n| Module | Description |\n|--------|-------------|\n| **PhobosLib_Util** | General-purpose utilities: safe method calling, API probing, keyword-based item search, modData helpers, player speech bubbles |\n| **PhobosLib_Fluid** | Build 42 fluid container helpers with multi-strategy API fallbacks for add/drain/query operations |\n| **PhobosLib_World** | World-scanning: tile iteration, object keyword search, generator detection, vehicle proximity checks |\n| **PhobosLib_Sandbox** | Safe sandbox variable access with defaults, runtime mod detection, yield multiplier application, persistent one-shot flag consumption, mod-owned callback table creation for OnTest/OnCreate |\n| **PhobosLib_Quality** | Generic quality/purity tracking: 0-100 scoring, tier lookup, equipment factors, severity scaling, yield penalties |\n| **PhobosLib_Hazard** | PPE detection, respiratory protection assessment, mask filter degradation, EHR disease dispatch with vanilla stat fallback |\n| **PhobosLib_Skill** | Perk existence checks, safe XP queries and awards, one-shot XP mirroring, persistent cross-skill XP mirror registration via Events.AddXP |\n| **PhobosLib_Reset** | Generic inventory/recipe/skill reset utilities: deep inventory traversal, modData stripping, recipe removal, XP reset, item removal by module |\n| **PhobosLib_Validate** | Startup dependency validation: register expected items/fluids/perks at load time, validate during OnGameStart, log missing entries with requesting mod ID |\n| **PhobosLib_Trading** | Generic wrapper for Dynamic Trading mod API: lazy runtime detection, custom tag/archetype/item registration, batch item registration — all functions are no-ops when DynamicTrading is not installed; all DT calls are pcall-wrapped for mid-save safety |\n| **PhobosLib_Migrate** | Versioned save migration framework: semver comparison, version tracking in world modData, migration registration with guard keys, incompatible version handler with skip/reset/abort policies, idempotent execution — mods register migration functions that run once per version upgrade |\n| **PhobosLib_Debug** | Centralised debug logging: `PhobosLib.debug(modId, ...)` prints tagged messages when a mod's `EnableDebugLogging` sandbox option is true. Lazy per-mod caching |\n| **PhobosLib_Fermentation** | Fermentation registry and progress tracking for items using ReplaceOnRotten as positive curing. Register items with label/totalHours, query progress (percent, remaining days, completion), stamp/read game dates, format short date strings |\n| **PhobosLib_RecipeFilter** | *(client)* Crafting menu recipe visibility filter: register filter functions to hide/show `craftRecipe` entries based on sandbox settings or runtime conditions. Supports vanilla list view, vanilla grid view, and Neat Crafting mod compatibility |\n| **PhobosLib_Tooltip** | *(client)* Generic tooltip line appender: register provider callbacks that append coloured text lines below the vanilla item tooltip for matching items. Uses full render replacement of `ISToolTipInv.render()` with expanded dimensions |\n| **PhobosLib_LazyStamp** | *(client)* Lazy container condition stamper: register stampers that set item condition on unstamped items when the player opens a container. Useful for mods that repurpose item condition as a metadata channel (purity, charge level) |\n| **PhobosLib_VesselReplace** | *(client)* Empty vessel replacement: register mappings that replace empty FluidContainer items with vanilla vessels (EmptyJar, Bucket, etc.) when the player opens a container. Supports bonus items (e.g. JarLid for jar-type vessels). MP-synced |\n| **PhobosLib_FarmingSpray** | *(client)* Farming spray registration: register custom spray items that cure vanilla plant diseases (Mildew, Flies, Aphids, Slugs). Monkey-patches ISFarmingMenu and CFarming_Interact once on first registration. pcall-wrapped |\n| **PhobosLib_Power** | *(client)* Powered workstation support: grid/generator/custom power detection, CraftBench UI gating (greyed craft button with tooltip), time-based generator fuel drain. Extensible via registerPowerSource() for alternative power mods |\n| **PhobosLib_Popup** | *(client)* Generic popup system: first-time welcome guide with \"Don't show again\" checkbox, version-based \"What's New\" popup on major.minor bumps. Queue-based display, per-character persistence with MP sync |\n| **PhobosLib_WorkstationLabel** | *(client)* Workstation label filter: removes untranslated tags (like CannotBeResearched) from crafting window \"Requires: ...\" text. Vanilla + Neat Crafting compatible |\n| **PhobosLib_WorldAction** | *(client)* Generic world object context menu system: register custom right-click actions on world objects with requirement checks. Unavailable actions shown in red with reason tooltips |\n| **PhobosLib_EntityRebind** | *(server)* Server-side entity rebinding for pre-existing world objects. Ensures workstations placed before a mod update get their new entity scripts applied on game load |\n| **PhobosLib_Moodle** | *(client)* Moodle Framework soft dependency wrapper: register custom moodles, set/get moodle levels, detect Moodle Framework at runtime. No-op when Moodle Framework is not installed |\n\nUsage: `require \"PhobosLib\"` loads all 13 shared modules into the global `PhobosLib` table. The 11 client/server-side modules (RecipeFilter, Tooltip, LazyStamp, VesselReplace, FarmingSpray, Power, Popup, WorkstationLabel, WorldAction, EntityRebind, Moodle) are loaded automatically by PZ from `client/` and `server/`.\n\n## Intended usage\n- As a dependency: your mod can require PhobosLib and call its helpers.\n- As a vendored snippet source: small snippets may be copied with attribution, but depending on the library is preferred.\n\n## Stability promise\nPublic functions in PhobosLib should be treated as API surface. Changes should:\n- avoid breaking signatures\n- remain backwards compatible where possible\n- include migration notes when breaking changes are unavoidable\n\n## Documentation\n\n- [Module Overview \u0026 API Reference](docs/architecture/diagrams/module-overview.md) — All modules with function signatures, parameters, and descriptions\n- [Getting Started (for mod developers)](docs/guides/getting-started.md) — Add PhobosLib as a dependency, key modules, quick examples\n- [For Players](docs/guides/for-players.md) — What PhobosLib is and why you have it\n- [FAQ](docs/guides/faq.md) — Common questions\n\nSee [docs/README.md](docs/README.md) for the full index.\n\n## Files to read\n- LICENSE\n- PROJECT_IDENTITY.md\n- MODDING_PERMISSION.md\n- CONTRIBUTING.md\n\n## Verification Checklist\n\nAfter each intermediate or major version bump, verify:\n\n- [ ] All `PhobosLib_*.lua` modules load without errors in `console.txt`\n- [ ] `[PhobosLib:Validate]` log lines appear when dependent mods register expectations\n- [ ] `PhobosLib.perkExists()` correctly returns true/false for known/unknown perks\n- [ ] `PhobosLib.isModActive()` correctly detects active mods\n- [ ] World modData strip/get functions work (test via EPR cleanup or manual)\n- [ ] Recipe filters work: `[PhobosLib:RecipeFilter]` log lines confirm UI overrides installed (vanilla or Neat Crafting)\n- [ ] Tooltip providers work: `[PhobosLib:Tooltip]` log line confirms ISToolTipInv.render hook installed; hover over registered items to verify extra lines appear\n- [ ] Lazy stamper works: `[PhobosLib:LazyStamp]` log line confirms OnRefreshInventoryWindowContainers hook installed\n- [ ] Migration framework works: `[PhobosLib:Migrate]` log lines show version check and migration execution on game start\n- [ ] Vessel replacement works: `[PhobosLib:VesselReplace]` log line confirms OnRefreshInventoryWindowContainers hook installed; empty FluidContainers replaced with vessels on container open\n- [ ] Farming spray works: `[PhobosLib:FarmingSpray]` log line confirms ISFarmingMenu patch installed; registered sprays appear in \"Treat Problem\" submenu on diseased plants\n- [ ] Power module works: `[PhobosLib:Power]` log line confirms hooks installed; powered entities grey out craft button when no power\n- [ ] Popup system works: `[PhobosLib:Popup]` log lines confirm guide/changelog registrations; popups display on game start\n- [ ] Workstation label works: `[PhobosLib:WorkstationLabel]` log line confirms hooks installed; no raw IGUI_CraftingWindow_ keys in workstation labels\n- [ ] No `nil` or `NullPointerException` errors referencing PhobosLib in logs\n\n## Release notes\n- See CHANGELOG.md\n- See VERSIONING.md\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphobos-dthorga%2Fmod-pz-phobos-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphobos-dthorga%2Fmod-pz-phobos-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphobos-dthorga%2Fmod-pz-phobos-lib/lists"}