CobbleSword / NachoSpigot

NachoSpigot is a fork of TacoSpigot 1.8.9 that offers several enhancements to performance as well as bug fixes.
GNU General Public License v3.0
237 stars 86 forks source link

New hitreg system #338

Closed jandrokt closed 2 years ago

jandrokt commented 2 years ago

Description

Added a new option: "Enable Improved Hit Register" to use my hit register patches. This new hit register system is lag compensated and improves on some details such as player-player vision reach reducing. The changes are mostly based on Hypixel's changes which makes hit register fair for absolutely everyone regardless of the ping. The lag compensator basically stores the locations of the players every x milliseconds so we can retrieve the position of a victim based on the ping of the attacker and "check" if the hit was actually supposed to go through in the attacker's perspective.

How has this been tested?

The changes have been tested on a local server and on a server I own. They work absolutely fine without any issues.

Additional Comments

The lag compensator is a port of the following plugin: https://github.com/Islandscout/ServerSideHitDetection My changes are based on what Hypixel has let its players know through this blog post: https://hypixel.net/threads/dev-blog-2-changes-to-hit-registration-your-feedback.1497403/

Checklist:

jandrokt commented 2 years ago

Just updated it all, thanks for the review! I must say many of those "issues" are because I didn't notice them while porting over the Lag Compensator. I've fixed it all based on your review but there might now be some more issues, since this is my first time with this kind of stuff.

Sculas commented 2 years ago

I'm happy with the current state of this PR. I'll allow some of the others to have their say too, so unless there are no responses till tomorrow, I'll merge it :)

jandrokt commented 2 years ago

Just changed the few things requested, sorry for being a bit late

Sculas commented 2 years ago

Thanks a lot for the PR @notdap and thanks to everyone who helped with this PR! :)