EvModder / DropHeads

A highly configurable head collecting plugin for Minecraft
GNU Lesser General Public License v3.0
36 stars 29 forks source link

the plugin is using too much of the server #90

Closed thiagogebrimm closed 1 year ago

thiagogebrimm commented 1 year ago

image

EvModder commented 1 year ago

Oh wow yeah that is not good, although I'm surprised WebUtils is getting called that often (it should only get called for player-owned heads, and even then it is supposed to be cached). I'll take it look into it right now; in the meantime, do you have any inside info on potential server activities? (If it is a lot of decoration heads, or players placing 1000s of unique heads, or something, maybe knowing what sort of player behavior causes it can help me debug it)

EvModder commented 1 year ago

One thing I would recommend (if you don't have it already) is to set update-on-skin-change: false, because then the caching is much easier on the server (there's also head-click-enable-profile-requests: false but I think you already have that).

I also just noticed a way I can optimize the code to get the GameProfile from an online player instead of calling WebUtils for it, but it won't help for heads of offline players.

EvModder commented 1 year ago

I created https://github.com/EvModder/DropHeads/raw/master/DropHeads_v3.7.10.jar for testing (includes some optimizations for GameProfile), I haven't tried running it yet but if you want you can also give it a try and let me know if it helps

thiagogebrimm commented 1 year ago

ok, I'll test and anything I'll pass on to you

EvModder commented 1 year ago

Any noticeable difference in the lag (caused by placing heads)?

If it's still taking too long with the web lookups, I can change it from synchronous -> asynchronous with a callback, but the side effect is heads might appear as "steve" briefly when placed or dropped (for the first time), and I'll have to include code to make sure issues don't arise (e.g., with someone immediately mining a head block or picking up a head item before the profile has a chance to load).

thiagogebrimm commented 1 year ago

This update solved the problem here

EvModder commented 1 year ago

Awesome, glad to hear that. Feel free to reopen this bug (or create a new one) if any other part of DH is slow due to WebUtils, and I will try that other (more messy/advanced) optimization I mentioned.

EvModder commented 11 months ago

@thiagogebrimm I found a big part of the reason for this issue, which I originally missed, specifically for custom mob heads.

It should be been fixed now (v3.9.0+)

If you want, you can remove the click-rate-limit, disable async-lookup-requests, and any of the other "fixes" I made before, since this update fixes the underlying issue (the cache lookup was failing for mob heads, so it did a Mojang API web request every time previously)