GlowstoneMC / Glowstone

A fast, customizable and compatible open source server for Minecraft: Java Edition
https://glowstone.net
Other
1.88k stars 269 forks source link

Fix potion effects display to self #1090

Closed SHADOWDANCH closed 4 years ago

SHADOWDANCH commented 4 years ago

As players now have real entity id for self intead 0 (https://github.com/GlowstoneMC/Glowstone/commit/c1fa66060d1e9c5efafed1fcea6f22fa43f2b355) there is no need for separated packet with entity id 0. Also implement LivingEntity#getPotionEffect(PotionEffectType)

aramperes commented 4 years ago

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

SHADOWDANCH commented 4 years ago

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 https://github.com/GlowstoneMC/Glowstone/commit/c1fa66060d1e9c5efafed1fcea6f22fa43f2b355 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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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).