From 5584b4d143247cfde85314608c8138d61cddc2bf Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 10 Jan 2021 15:16:38 -0800 Subject: [PATCH 1/4] blocks: enable logging block states --- blocks/src/lib.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/blocks/src/lib.rs b/blocks/src/lib.rs index 01ff0f39..d3a4411f 100644 --- a/blocks/src/lib.rs +++ b/blocks/src/lib.rs @@ -417,13 +417,11 @@ macro_rules! define_blocks { let offset = block.get_flat_offset(); if let Some(offset) = offset { let id = *flat_id + offset; - /* if let Some(vanilla_id) = vanilla_id { - debug!("{} block state = {:?} hierarchical {}:{} offset={}", id, block, vanilla_id >> 4, vanilla_id & 0xF, offset); + println!("{} block state = {:?} hierarchical {}:{} offset={}", id, block, vanilla_id >> 4, vanilla_id & 0xF, offset); } else { - debug!("{} block state = {:?} hierarchical none, offset={}", id, block, offset); + println!("{} block state = {:?} hierarchical none, offset={}", id, block, offset); } - */ if offset as isize > last_offset { last_offset = offset as isize; } @@ -444,11 +442,9 @@ macro_rules! define_blocks { } if let Some(vanilla_id) = vanilla_id { - /* if offset.is_none() { - debug!("(no flat) block state = {:?} hierarchical {}:{}", block, vanilla_id >> 4, vanilla_id & 0xF); + println!("(no flat) block state = {:?} hierarchical {}:{}", block, vanilla_id >> 4, vanilla_id & 0xF); } - */ if (*blocks_hier).len() <= vanilla_id { (*blocks_hier).resize(vanilla_id + 1, None); From 3c88c8cbbe706579819592282533e30324b756fa Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 10 Jan 2021 15:16:47 -0800 Subject: [PATCH 2/4] blocks: add offset for TallGrass --- blocks/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/blocks/src/lib.rs b/blocks/src/lib.rs index d3a4411f..f9a1fe63 100644 --- a/blocks/src/lib.rs +++ b/blocks/src/lib.rs @@ -964,6 +964,7 @@ define_blocks! { ], }, data Some(variant.data()), + offset Some(variant.data()), material material::NON_SOLID, model { ("minecraft", variant.as_string() ) }, tint TintType::Grass, From 9adb8447481cc1fbf14e83d6c929794599335f1d Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 10 Jan 2021 15:37:44 -0800 Subject: [PATCH 3/4] blocks: fix TallGrass variant offsets (grass/fern/deadbush block states) --- blocks/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/blocks/src/lib.rs b/blocks/src/lib.rs index f9a1fe63..25fa45f3 100644 --- a/blocks/src/lib.rs +++ b/blocks/src/lib.rs @@ -964,7 +964,7 @@ define_blocks! { ], }, data Some(variant.data()), - offset Some(variant.data()), + offset Some(variant.offset()), material material::NON_SOLID, model { ("minecraft", variant.as_string() ) }, tint TintType::Grass, @@ -7286,6 +7286,14 @@ impl TallGrassVariant { TallGrassVariant::Fern => 2, } } + + fn offset(self) -> usize { + match self { + TallGrassVariant::TallGrass => 0, + TallGrassVariant::Fern => 1, + TallGrassVariant::DeadBush => 2, + } + } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] From 7012585fb2cf517ee84b7eb875533ed5b34ea316 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 10 Jan 2021 16:09:10 -0800 Subject: [PATCH 4/4] Comment-out block state debugging --- blocks/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blocks/src/lib.rs b/blocks/src/lib.rs index 25fa45f3..e6e0aeb8 100644 --- a/blocks/src/lib.rs +++ b/blocks/src/lib.rs @@ -417,11 +417,13 @@ macro_rules! define_blocks { let offset = block.get_flat_offset(); if let Some(offset) = offset { let id = *flat_id + offset; + /* if let Some(vanilla_id) = vanilla_id { println!("{} block state = {:?} hierarchical {}:{} offset={}", id, block, vanilla_id >> 4, vanilla_id & 0xF, offset); } else { println!("{} block state = {:?} hierarchical none, offset={}", id, block, offset); } + */ if offset as isize > last_offset { last_offset = offset as isize; } @@ -442,9 +444,11 @@ macro_rules! define_blocks { } if let Some(vanilla_id) = vanilla_id { + /* if offset.is_none() { println!("(no flat) block state = {:?} hierarchical {}:{}", block, vanilla_id >> 4, vanilla_id & 0xF); } + */ if (*blocks_hier).len() <= vanilla_id { (*blocks_hier).resize(vanilla_id + 1, None);