Class PlayerController

java.lang.Object
me.clientastisch.cardinal.controller.PlayerController

public class PlayerController extends Object
Since:
CAC v. 5.4.30
Author:
micartey
  • Constructor Details

    • PlayerController

      public PlayerController()
  • Method Details

    • getVersion

      public Version.Type getVersion()
      Get the version of a player based on its packet protocol id.
      Returns:
      Version enum
    • isFloodgatePlayer

      public boolean isFloodgatePlayer()
      Check if a player is a bedrock player using the floodgate api.
      Returns:
      true if player is on bedrock
    • isWhitelisted

      public boolean isWhitelisted()
      Check if a player is whitelisted / exempt from being detected. Players in creative / spectator are considered whitelisted.
      Returns:
      true if player shall be ignored
    • setWhitelistedForMs

      public void setWhitelistedForMs(long time)
      Whitelist a player for a certain amount of time. If player is already whitelisted, it will not do anything.
      Parameters:
      time - time in millseconds
    • setVerified

      public void setVerified(boolean verify, PlayerController.Verify state)
      Verified players are not checked for many things. Mostly packet based cheats and some other things here and there. This is not being used by the anticheat beside some commands that can be used by staff. So it is your responsibility to incorperate this into your server system if wanted.
      Parameters:
      verify - the state
      state - the type of verification PlayerController.Verify
    • setShowingFlags

      public void setShowingFlags(boolean showingFlags)
      Enable or disable flags / alerts for the current player. Using this method ignores permission.
      Parameters:
      showingFlags - state
    • getSensitivityProcessor

      public SensitivityProcessor getSensitivityProcessor()
      Get the sensitivity processor
      Returns:
      sensitivity processor
    • getMovementProcessor

      public MovementProcessor getMovementProcessor()
      Get the movement processor. It offers some QoL improvements to handle and work with movement.
      Returns:
      movement processor
    • getNetwork

      public PlayerNetwork getNetwork()
      Get the network processor
      Returns:
      network processor
    • of

      public static PlayerController of(Object player)
      Get a PlayerController for a bukkit player outside of events. This method is being used inside of the events as well, but hidden behind abstraction.
      Parameters:
      player - bukkit player
      Returns:
      Reference of PlayerController for player