Skip to content

Commit

Permalink
resolve syntax errors reported by cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
guffelman committed Jan 26, 2025
1 parent 2162e66 commit 18af548
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pumpkin/src/entity/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ impl Abilities {
pub fn set_for_gamemode(&mut self, gamemode: GameMode) {
match gamemode {
GameMode::Creative => {
self.flying = false; // Start not flying
self.flying = false; // Start not flying
self.allow_flying = true;
self.creative = true;
self.invulnerable = true;
Expand Down
18 changes: 10 additions & 8 deletions pumpkin/src/net/packet/play.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ use pumpkin_protocol::codec::var_int::VarInt;
use pumpkin_protocol::server::play::SCookieResponse as SPCookieResponse;
use pumpkin_protocol::{
client::play::{
Animation, CAcknowledgeBlockChange, CCommandSuggestions, CEntityAnimation, CHeadRot, CPingResponse,
CPlayerChatMessage, CUpdateEntityPos, CUpdateEntityPosRot, CUpdateEntityRot, FilterType,
Animation, CAcknowledgeBlockChange, CCommandSuggestions, CEntityAnimation, CHeadRot,
CPingResponse, CPlayerChatMessage, CUpdateEntityPos, CUpdateEntityPosRot, CUpdateEntityRot,
FilterType,
},
server::play::{
Action, ActionType, SChatCommand, SChatMessage, SClientCommand, SClientInformationPlay,
SConfirmTeleport, SInteract, SPickItemFromBlock, SPickItemFromEntity, SPlayPingRequest,
SPlayerAbilities, SPlayerAction, SPlayerCommand, SPlayerPosition, SPlayerPositionRotation,
SPlayerRotation, SSetCreativeSlot, SSetHeldItem, SSwingArm, SUseItem, SUseItemOn, Status,
SSetPlayerGround, SKeepAlive, SCloseContainer, SCommandSuggestion,
SCloseContainer, SCommandSuggestion, SConfirmTeleport, SInteract, SKeepAlive,
SPickItemFromBlock, SPickItemFromEntity, SPlayPingRequest, SPlayerAbilities, SPlayerAction,
SPlayerCommand, SPlayerPosition, SPlayerPositionRotation, SPlayerRotation, SSetCreativeSlot,
SSetHeldItem, SSetPlayerGround, SSwingArm, SUseItem, SUseItemOn, Status,
},
};
use pumpkin_util::math::position::BlockPos;
Expand Down Expand Up @@ -649,12 +650,13 @@ impl Player {

pub async fn handle_client_status(self: &Arc<Self>, client_status: SClientCommand) {
match client_status.action_id.0 {
0 => { // Perform Respawn
0 => {
// Perform Respawn
if self.living_entity.health.load() > 0.0 {
return;
}
self.world().respawn_player(&self.clone(), false).await;

// Restore abilities based on gamemode after respawn
let mut abilities = self.abilities.lock().await;
abilities.set_for_gamemode(self.gamemode.load());
Expand Down

0 comments on commit 18af548

Please sign in to comment.