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

Fix experience orbs spawning at 32x coordinates clientside #1226

Merged
merged 1 commit into from Jul 14, 2014
Merged

Fix experience orbs spawning at 32x coordinates clientside #1226

merged 1 commit into from Jul 14, 2014

Conversation

williewillus
Copy link
Contributor

Since Minecraft 1.5, the NetClientHandler / NetClientPlayHandler has been handling experience orb packets incorrectly. While the packet is constructed on the server side with the coordinates multiplied by 32 like the other entity packets, it is NOT divided by 32 when processed on the clientside, unlike other entity packets.

As a result, all experience orbs (and custom subclasses!) will spawn at 32x their serverside coordinates on the client side and will thus be invisible for a second or two until the server sends another wave of absolute teleport packets to update their positions.

This patch divides the coordinates of the clientside constructed XP orb by 32, allowing them to appear immediately after spawning again. This restores the intended behavior, which was last shown in Minecraft 1.4.7.

This vanilla issue is tracked at https://bugs.mojang.com/browse/MC-12013 but has been largely forgotten by Mojang and will probably never be noticed nor fixed.

To test: Simply throw a bottle o' enchanting and observe how the orbs appear immediately and fly outward, whereas without the patch they appear with a delay.

@LexManos
Copy link
Member

This is a properly researched PR with full explanation and testing. My god!
There is only ONE issue.
When we fix bugs like this we typically like to have a comment explaining what we do and why:
//FORGE: BugFix MC-12013 Wrong orb spawn position

@williewillus
Copy link
Contributor Author

Clarifying comment added.

@williewillus
Copy link
Contributor Author

Squashed commits

@LexManos
Copy link
Member

The patch is broken, you you added the comment to the 'clean' source so it thinks its suposed to be there instead of adding it.

Squashed commits:

[52c40bc] Fix experience orbs spawning at 32x coordinates clientside

Add // FORGE comment

Add // FORGE comment to clarify the purpose of the change
@williewillus
Copy link
Contributor Author

Derp, sorry about that!
Fixed and squashed.

@LexManos
Copy link
Member

And now your commit message is 'Fix comment derp' You're bad at this :P

LexManos added a commit that referenced this pull request Jul 14, 2014
Fix experience orbs spawning at 32x coordinates clientside
@LexManos LexManos merged commit e2fe13b into MinecraftForge:master Jul 14, 2014
@williewillus
Copy link
Contributor Author

I am, just learning :p

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.

None yet

2 participants