Skip to content
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

Rewrite framed map tracker ticking #9605

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Warriorrrr
Copy link
Member

@Warriorrrr Warriorrrr commented Aug 14, 2023

Rewrites the tracking code for framed maps to remove the use of the tickCarriedBy method and the HoldingPlayer class. the tickCarriedBy method contained a lot of code that did not apply to framed maps at all, and by moving the parts that did elsewhere, we can essentially skip it.

Closes #9597

@Warriorrrr Warriorrrr marked this pull request as ready for review September 6, 2023 06:09
@Warriorrrr Warriorrrr requested a review from a team as a code owner September 6, 2023 06:09
@MrPowerGamerBR
Copy link
Sponsor Contributor

MrPowerGamerBR commented Nov 27, 2023

I've been running this patch on my server for ~1 week+ (after making my own makeshift patch that did only the ItemFrame getItem() optimization, only to find out that someone else already had made the same optimization but better) and I couldn't find any issues, and it also improves performance a bit if the server has a lot of item frames (which is my case for a Survival server) by avoiding calling getItem(). Before the patch, all getItem()calls were using 0.25ms every tick. (not a lot but for big servers every optimization is a big W)

The only thing is that this patch needs to be rebased (again) for the latest version for it to compile, because MapDecoration's getType() is now type(): SparklyPower/SparklyPaper@27b4f21

@MrPowerGamerBR
Copy link
Sponsor Contributor

Outfit8TSB

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting review
Development

Successfully merging this pull request may close these issues.

Optimize MapItemSavedData#tickCarriedBy
3 participants