Class AntiBan


  • public class AntiBan
    extends java.lang.Object
    Handles detection and monitoring of staff members in the game world. Loads staff list from server, and can detect nearby staff for AntiBan logic.
    • Constructor Summary

      Constructors 
      Constructor Description
      AntiBan​(KSContext ctx)
      Constructs the AntiBan manager and begins loading the staff list.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String[] getStaff()
      Returns a list of all known staff usernames.
      boolean isStaffMember​(java.lang.String player)
      Checks if the specified player name is in the staff list.
      boolean isStaffMember​(KSPlayer player)
      Checks if the specified KSPlayer is a staff member.
      PlayerQuery nearbyStaff()
      Returns a query of staff members nearby (within 10 tiles).
      PlayerQuery nearbyStaff​(int distance)
      Returns a query of staff members within a specified distance.
      boolean staffNearby()
      Checks if any staff members are nearby (within 10 tiles).
      boolean staffNearby​(int distance)
      Checks if any staff members are within the specified distance.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AntiBan

        public AntiBan​(KSContext ctx)
        Constructs the AntiBan manager and begins loading the staff list.
        Parameters:
        ctx - The context of the current bot session.
    • Method Detail

      • getStaff

        public java.lang.String[] getStaff()
        Returns a list of all known staff usernames.
        Returns:
        Array of staff usernames.
      • nearbyStaff

        public PlayerQuery nearbyStaff()
        Returns a query of staff members nearby (within 10 tiles).
        Returns:
        PlayerQuery containing nearby staff.
      • nearbyStaff

        public PlayerQuery nearbyStaff​(int distance)
        Returns a query of staff members within a specified distance.
        Parameters:
        distance - Distance in tiles to check for staff.
        Returns:
        PlayerQuery containing nearby staff.
      • staffNearby

        public boolean staffNearby()
        Checks if any staff members are nearby (within 10 tiles).
        Returns:
        true if a staff member is within range; false otherwise.
      • staffNearby

        public boolean staffNearby​(int distance)
        Checks if any staff members are within the specified distance.
        Parameters:
        distance - Distance in tiles to check for staff.
        Returns:
        true if a staff member is within range; false otherwise.
      • isStaffMember

        public boolean isStaffMember​(java.lang.String player)
        Checks if the specified player name is in the staff list.
        Parameters:
        player - Player name to check.
        Returns:
        true if the player is a staff member; false otherwise.
      • isStaffMember

        public boolean isStaffMember​(KSPlayer player)
        Checks if the specified KSPlayer is a staff member.
        Parameters:
        player - KSPlayer instance to check.
        Returns:
        true if the player is a staff member; false otherwise.