aboutsummaryrefslogtreecommitdiff
path: root/azalea-world/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-06-11 22:22:26 +0000
committermat <git@matdoes.dev>2025-06-11 22:22:26 +0000
commit1b348ceeffc61e49b19f2982e7a9de479c1678de (patch)
treebead28ce1a076a3af5ca5df2c326c9e94b63dd92 /azalea-world/src
parent067ec06f26ecaf7a319eb3ce61307b9730176313 (diff)
downloadazalea-drasl-1b348ceeffc61e49b19f2982e7a9de479c1678de.tar.xz
implement reverting block state predictions on ack
Diffstat (limited to 'azalea-world/src')
-rw-r--r--azalea-world/src/palette/container.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/azalea-world/src/palette/container.rs b/azalea-world/src/palette/container.rs
index 2f3d9238..0ddac6c2 100644
--- a/azalea-world/src/palette/container.rs
+++ b/azalea-world/src/palette/container.rs
@@ -192,19 +192,10 @@ impl<S: PalletedContainerKind> PalettedContainer<S> {
/// Sets the id at the given coordinates and return the previous id
pub fn get_and_set(&mut self, pos: S::SectionPos, value: S) -> S {
let paletted_value = self.id_for(value);
- let block_state_id = self
+ let old_paletted_value = self
.storage
.get_and_set(self.index_from_coords(pos), paletted_value as u64);
- // error in debug mode
- #[cfg(debug_assertions)]
- if block_state_id > BlockState::MAX_STATE.into() {
- warn!(
- "Old block state from get_and_set {block_state_id} was greater than max state {}",
- BlockState::MAX_STATE
- );
- }
-
- S::try_from(block_state_id as u32).unwrap_or_default()
+ self.palette.value_for(old_paletted_value as usize)
}
/// Sets the id at the given index and return the previous id. You probably