Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ is breaking anyways, semantic versioning is not followed.

- Add `Client::query_entity` and `try_query_entity` to complement `query_self`.
- Add `Client::entity_interact` and `EntityInteractEvent` to interact with entities without checking that they're in the crosshair.
- Implement initial support for mob effects, including jump boost, haste, conduit power, and mining fatigue. (@ShayBox)
- Allow disabling dependencies related to Microsoft auth with the `online-mode` cargo feature.
- Implement mob effects, including jump boost, haste, conduit power, and mining fatigue. (@ShayBox)
- Support for the efficiency enchantment.
- Support for items with attribute modifiers.

### Changed

Expand All @@ -22,9 +24,11 @@ is breaking anyways, semantic versioning is not followed.
- `Client::query`, `map_component`, and `map_get_component` were replaced by `Client::query_self`.
- Rename `SendPacketEvent` to `SendGamePacketEvent` and `PingEvent` to `GamePingEvent`.
- Swap the order of the type parameters in entity filtering functions so query is first, then filter.
- Moved `azalea_client::inventory::Inventory` to `azalea_entity::inventory::Inventory`.
- Add `Client::open_container_at_with_timeout_ticks`, and `Client::open_container_at` now times out after 5 seconds.
- Rename `ResourceLocation` to `Identifier` to match Minecraft's new internal naming.
- Rename `azalea_protocol::resolver` to `resolve` and `ResolverError` to `ResolveError`.
- Refactor `RegistryHolder` to pre-deserialize some registries.

### Fixed

Expand Down
88 changes: 41 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ sha1 = "0.11.0-rc.3"
sha2 = "0.11.0-rc.3"
# TODO: Remove when rsa is fixed.
signature = "=3.0.0-rc.5"
# TODO
simdnbt = { version = "0.8.0", git = "https://github.com/azalea-rs/simdnbt" }
socks5-impl = "0.7.2"
syn = "2.0.110"
Expand Down
18 changes: 13 additions & 5 deletions azalea-chat/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ use std::{
sync::LazyLock,
};

#[cfg(feature = "azalea-buf")]
#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError};
use serde::{Deserialize, Deserializer, Serialize, de};
#[cfg(feature = "simdnbt")]
use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _};
#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
use tracing::{debug, trace, warn};

use crate::{
base_component::BaseComponent,
Expand Down Expand Up @@ -66,6 +62,8 @@ impl FormattedText {

#[cfg(feature = "simdnbt")]
fn parse_separator_nbt(nbt: &simdnbt::borrow::NbtCompound) -> Option<FormattedText> {
use simdnbt::FromNbtTag;

if let Some(separator) = nbt.get("separator") {
FormattedText::from_nbt_tag(separator)
} else {
Expand Down Expand Up @@ -461,6 +459,8 @@ impl FormattedText {
FormattedText::from(s)
}
fn from_nbt_list(list: simdnbt::borrow::NbtList) -> Option<FormattedText> {
use tracing::debug;

let mut component;
if let Some(compounds) = list.compounds() {
component = FormattedText::from_nbt_compound(compounds.first()?)?;
Expand All @@ -480,6 +480,9 @@ impl FormattedText {
}

pub fn from_nbt_compound(compound: simdnbt::borrow::NbtCompound) -> Option<Self> {
use simdnbt::{Deserialize, FromNbtTag};
use tracing::{trace, warn};

let mut component: FormattedText;

if let Some(text) = compound.get("text") {
Expand Down Expand Up @@ -631,6 +634,9 @@ impl From<&simdnbt::Mutf8Str> for FormattedText {
#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
impl AzaleaRead for FormattedText {
fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
use simdnbt::FromNbtTag;
use tracing::trace;

let nbt = simdnbt::borrow::read_optional_tag(buf)?;
trace!(
"Reading NBT for FormattedText: {:?}",
Expand All @@ -648,6 +654,8 @@ impl AzaleaRead for FormattedText {
#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
impl AzaleaWrite for FormattedText {
fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
use simdnbt::Serialize;

let mut out = Vec::new();
simdnbt::owned::BaseNbt::write_unnamed(&(self.clone().to_compound().into()), &mut out);
buf.write_all(&out)
Expand Down
4 changes: 3 additions & 1 deletion azalea-client/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Azalea Client

A library that can mimic everything a normal Minecraft client can do. If you want to make a bot with higher-level functions, you should use the `azalea` crate instead.
A library that can mimic everything a normal Minecraft client can do.

If you want to make a bot with higher-level functions, consider using the `azalea` crate instead.
Loading