Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start work on player-data loading (#72); default gamemode #96

Merged
merged 8 commits into from
Aug 31, 2019

Conversation

aramperes
Copy link
Contributor

@aramperes aramperes commented Aug 30, 2019

Start work on loading player NBT data when it exists.

For the moment, it only loads the gamemode and last save pos, so it does not complete the scope of ticket #72. It should however be the groundwork for loading inventory data.

@aramperes
Copy link
Contributor Author

There are no tests yet because I'd like to get some feedback on the NBT-loading/component integration.

@codecov
Copy link

codecov bot commented Aug 30, 2019

Codecov Report

Merging #96 into develop will increase coverage by 0.23%.
The diff coverage is 62.24%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #96      +/-   ##
===========================================
+ Coverage    54.63%   54.87%   +0.23%     
===========================================
  Files           55       56       +1     
  Lines         6962     7050      +88     
===========================================
+ Hits          3804     3869      +65     
- Misses        3158     3181      +23
Impacted Files Coverage Δ
core/src/lib.rs 9.8% <0%> (+9.8%) ⬆️
server/src/config.rs 87.87% <100%> (+0.37%) ⬆️
server/src/player/init.rs 100% <100%> (ø) ⬆️
server/src/joinhandler.rs 31.46% <16.66%> (+1.22%) ⬆️
core/src/save/player_data.rs 80.35% <80.35%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2136a8e...c287b94. Read the comment docs.

server/src/joinhandler.rs Outdated Show resolved Hide resolved
core/src/lib.rs Outdated Show resolved Hide resolved
server/src/player/init.rs Outdated Show resolved Hide resolved
server/src/player/init.rs Show resolved Hide resolved
let spawn_block_pos =
BlockPosition::new(level.spawn_x, level.spawn_y, level.spawn_z);
let pos = positions.get(player).unwrap();
let spawn_block_pos = pos.current.block_pos();

let spawn_position = SpawnPosition::new(spawn_block_pos);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SpawnPosition packet is used to send the world's spawn position, i.e. the location where a compass would point to. This change should be reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. The PlayerPositionAndLookClientbound packet below will need to use different values then.

@caelunshun
Copy link
Member

Thanks!

@caelunshun caelunshun merged commit aeb52dc into feather-rs:develop Aug 31, 2019
@aramperes aramperes deleted the feature/player-data-loading branch August 31, 2019 00:28
@aramperes aramperes mentioned this pull request Aug 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants