azalea/azalea-brigadier
mat a069ffe982 fix non-u8 gamemodes
love you wynncraft
2023-12-16 14:29:49 -06:00
..
src fix non-u8 gamemodes 2023-12-16 14:29:49 -06:00
tests brigadier suggestions 2023-10-12 22:01:15 -05:00
Cargo.toml Release 0.9.0 2023-12-05 11:06:51 -06:00
README.md update repo links 2023-10-08 03:58:57 -05:00

Azalea Brigadier

A Rust port of Mojang's Brigadier command parsing and dispatching library.

Examples

use azalea_brigadier::prelude::*;
use std::sync::Arc;

#[derive(Debug, PartialEq)]
struct CommandSource {}

let mut subject = CommandDispatcher::new();
subject.register(literal("foo").executes(|_| 42));

assert_eq!(
    subject
        .execute("foo", Arc::new(CommandSource {}))
        .unwrap(),
    42
);

See the tests for more.