Add Basic Combat

This commit is contained in:
Snowiiii committed 2024-08-14 22:26:27 +02:00
1 parent 03cc991bfd
commit 6459aef027
12 files changed
+222 -32

No files matched your search

+7
View File
@@ -161,6 +161,13 @@ impl Client {
self.send_packet(&CSyncPlayerPostion::new(x, y, z, yaw, pitch, 0, id.into()));
}
pub fn update_health(&mut self, health: f32, food: i32, food_saturation: f32) {
let player = self.player.as_mut().unwrap();
player.health = health;
player.food = food;
player.food_saturation = food_saturation;
}
pub fn set_gamemode(&mut self, gamemode: GameMode) {
let player = self.player.as_mut().unwrap();
player.gamemode = gamemode;