Skip to content
Open
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
1 change: 1 addition & 0 deletions src/main/java/cn/nukkit/block/BlockDoor.java
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ public boolean toggle(Player player) {
this.getLevel().getServer().getPluginManager().callEvent(event);

if (event.isCancelled()) {
getLevel().sendBlocks(new Player[] {player}, new Block[] {this.down()}); // fixes a client-prediction bug
Copy link
Member

@SupremeMortal SupremeMortal Sep 18, 2020

Choose a reason for hiding this comment

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

If this only affects the upper part of the door, the code should check for that otherwise it's going to update the block below the door when the lower part is pressed.

Copy link
Contributor Author

@sero583 sero583 Sep 21, 2020

Choose a reason for hiding this comment

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

@SupremeMortal I know, anyway this fixes it. Updating only the upper half is leading to nothing. Updating both halfs is just unneeded work, as it seems. So just update the lower half.

return false;
}

Expand Down