[SPIGOT-2587] Negative player walkspeeds Created: 11/Aug/16  Updated: 12/Aug/16  Resolved: 11/Aug/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: blablubbabc Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None


 Description   

Somewhere since 1.9 or 1.10 craftbukkit started filtering out attempts to apply negative walkspeeds. In 1.8 and before it was still possible and even supported if one takes a look at the javadocs.
The responsible line of code:
player.abilities.walkSpeed = (Math.max(value, 1.0E-004F) / 2.0F);

This makes sure that the walkspeed is at least 0.0001, filtering out negative walkspeeds as well.

Is there any reason for this? Could this be solved and still allow the previously possible negative speed values?

Negative walkspeed values can be used for changing the players fov ('zooming effect').
Directly setting the walkspeed to negative values via nms seems to work just as before.



 Comments   
Comment by blablubbabc [ 12/Aug/16 ]

Thanks, especially for looking into it so fast.

Comment by md_5 [ 11/Aug/16 ]

This code is not in CraftBukkit.
It has been in Spigot for just over 3 years (Minecraft 1.6). At this time a value of 0 was not healthy for the client. This needs to be reevaluated.

Generated at Fri Mar 21 09:08:04 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.