1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-04-01 12:11:45 +02:00

Fix cancelling PlayerInteractEvent at (0, 0, 0) ()

---------

Co-authored-by: Warrior <50800980+warriorrrr@users.noreply.github.com>
This commit is contained in:
Noah van der Aa 2025-03-08 22:52:10 +01:00 committed by GitHub
parent 43f37b1b5e
commit a2b0ff0644
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -167,6 +167,15 @@
if (!blockState.isAir() && f >= 1.0F) {
this.destroyAndAck(pos, sequence, "insta mine");
} else {
@@ -188,7 +_,7 @@
this.lastSentState = i;
}
} else if (action == ServerboundPlayerActionPacket.Action.STOP_DESTROY_BLOCK) {
- if (pos.equals(this.destroyPos)) {
+ if (this.isDestroyingBlock && pos.equals(this.destroyPos)) { // Paper - require isDestroyingBlock to be true (special condition for when destroy pos is 0,0,0 and the event is cancelled)
int i1 = this.gameTicks - this.destroyProgressStart;
BlockState blockStatex = this.level.getBlockState(pos);
if (!blockStatex.isAir()) {
@@ -212,14 +_,22 @@
this.debugLogging(pos, true, sequence, "stopped destroying");
} else if (action == ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK) {