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

Entity link cache fixes #2068

Merged
merged 1 commit into from
Mar 24, 2021
Merged

Conversation

Camotoy
Copy link
Member

@Camotoy Camotoy commented Mar 23, 2021

Note that this needs to be revisited to see if it's even needed, or perhaps some sort of Guava cache.

  • getCachedPlayerEntityLink now removes the entry if found
  • Skulls will not have player entity links so we shouldn't bother checking
  • Clear the entity link cache on dimension switch

Note that this needs to be revisited to see if it's even needed, or perhaps some sort of Guava cache.

- `getCachedPlayerEntityLink` now removes the entry if found
- Skulls will not have player entity links so we shouldn't bother checking
- Clear the entity link cache on dimension switch
Comment on lines +50 to +54
Entity entity;
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
entity = session.getPlayerEntity();
} else {
entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never liked doing this but does make sense in this case.

@Camotoy Camotoy merged commit 7f03446 into GeyserMC:master Mar 24, 2021
@Camotoy Camotoy deleted the cachedplayerentitylink branch March 24, 2021 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants