Skip to content

Fix ABORT_DESTROY_BLOCK missing 1.7.6-1.7.10->1.8#152

Merged
RaphiMC merged 1 commit intoViaVersion:mainfrom
h4zukkki:main
Mar 31, 2026
Merged

Fix ABORT_DESTROY_BLOCK missing 1.7.6-1.7.10->1.8#152
RaphiMC merged 1 commit intoViaVersion:mainfrom
h4zukkki:main

Conversation

@h4zukkki
Copy link
Copy Markdown
Contributor

When I'm randomly testing ViaFabricPlus from 26.1 to 1.7.6-1.7.10, I found this problem when I'm trying to abort breaking (Triggering GrimAC PositionBreakB), then I looked into differences between 1.7.10-1.8.9, I found this:

In 1.8.9, C07PacketPlayerDigging:

public void writePacketData(PacketBuffer buf) throws IOException {
    buf.writeEnumValue(this.status);
    buf.writeBlockPos(this.position);
    buf.writeByte(this.facing.getIndex());
}

It write the index of the facing, when sending action abort breaking, 1.8.9 send EnumFacing.DOWN, which index is 0.

In 1.7.0, C07PacketPlayerDigging:

public void writePacketData(PacketBuffer buf) throws IOException {
    buf.writeByte(this.action);
    buf.writeInt(this.x);
    buf.writeByte(this.y);
    buf.writeInt(this.z);
    buf.writeByte(this.facing); 
}

It write the byte facing, which is -1 in PlayerControllerMP.resetBlockRemoving:

public void resetBlockRemoving() {
    if (this.isHittingBlock) {
         this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, -1));
    }

    this.isHittingBlock = false;
    this.curBlockDamageMP = 0.0F;
    this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.getEntityId(), this.currentBlockX, this.currentBlockY, this.currentblockZ, -1);
}

Works after test, no longer triggering anti cheat.

@RaphiMC
Copy link
Copy Markdown
Member

RaphiMC commented Mar 31, 2026

Thank you

@RaphiMC RaphiMC merged commit 302f3bd into ViaVersion:main Mar 31, 2026
1 check passed
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