aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-10-12 06:09:04 -1400
committermat <git@matdoes.dev>2025-10-12 06:09:04 -1400
commitd5e14c81810952b6d1b11b915d9c22d2119dd61f (patch)
treeba2ddef7bc18680fc38631c5d19ef3f1dc678518
parentee2575794e91b9457a74a95daf1dcc707058cd58 (diff)
downloadazalea-drasl-d5e14c81810952b6d1b11b915d9c22d2119dd61f.tar.xz
fix wrong WritableBookContent representation
fixes #264
-rw-r--r--azalea-core/src/filterable.rs13
-rw-r--r--azalea-inventory/src/components/mod.rs2
2 files changed, 13 insertions, 2 deletions
diff --git a/azalea-core/src/filterable.rs b/azalea-core/src/filterable.rs
index 893ebc3e..fe9a553d 100644
--- a/azalea-core/src/filterable.rs
+++ b/azalea-core/src/filterable.rs
@@ -1,4 +1,7 @@
-use std::io::{self, Cursor, Write};
+use std::{
+ fmt::Debug,
+ io::{self, Cursor, Write},
+};
use azalea_buf::{AzaleaRead, AzaleaReadLimited, AzaleaReadVar, AzaleaWrite};
use serde::Serialize;
@@ -56,3 +59,11 @@ impl<T: PartialEq> PartialEq for Filterable<T> {
self.raw == other.raw && self.filtered == other.filtered
}
}
+impl<T: Debug> Debug for Filterable<T> {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_struct("Filterable")
+ .field("raw", &self.raw)
+ .field("filtered", &self.filtered)
+ .finish()
+ }
+}
diff --git a/azalea-inventory/src/components/mod.rs b/azalea-inventory/src/components/mod.rs
index 5661547a..7f3fa831 100644
--- a/azalea-inventory/src/components/mod.rs
+++ b/azalea-inventory/src/components/mod.rs
@@ -703,7 +703,7 @@ pub struct SuspiciousStewEffects {
#[derive(Clone, PartialEq, AzBuf, Debug, Serialize)]
pub struct WritableBookContent {
- pub pages: Vec<String>,
+ pub pages: Vec<Filterable<String>>,
}
#[derive(Clone, PartialEq, AzBuf, Serialize)]