Skip to content

Conversation

@sero583
Copy link
Contributor

@sero583 sero583 commented Sep 16, 2020

When cancelling the DoorToggleEvent or PlayerInteractEvent, if the player pressed the upper part of the door block it will remain open. Sending an block update to the block below seems to fix this issue.

Q: Is this considered as a hack?
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.

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.

2 participants