Skip to content

Commit c5fdb39

Browse files
committed
Fix: forgot serde_inline_default in config
1 parent ee4db10 commit c5fdb39

5 files changed

Lines changed: 8 additions & 12 deletions

File tree

‎pumpkin-config/src/auth.rs‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,21 @@ use serde_inline_default::serde_inline_default;
44

55
#[serde_inline_default]
66
#[derive(Deserialize, Serialize)]
7+
#[serde(default)]
78
pub struct AuthenticationConfig {
89
/// Whether to use Mojang authentication.
910
#[serde_inline_default(true)]
1011
pub enabled: bool,
11-
12+
#[serde_inline_default("https://sessionserver.mojang.com/session/minecraft/hasJoined?username={username}&serverId={server_hash}".to_string())]
1213
pub auth_url: String,
13-
1414
/// Prevent proxy connections.
1515
#[serde_inline_default(false)]
1616
pub prevent_proxy_connections: bool,
17-
17+
#[serde_inline_default("https://sessionserver.mojang.com/session/minecraft/hasJoined?username={username}&serverId={server_hash}&ip={ip}".to_string())]
1818
pub prevent_proxy_connection_auth_url: String,
19-
2019
/// Player profile handling.
2120
#[serde(default)]
2221
pub player_profile: PlayerProfileConfig,
23-
2422
/// Texture handling.
2523
#[serde(default)]
2624
pub textures: TextureConfig,

‎pumpkin-core/src/math/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ pub fn squared_magnitude(a: f64, b: f64, c: f64) -> f64 {
2222

2323
/// Converts a world coordinate to the corresponding chunk-section coordinate.
2424
// TODO: This proberbly should place not here
25-
pub fn get_section_cord(coord: i32) -> i32 {
25+
pub const fn get_section_cord(coord: i32) -> i32 {
2626
coord >> 4
2727
}

‎pumpkin-core/src/math/vector3.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct Vector3<T> {
1010
}
1111

1212
impl<T: Math + Copy> Vector3<T> {
13-
pub fn new(x: T, y: T, z: T) -> Self {
13+
pub const fn new(x: T, y: T, z: T) -> Self {
1414
Vector3 { x, y, z }
1515
}
1616

‎pumpkin-world/src/chunk/mod.rs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,8 @@ impl ChunkData {
232232
return Err(ChunkParsingError::ChunkNotGenerated);
233233
}
234234

235-
let chunk_data = match fastnbt::from_bytes::<ChunkNbt>(chunk_data.as_slice()) {
236-
Ok(v) => v,
237-
Err(err) => return Err(ChunkParsingError::ErrorDeserializingChunk(err.to_string())),
238-
};
235+
let chunk_data = fastnbt::from_bytes::<ChunkNbt>(chunk_data.as_slice())
236+
.map_err(|e| ChunkParsingError::ErrorDeserializingChunk(e.to_string()))?;
239237

240238
// this needs to be boxed, otherwise it will cause a stack-overflow
241239
let mut blocks = ChunkBlocks::empty_with_heightmap(chunk_data.heightmaps);

‎pumpkin/src/world/player_chunker.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub async fn update_position(entity: &Entity, player: &Player) {
9797
}
9898
}
9999

100-
fn chunk_section_from_pos(block_pos: &WorldPosition) -> Vector3<i32> {
100+
const fn chunk_section_from_pos(block_pos: &WorldPosition) -> Vector3<i32> {
101101
let block_pos = block_pos.0;
102102
Vector3::new(
103103
get_section_cord(block_pos.x),

0 commit comments

Comments
 (0)