Skip to content
Merged
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
15 changes: 12 additions & 3 deletions blocks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,9 @@ macro_rules! define_blocks {
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 {
Expand All @@ -446,7 +446,7 @@ 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);
}
*/

Expand Down Expand Up @@ -968,6 +968,7 @@ define_blocks! {
],
},
data Some(variant.data()),
offset Some(variant.offset()),
material material::NON_SOLID,
model { ("minecraft", variant.as_string() ) },
tint TintType::Grass,
Expand Down Expand Up @@ -7289,6 +7290,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)]
Expand Down