Package org.mcmonkey.sentinel.utilities
Class VelocityTracker
java.lang.Object
org.mcmonkey.sentinel.utilities.VelocityTracker
Player velocity is not tracked on the server normally. This class helps track it by estimating player motion.
-
Field Summary
Modifier and TypeFieldDescriptionorg.bukkit.Location
The last known location for this player.static Map
<UUID, VelocityTracker> Map of players (by UUID) to their velocity.org.bukkit.util.Vector
The last known velocity for this player. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.util.Vector
getVelocityFor
(org.bukkit.entity.Player player) Get the current velocity for a player.static void
runAll()
Updates the velocity tracker for all players.
-
Field Details
-
playerVelocityEstimates
Map of players (by UUID) to their velocity. Players that log off are removed from this list by SentinelEventHandler#whenAnEnemyDies. -
velocity
public org.bukkit.util.Vector velocityThe last known velocity for this player. -
lastLocation
public org.bukkit.Location lastLocationThe last known location for this player.
-
-
Constructor Details
-
VelocityTracker
public VelocityTracker()
-
-
Method Details
-
getVelocityFor
public static org.bukkit.util.Vector getVelocityFor(org.bukkit.entity.Player player) Get the current velocity for a player. Returns a zero vector for unknown players. -
runAll
public static void runAll()Updates the velocity tracker for all players.
-