Compare commits
1
Commits
2a7cdb4fad
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de74d71f0f |
@@ -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
|
before and after they run, namespaced per mod so multiple mods can watch
|
||||||
the same command without colliding.
|
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
|
CommandHook patches `ChatCommandApi.Execute` and dispatches to whoever
|
||||||
has registered. Your mod doesn't patch anything itself, it just implements
|
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
|
`CommandData` is passed by `ref` the whole way through, no allocation per
|
||||||
command.
|
command.
|
||||||
|
|
||||||
## Example
|
### Example
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
public class MyListener : ICommandHookListener
|
public class MyListener : ICommandHookListener
|
||||||
@@ -83,4 +97,3 @@ public override void Dispose()
|
|||||||
|
|
||||||
Calling `Register` again with the same `ModId` replaces your existing
|
Calling `Register` again with the same `ModId` replaces your existing
|
||||||
registration. If your `Commands` list hasn't changed, it's a no-op.
|
registration. If your `Commands` list hasn't changed, it's a no-op.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user