From de74d71f0f5eb6281398949fd25b93a120fc6150 Mon Sep 17 00:00:00 2001 From: anth64 Date: Sun, 21 Jun 2026 18:40:36 +0200 Subject: [PATCH] docs: restructure README into Usage and For mod development sections --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0ee0f13..a25524b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,21 @@ Server-side mod for Vintage Story. Lets other mods hook into chat commands before and after they run, namespaced per mod so multiple mods can watch the same command without colliding. -## How it works +## Usage + +Install it like any other mod. It has no effect unless something else +depends on it. + +## For mod development + +Add it as a dependency in your `modinfo.json`: + +```json +"dependencies": { + "game": "1.22.3", + "commandhook": "1.0.0" +} +``` CommandHook patches `ChatCommandApi.Execute` and dispatches to whoever has registered. Your mod doesn't patch anything itself, it just implements @@ -28,7 +42,7 @@ path where the command actually ran. `CommandData` is passed by `ref` the whole way through, no allocation per command. -## Example +### Example ```csharp public class MyListener : ICommandHookListener @@ -83,4 +97,3 @@ public override void Dispose() Calling `Register` again with the same `ModId` replaces your existing registration. If your `Commands` list hasn't changed, it's a no-op. -