-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve cancelling PreCreatureSpawnEvent with per player mob spawns #9400
Improve cancelling PreCreatureSpawnEvent with per player mob spawns #9400
Conversation
Thank you, for this fast fix. I hope this gets merged soon. |
This comment was marked as spam.
This comment was marked as spam.
42efe70
to
1b22d9a
Compare
Any updates on this? Isn't it fine to merge already? |
Please do not let this die in pull request queue. |
Fixes also #5076 |
Can you provide a snapshot build with this patch and without the test plugin to run a smoother server until this gets merged? @Machine-Maker |
That was fast! Will the action to build the paperclip.jar get started automatically? |
Huh, it should've automatically started when I added the label. |
1b22d9a
to
c15bf12
Compare
c15bf12
to
135c45f
Compare
135c45f
to
37d7fd7
Compare
Re-implementation of #5460
Fixes #9393
Tracks an additional count of mobs per category for each category. The number is incremented on an aborted or cancelled PreCreatureSpawnEvent. That number is added to the true mob count per player when the game requests the mob count for a player. This "backoff number" is then decremented by 1 each tick for each player for each mob category.
A rudimentary test I did involved a plain server with 1 player not moving for 60 seconds. With the PreCreatureSpawnEvent set to be cancelled and aborted WITHOUT these changes, it fired ~48000 times during that time period. With the changes, it fired ~5000 times over the same time period. I included the test plugin I used to do this in the PR. Will be removed before merging.
The algorithm used to decrease the "backoff number" is linear and simple now, unclear if it should be customizable further, or default to a non-linear implementation.
Download the paperclip jar for this pull request: paper-9400.zip