diff --git a/pumpkin-protocol/src/lib.rs b/pumpkin-protocol/src/lib.rs index 96abdc31..3f7a4b60 100644 --- a/pumpkin-protocol/src/lib.rs +++ b/pumpkin-protocol/src/lib.rs @@ -188,8 +188,8 @@ pub struct StatusResponse { pub version: Version, pub players: Players, pub description: String, - pub favicon: String, // data:image/png;base64, - // Players, favicon ... + pub favicon: Option, // data:image/png;base64, + // Players, favicon ... } #[derive(Serialize)] pub struct Version { diff --git a/pumpkin/src/client/player_packet.rs b/pumpkin/src/client/player_packet.rs index 820d3564..b8a7853d 100644 --- a/pumpkin/src/client/player_packet.rs +++ b/pumpkin/src/client/player_packet.rs @@ -302,7 +302,7 @@ impl Client { if config.hurt_animation { // TODO // thats how we prevent borrow errors :c - let packet = &CHurtAnimation::new(&entity_id, 10.0); + let packet = &CHurtAnimation::new(&entity_id, attacker_player.entity.yaw); self.send_packet(packet); client.send_packet(packet); server.broadcast_packet_expect( diff --git a/pumpkin/src/server.rs b/pumpkin/src/server.rs index db1e4502..38133844 100644 --- a/pumpkin/src/server.rs +++ b/pumpkin/src/server.rs @@ -2,6 +2,7 @@ use std::{ cell::{RefCell, RefMut}, collections::HashMap, io::Cursor, + path::Path, rc::Rc, sync::{ atomic::{AtomicI32, Ordering}, @@ -408,7 +409,12 @@ impl Server { } pub fn build_response(config: &BasicConfiguration) -> StatusResponse { - let path = concat!(env!("CARGO_MANIFEST_DIR"), "/icon.png"); + let icon_path = concat!(env!("CARGO_MANIFEST_DIR"), "/icon.png"); + let icon = if Path::new(icon_path).exists() { + Some(Self::load_icon(icon_path)) + } else { + None + }; StatusResponse { version: Version { @@ -424,7 +430,7 @@ impl Server { }], }, description: config.motd.clone(), - favicon: Self::load_icon(path), + favicon: icon, } }