From ce9c39d275ae618c205dcf95d3063cdefff78f7e Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 8 Oct 2023 03:44:43 -0500 Subject: [PATCH] add usage example in readme --- README.md | 12 ++++++++++++ src/lib.rs | 2 ++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 146a62b..272f2e4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,18 @@ An [Azalea](https://github.com/azalea-rs/azalea) plugin with useful features that will probably trigger anticheats. +## Usage + +```rust +async fn handle(mut bot: Client, event: azalea::Event, state: State) -> anyhow::Result<()> { + match event { + azalea::Event::Init => { + bot.set_anti_knockback(true); + } + } +} +``` + ## Features - Anti-knockback diff --git a/src/lib.rs b/src/lib.rs index eab118a..343b694 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,5 @@ +#![doc = include_str!("../README.md")] + use azalea::{ app::{App, Plugin, PreUpdate}, ecs::prelude::*,