mirror of
https://github.com/azalea-rs/azalea-viaversion.git
synced 2025-08-02 06:16:05 +00:00
fix and simplify the example in the readme
This commit is contained in:
parent
93080e3e40
commit
e4ca1b3a36
1 changed files with 9 additions and 6 deletions
15
README.md
15
README.md
|
@ -7,13 +7,16 @@ An [Azalea] plugin using [ViaProxy] to support connecting to every Minecraft ser
|
|||
Add the `ViaVersionPlugin` to your `ClientBuilder` or `SwarmBuilder`.
|
||||
|
||||
```rust
|
||||
#[tokio::main]
|
||||
fn main() {
|
||||
let plugin = ViaVersionPlugin::start("1.21.4").await;
|
||||
let builder = ClientBuilder::new().add_plugins(plugin);
|
||||
use azalea::prelude::*;
|
||||
use azalea_viaversion::ViaVersionPlugin;
|
||||
|
||||
let account = Account::offline("Azalea");
|
||||
builder.start(account, "localhost").await.unwrap();
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
ClientBuilder::new()
|
||||
.add_plugins(ViaVersionPlugin::start("1.21.4").await)
|
||||
.start(Account::offline("Azalea"), "localhost")
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue