DrexHD / AntiXray

Lightweight fabric mod that allows server owners to combat xrayers
MIT License
36 stars 7 forks source link

Fixes some exploits that can be abused by modified clients. #25

Closed Wesley1808 closed 2 years ago

Wesley1808 commented 2 years ago

Changes

Only send block updates when starting to break a block (should keep intended behavior of updating earlier for those with higher ping). Note: fully breaking a block will still always update the blocks around it.

Prevents an exploit where the client can reveal obfuscated blocks by sending block break packets way outside of the range they can actually break blocks at.

Might obviously still be worth testing with a bit more than 1 player, but I doubt it will change anything for normal players.

Wesley1808 commented 2 years ago

Update: this isn't necessary, vanilla does already check for the distance between said block and the player, but the injection point TAIL (in this case) makes it seem like it would trigger regardless of that check.

It doesn't though, unless mojang adds any code to the end of the method (currently it 'just' works because the compiler adds an immediate return statement if its out of range to optimize it, because there is no code it could execute afterward anyway - or decompilers being decompilers).

I did test this yesterday in which case it worked, but I later figured out that was caused by carpet's antiCheatDisabled rule being enabled 😆