Compare commits

..

No commits in common. "118034dd277e11dfacb692ae39ef8b8951484a8d" and "58f2ff53b9b9e812e37e40fd372c9c1158678caf" have entirely different histories.

4 changed files with 14 additions and 19 deletions

View file

@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: '1.86'
toolchain: '1.85.1'
components: rustfmt
- run: cargo fmt --all -- --check
@ -58,7 +58,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: '1.86'
toolchain: '1.85.1'
components: clippy
- uses: swatinem/rust-cache@v2
- uses: actions-rs/clippy-check@v1
@ -72,7 +72,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: '1.86'
toolchain: '1.85.1'
components: rust-docs
- uses: swatinem/rust-cache@v2
- run: cargo doc --workspace --no-deps --document-private-items
@ -87,7 +87,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: '1.86'
toolchain: '1.85.1'
- uses: swatinem/rust-cache@v2
- run: cargo test --workspace
- run: cargo test --workspace --no-default-features
@ -127,7 +127,7 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: '1.86'
toolchain: '1.85.1'
targets: '${{ matrix.target }}'
- uses: swatinem/rust-cache@v2

View file

@ -48,7 +48,7 @@ pub const MIPMAP_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(0);
/// MinedMap processed entity data version number
///
/// Increase when entity collection changes bacause of code changes.
pub const ENTITIES_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(3);
pub const ENTITIES_FILE_META_VERSION: FileMetaVersion = FileMetaVersion(2);
/// Coordinate pair of a generated tile
///

View file

@ -419,7 +419,7 @@ impl<'a> Iterator for SectionIter<'a> {
}
fn last(mut self) -> Option<Self::Item> {
self.next_back()
self.with_iter(|iter| iter.last())
}
}

View file

@ -176,20 +176,15 @@ pub struct TextValue(pub fastnbt::Value);
impl TextValue {
/// Deserializes a [TextValue] into a [DeserializedText]
pub fn deserialize(&self, data_version: u32) -> DeserializedText {
// TODO: Improve error handling
//
// Unfortunately, there are a number of weird ways an empty sign coould
// be encoded (for example a compound with an "" key), so for now we
// simply interpret undecodable data as empty.
if data_version < 4290 {
let fastnbt::Value::String(json) = &self.0 else {
return DeserializedText::default();
};
serde_json::from_str(json).unwrap_or_default()
} else {
fastnbt::from_value(&self.0).unwrap_or_default()
if let fastnbt::Value::String(json) = &self.0 {
if let Ok(content) = serde_json::from_str(json) {
return content;
}
}
}
fastnbt::from_value(&self.0).unwrap_or_default()
}
}