Skip to content

Commit

Permalink
Support Transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowiiii committed Aug 25, 2024
1 parent 80477f9 commit 0ce03c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion pumpkin-protocol/src/server/play/s_set_creative_slot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use pumpkin_macros::packet;
use crate::slot::Slot;

#[derive(serde::Deserialize, Debug)]
#[allow(dead_code)]
#[packet(0x32)]
pub struct SSetCreativeSlot {
pub slot: i16,
Expand Down
4 changes: 2 additions & 2 deletions pumpkin/src/client/client_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Client {
dbg!("handshake");
self.protocol_version = handshake.protocol_version.0;
self.connection_state = handshake.next_state;
if self.connection_state == ConnectionState::Login {
if self.connection_state != ConnectionState::Status {
let protocol = self.protocol_version;
match protocol.cmp(&(CURRENT_MC_PROTOCOL as i32)) {
std::cmp::Ordering::Less => {
Expand Down Expand Up @@ -65,7 +65,7 @@ impl Client {
}

pub fn handle_login_start(&mut self, server: &mut Server, login_start: SLoginStart) {
dbg!("login start");
log::debug!("login start, State {:?}", self.connection_state);

if !Self::is_valid_player_name(&login_start.name) {
self.kick("Invalid characters in username");
Expand Down
4 changes: 3 additions & 1 deletion pumpkin/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ impl Client {
packet.id.0
),
},
pumpkin_protocol::ConnectionState::Login => match packet.id.0 {
// TODO: Check config if transfer is enabled
pumpkin_protocol::ConnectionState::Login
| pumpkin_protocol::ConnectionState::Transfer => match packet.id.0 {
SLoginStart::PACKET_ID => {
self.handle_login_start(server, SLoginStart::read(bytebuf).unwrap())
}
Expand Down

0 comments on commit 0ce03c0

Please sign in to comment.