Gamepiaynmo / CustomModel

Customize your player model in Minecraft using JSON.
http://cpmmod.top/
33 stars 30 forks source link

Bug fix, or kind of "excelsior"? #14

Closed dragon-evol closed 4 years ago

dragon-evol commented 4 years ago

Fixed the problem of "eye height changes has 1 tick delay" and the problem of sneaking when jumping or creative flying changes the eye height (in vanilla, your eye height changes only when the player is standing on the ground).

Yeah these two problems feels like finding fault with this mod... But no, I just found myself attracted to such a way to customize player model whilst keeping all the vanilla features, so I want this project to be as good as possible, and provide some humble help.

I think the delay is caused by the fact that player status is updated in the "MIDDLE" of a tick, so if the eye height is updated "right before each tick", then when a player sneaks, in the next "tick gap", the status is updated (the model and bounding box are changed), but the eye height is not, so when rendering frames it feels kind of delayed (like the video game has a 50ms lag?) So I changed the trigger phase to END, which fixes the problem.

I guess changing the phase isn't messing other things up? (At least I haven't observed any)

Gamepiaynmo commented 4 years ago

Uh actually I've noticed this bug since when toggle sneaking the view height will change twice. But I haven't realized the reason. Thanks for pointing that out.