Fixed glider not closing on right click anymore on servers #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: This PR25 broke right click beeing able to close the hang glider, but only on dedicated servers.
I'm not a 100% confident in the cause of this, as I do not fully understand what is and is not synced between logical client and logical server and how this differs in the case of a SP world vs a dedicated server.
I believe this happens because
readSpawnData
is only run on the client and this is the only place we add theEntityHangGlider
-instance to the map after PR25. I do not know, why this would only affect dedicated servers.This change adds a
gliderMap.put(...)
to the server side to fix this issue.Another issue then appears (only in SP): The glider floats way above the player, this seems to be usually fixed by the call to
glider.fixPositions
inupdateGliders
. But here the check depends on the type of EntityPlayer object. This might have also been broken by PR25. But as the wholeupdateGliders
is@SideOnly(Side.CLIENT)
it seems sensible to always hand overlocalPlayer=true
in theglider.fixPositions
call here and this change indeed fixes the issue.I tested these changes in SP and on a dedicated server and everything remarked here and in PR25 now works as it should. Maybe someone with more indepth knowledge of the server/client side system of minecraft can explain what I could not here.