Skip to content

Fix potion effects display to self #1090

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

Merged
merged 1 commit into from
May 6, 2020
Merged

Fix potion effects display to self #1090

merged 1 commit into from
May 6, 2020

Conversation

SHADOWDANCH
Copy link
Contributor

As players now have real entity id for self intead 0 (c1fa660) there is no need for separated packet with entity id 0. Also implement LivingEntity#getPotionEffect(PotionEffectType)

@aramperes
Copy link
Member

Could you link some documentation that the entity ID changed? Was this done in 1.12 or later versions?

@SHADOWDANCH
Copy link
Contributor Author

SHADOWDANCH commented May 6, 2020

Could you link some documentation that the entity ID changed? Was this done in 1.12 or later versions?

Sorry for my poor english. Entity id not changed in minecraft. Before this commit c1fa660 in glowstone all players have entity id 0 for self at clientside. And after it players at clientside have real entity id like it on original minecraft server. And so after this commit there is no need for sending separated packet with 0 entity id

@aramperes
Copy link
Member

The client expects/expected an ID of 0 to refer to itself. This may have changed, but it would be good to know in which version this changed.

@SHADOWDANCH
Copy link
Contributor Author

The client expects/expected an ID of 0 to refer to itself. This may have changed, but it would be good to know in which version this changed.

I am not sure in what version this changed. But 1.12.2 client not uses 0 id for self. It receives self id from server in SPacketJoinGame

@aramperes
Copy link
Member

I asked on IRC and you are right, it is preferable to use the real entity ID. Historically, ID 0 worked because from the client's perspective, its own character is the first entity in the worls (so 0 index).

@aramperes aramperes merged commit 1b0cea8 into GlowstoneMC:dev May 6, 2020
@SHADOWDANCH SHADOWDANCH deleted the fix_potion_effects branch May 7, 2020 14:37
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