Fix: forgot serde_inline_default in config
This commit is contained in:
parent
ee4db10d5e
commit
c5fdb39d6a
@ -4,23 +4,21 @@ use serde_inline_default::serde_inline_default;
|
||||
|
||||
#[serde_inline_default]
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct AuthenticationConfig {
|
||||
/// Whether to use Mojang authentication.
|
||||
#[serde_inline_default(true)]
|
||||
pub enabled: bool,
|
||||
|
||||
#[serde_inline_default("https://sessionserver.mojang.com/session/minecraft/hasJoined?username={username}&serverId={server_hash}".to_string())]
|
||||
pub auth_url: String,
|
||||
|
||||
/// Prevent proxy connections.
|
||||
#[serde_inline_default(false)]
|
||||
pub prevent_proxy_connections: bool,
|
||||
|
||||
#[serde_inline_default("https://sessionserver.mojang.com/session/minecraft/hasJoined?username={username}&serverId={server_hash}&ip={ip}".to_string())]
|
||||
pub prevent_proxy_connection_auth_url: String,
|
||||
|
||||
/// Player profile handling.
|
||||
#[serde(default)]
|
||||
pub player_profile: PlayerProfileConfig,
|
||||
|
||||
/// Texture handling.
|
||||
#[serde(default)]
|
||||
pub textures: TextureConfig,
|
||||
|
||||
@ -22,6 +22,6 @@ pub fn squared_magnitude(a: f64, b: f64, c: f64) -> f64 {
|
||||
|
||||
/// Converts a world coordinate to the corresponding chunk-section coordinate.
|
||||
// TODO: This proberbly should place not here
|
||||
pub fn get_section_cord(coord: i32) -> i32 {
|
||||
pub const fn get_section_cord(coord: i32) -> i32 {
|
||||
coord >> 4
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ pub struct Vector3<T> {
|
||||
}
|
||||
|
||||
impl<T: Math + Copy> Vector3<T> {
|
||||
pub fn new(x: T, y: T, z: T) -> Self {
|
||||
pub const fn new(x: T, y: T, z: T) -> Self {
|
||||
Vector3 { x, y, z }
|
||||
}
|
||||
|
||||
|
||||
@ -232,10 +232,8 @@ impl ChunkData {
|
||||
return Err(ChunkParsingError::ChunkNotGenerated);
|
||||
}
|
||||
|
||||
let chunk_data = match fastnbt::from_bytes::<ChunkNbt>(chunk_data.as_slice()) {
|
||||
Ok(v) => v,
|
||||
Err(err) => return Err(ChunkParsingError::ErrorDeserializingChunk(err.to_string())),
|
||||
};
|
||||
let chunk_data = fastnbt::from_bytes::<ChunkNbt>(chunk_data.as_slice())
|
||||
.map_err(|e| ChunkParsingError::ErrorDeserializingChunk(e.to_string()))?;
|
||||
|
||||
// this needs to be boxed, otherwise it will cause a stack-overflow
|
||||
let mut blocks = ChunkBlocks::empty_with_heightmap(chunk_data.heightmaps);
|
||||
|
||||
@ -97,7 +97,7 @@ pub async fn update_position(entity: &Entity, player: &Player) {
|
||||
}
|
||||
}
|
||||
|
||||
fn chunk_section_from_pos(block_pos: &WorldPosition) -> Vector3<i32> {
|
||||
const fn chunk_section_from_pos(block_pos: &WorldPosition) -> Vector3<i32> {
|
||||
let block_pos = block_pos.0;
|
||||
Vector3::new(
|
||||
get_section_cord(block_pos.x),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user