{"id":50490724,"url":"https://github.com/escapepz/manipulation_authority_framework","last_synced_at":"2026-06-02T02:30:55.154Z","repository":{"id":354417540,"uuid":"1167159941","full_name":"escapepz/manipulation_authority_framework","owner":"escapepz","description":"A modding framework that allows creators to build custom rules and restrictions for world objects.","archived":false,"fork":false,"pushed_at":"2026-04-28T12:34:35.000Z","size":2731,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-28T14:32:19.897Z","etag":null,"topics":["lua","projectzomboid","zomboid"],"latest_commit_sha":null,"homepage":"https://steamcommunity.com/sharedfiles/filedetails/?id=3675331117","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/escapepz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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-26T02:09:13.000Z","updated_at":"2026-04-28T12:34:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/escapepz/manipulation_authority_framework","commit_stats":null,"previous_names":["escapepz/manipulation_authority_framework"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/escapepz/manipulation_authority_framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escapepz%2Fmanipulation_authority_framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escapepz%2Fmanipulation_authority_framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escapepz%2Fmanipulation_authority_framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escapepz%2Fmanipulation_authority_framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/escapepz","download_url":"https://codeload.github.com/escapepz/manipulation_authority_framework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escapepz%2Fmanipulation_authority_framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33803734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["lua","projectzomboid","zomboid"],"created_at":"2026-06-02T02:30:53.249Z","updated_at":"2026-06-02T02:30:55.148Z","avatar_url":"https://github.com/escapepz.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Manipulation Authority Framework (MAF)\n\n**Manipulation Authority Framework** is a Project Zomboid modding toolkit that allows creators to build custom rules, restrictions, and side effects for moving, dismantling, or destroying world objects.\n\nIt provides a centralized, event-driven pipeline that intercepts world interactions (like sledgehammering, picking up furniture, or dismantling structures) and allows multiple mods to register their own logic without conflicts.\n\n## Key Features\n\n- **Three-Phase Manipulation Pipeline**: Hooks for `validate`, `pre`, and `post` stages to control every part of a world interaction.\n- **Priority-Based Rule Registration**: Multiple mods can add protection or logic rules, ordered by priority to ensure consistent behavior.\n- **Comprehensive Action Support**: Provides global control over sledgehammer destruction, furniture relocation (moveables), and structure disassembly.\n- **Sandbox Security Controls**: Server admins can easily toggle framework protections and configure performance limits through the sandbox menu.\n- **Automatic Multi-Action Validation**: Rules trigger instantly whenever a player attempts to modify the environment, protecting bases and infrastructure.\n\n## How It Works\n\nThe framework wraps core Project Zomboid actions (`ISDestroyStuffAction`, `ISDismantleAction`, `ISMoveablesAction`) and injects a standard processing pipeline:\n\n1.  **Validate**: Lightweight check to decide if the action is allowed. If any rule sets `context.flags.rejected = true`, the action is blocked before it starts.\n2.  **Pre-Action**: Fires just before the action completes successfully. Used for final validation or to record audits.\n3.  **Post-Action**: Fires after the action has finished. Used for side effects, custom item drops, or logging.\n\n### Supported Action Types\n\n- `DestroyStuff`: Sledgehammering or destroying objects.\n- `Dismantle`: Disassembling structures and furniture using tools.\n- `Moveables`: Picking up, placing, rotating, or scrapping world objects.\n\n---\n\n## Usage for Modders\n\nTo use MAF, you simply require the framework and register your rule during initialization.\n\n### Example: Shop Protection Rule\n\nThis rule prevents players from destroying or moving objects that belong to a \"shop\" (defined in modData).\n\n```lua\nlocal MAF = require(\"manipulation_authority_framework\")\n\nlocal function validateShopProtection(context)\n    local object = context.object\n    local character = context.character\n\n    -- Check if object belongs to a shop owner in modData\n    if object and object:getModData().shopOwner then\n        local owner = object:getModData().shopOwner\n        if owner ~= character:getUsername() then\n            -- Block the action\n            context.flags.rejected = true\n            context.flags.reason = \"This object belongs to \" .. tostring(owner) .. \"'s shop.\"\n        end\n    end\nend\n\n-- Register the rule: (phase, unique_id, callback, priority)\nMAF:registerRule(\"validate\", \"my_mod:shop_protection\", validateShopProtection, 100)\n```\n\n## Context Object\n\nEvery rule receives a `context` object containing:\n\n- `actionType`: `DestroyStuff`, `Dismantle`, or `Moveables`.\n- `character`: The `IsoPlayer` performing the action.\n- `object`: The `IsoObject` being targeted.\n- `square`: The `IsoGridSquare` where the object is located.\n- `flags`: A table where you can set `rejected = true` or provide a `reason`.\n- `data`: Additional data (e.g., `mode` for Moveables: \"pickup\", \"place\", etc.).\n\n---\n\n## Best For\n\n- **Roleplay Servers**: Create complex property ownership and zoning laws.\n- **Economy Mods**: Protect storefronts and public infrastructure.\n- **Hardcore Survival**: Add wear-and-tear or weight restrictions to moving furniture.\n- **Admin Tools**: Build robust auditing and logging systems for world changes.\n\n---\n\n## Technical Details (Performance)\n\nMAF is designed to be extremely lightweight.\n\n- Validation is cached per action instance to prevent redundant checks.\n- Event listener limits can be configured in Sandbox options to prevent \"laggy\" server-side event storms.\n- Errors in mod-provided rules are isolated using protected calls (`pcall`) to ensure server stability.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescapepz%2Fmanipulation_authority_framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fescapepz%2Fmanipulation_authority_framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescapepz%2Fmanipulation_authority_framework/lists"}