Class VelocityTracker

java.lang.Object
org.mcmonkey.sentinel.utilities.VelocityTracker

public class VelocityTracker extends Object
Player velocity is not tracked on the server normally. This class helps track it by estimating player motion.
  • Field Details

    • playerVelocityEstimates

      public static Map<UUID,VelocityTracker> 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 velocity
      The last known velocity for this player.
    • lastLocation

      public org.bukkit.Location lastLocation
      The 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.