1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

optimize azalea-core positions and remove some unnecessary nightly features

This commit is contained in:
mat 2023-10-26 20:42:10 -05:00
parent 252958bb90
commit ce81ae9cb3
2 changed files with 9 additions and 11 deletions

View file

@ -1,6 +1,4 @@
#![doc = include_str!("../README.md")]
#![feature(int_roundings)]
#![feature(const_for)]
#![feature(lazy_cell)]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]

View file

@ -352,8 +352,8 @@ impl From<&BlockPos> for ChunkPos {
#[inline]
fn from(pos: &BlockPos) -> Self {
ChunkPos {
x: pos.x.div_floor(16),
z: pos.z.div_floor(16),
x: pos.x >> 4,
z: pos.z >> 4,
}
}
}
@ -361,8 +361,8 @@ impl From<BlockPos> for ChunkPos {
#[inline]
fn from(pos: BlockPos) -> Self {
ChunkPos {
x: pos.x.div_floor(16),
z: pos.z.div_floor(16),
x: pos.x >> 4,
z: pos.z >> 4,
}
}
}
@ -398,9 +398,9 @@ impl From<&BlockPos> for ChunkBlockPos {
#[inline]
fn from(pos: &BlockPos) -> Self {
ChunkBlockPos {
x: pos.x.rem_euclid(16) as u8,
x: (pos.x & 0xF) as u8,
y: pos.y,
z: pos.z.rem_euclid(16) as u8,
z: (pos.z & 0xF) as u8,
}
}
}
@ -408,9 +408,9 @@ impl From<BlockPos> for ChunkBlockPos {
#[inline]
fn from(pos: BlockPos) -> Self {
ChunkBlockPos {
x: pos.x.rem_euclid(16) as u8,
x: (pos.x & 0xF) as u8,
y: pos.y,
z: pos.z.rem_euclid(16) as u8,
z: (pos.z & 0xF) as u8,
}
}
}
@ -431,7 +431,7 @@ impl From<&ChunkBlockPos> for ChunkSectionBlockPos {
fn from(pos: &ChunkBlockPos) -> Self {
ChunkSectionBlockPos {
x: pos.x,
y: pos.y.rem_euclid(16) as u8,
y: (pos.y & 0xF) as u8,
z: pos.z,
}
}