types: make CHUNKS_PER_REGION and BLOCKS_PER_CHUNK usize

Having these as usize is more convenient.
This commit is contained in:
Matthias Schiffer 2023-02-12 20:17:20 +01:00
parent b918ff6106
commit 65c39ea153
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
2 changed files with 11 additions and 8 deletions

View file

@ -135,7 +135,8 @@ pub struct OldSection<'a> {
impl<'a> OldSection<'a> {
pub fn new(blocks: &'a fastnbt::ByteArray, data: &'a fastnbt::ByteArray) -> Result<Self> {
const N: usize = BLOCKS_PER_CHUNK as usize;
use BLOCKS_PER_CHUNK as N;
if blocks.len() != N * N * N {
bail!("Invalid section block data");
}