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

Fix wrong flags in MoveEntityAbsolutePacket + set onGround #235

Merged
merged 2 commits into from
May 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Click the link above to see the future.
- [#228] Invalid enchantment order on anvil's results causing the crafting transaction to fail.
- [#226] Anvil cost calculation not applying bedrock edition reductions
- [#222] Anvil changes the level twice and fails the transaction if the player doesn't have enough.
- [#235] Wrong flags in MoveEntityAbsolutePacket

## [1.2.0.0-PN] - 2020-05-03 ([Check the milestone](https://github.com/GameModsBR/PowerNukkit/milestone/6?closed=1))
**Note:** Effort has been made to keep this list accurate but some bufixes and new features might be missing here, specially those made by the NukkitX team and contributors.
Expand Down Expand Up @@ -194,3 +195,4 @@ Click the link above to see the future.
[#224]: https://github.com/GameModsBR/PowerNukkit/pull/224
[#226]: https://github.com/GameModsBR/PowerNukkit/issues/226
[#228]: https://github.com/GameModsBR/PowerNukkit/issues/228
[#235]: https://github.com/GameModsBR/PowerNukkit/issues/235
1 change: 1 addition & 0 deletions src/main/java/cn/nukkit/level/Level.java
Original file line number Diff line number Diff line change
Expand Up @@ -3459,6 +3459,7 @@ public void addEntityMovement(Entity entity, double x, double y, double z, doubl
pk.yaw = (float) yaw;
pk.headYaw = (float) headYaw;
pk.pitch = (float) pitch;
pk.onGround = entity.onGround;

Server.broadcastPacket(entity.getViewers().values(), pk);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public void encode() {
this.reset();
this.putEntityRuntimeId(this.eid);
byte flags = 0;
if (teleport) {
if (onGround) {
flags |= 0x01;
}
if (onGround) {
if (teleport) {
flags |= 0x02;
}
this.putByte(flags);
Expand Down