mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-05 17:44:52 +01:00
world/section: to not use u128 type
Getting the block index for unaligned blocks can be done just fine with only u64.
This commit is contained in:
parent
3ef48783b7
commit
decb5c67a6
1 changed files with 4 additions and 6 deletions
|
@ -119,13 +119,11 @@ impl<'a> SectionV1_13<'a> {
|
||||||
let bit_offset = offset * bits;
|
let bit_offset = offset * bits;
|
||||||
let (word, bit_shift) = div_rem(bit_offset, 64);
|
let (word, bit_shift) = div_rem(bit_offset, 64);
|
||||||
|
|
||||||
if bit_shift + bits <= 64 {
|
let mut tmp = (block_states[word] as u64) >> bit_shift;
|
||||||
block_states[word] as u64 >> bit_shift
|
if bit_shift + bits > 64 {
|
||||||
} else {
|
tmp |= (block_states[word + 1] as u64) << (64 - bit_shift);
|
||||||
let tmp = (block_states[word + 1] as u64 as u128) << 64
|
|
||||||
| block_states[word] as u64 as u128;
|
|
||||||
(tmp >> bit_shift) as u64
|
|
||||||
}
|
}
|
||||||
|
tmp
|
||||||
};
|
};
|
||||||
|
|
||||||
(shifted & mask) as usize
|
(shifted & mask) as usize
|
||||||
|
|
Loading…
Add table
Reference in a new issue