gbl / AntiGhost

Mod that requests the server to send surrounding blocks to you, to get rid of ghost blocks
MIT License
28 stars 16 forks source link

Auto Antighost #11

Closed UltraBlackLinux closed 1 year ago

UltraBlackLinux commented 3 years ago

Please make it so the blocks get auto requested if you get stuck in a block. (Please only once per getting stuck, because you can get stuck by viaversion's buggyness, and you can't exit that via antighost. You will get kicked for packets if not)

Thanks!

gbl commented 3 years ago

The thing is, how do you detect being stuck in a block? Vs, for example, getting pushed by water, animals, or pistons?

UltraBlackLinux commented 3 years ago

@gbl My guess here is, that you want to detect, whenever the player is falling and getting TPd, while there is no block in/under the player's hitbox. Then run antighost once. (Make an exception for fences and walls, since their hitbox is bigger than the block itself) For cases where the server is broken and you get teleported in a block, and you rubberband, this should not work, since there is a block in/under the player's hitbox. (This wouldn't be fixable by antighost, I had such cases and tested it) I hope this is somewhat useful, Thanks!

panoskj commented 2 years ago

I modified your mod to do this for 1.12.2 a few years ago. Too bad I've lost the source code since then, but I remember having to hook the packets received from the server: there was a specific packet whose data would give away that you are stuck. And in this case, you don't need to send packets for all 729 blocks, just those 12 that your player is in.

I had tested it and it worked without any issues, on a LAN server with a few friends, although I wouldn't call this a thorough test.

PS, how to find the packet for this: get stuck in a ghost block and see what packets are sent.

mathgeniuszach commented 2 years ago

Would like to see this implemented. Even some auto-anti-ghosting is better than none at all.