Class Ban

java.lang.Object
fr.Alphart.BAT.Modules.Ban.Ban
All Implemented Interfaces:
IModule, net.md_5.bungee.api.plugin.Listener

public class Ban extends Object implements IModule, net.md_5.bungee.api.plugin.Listener
  • Constructor Details

    • Ban

      public Ban(BAT plugin)
  • Method Details

    • getCommands

      public List<BATCommand> getCommands()
      Description copied from interface: IModule
      Get commands used by this module
      Specified by:
      getCommands in interface IModule
      Returns:
      list of commands
    • getName

      public String getName()
      Specified by:
      getName in interface IModule
    • getMainCommand

      public String getMainCommand()
      Description copied from interface: IModule
      Get main command name
      Specified by:
      getMainCommand in interface IModule
      Returns:
      name of the main command without a slash
    • getConfig

      public ModuleConfiguration getConfig()
      Description copied from interface: IModule
      Get the configuration section of this module
      Specified by:
      getConfig in interface IModule
      Returns:
      configuration section of this module
    • load

      public boolean load()
      Description copied from interface: IModule
      Load the module
      Specified by:
      load in interface IModule
      Returns:
      true if everything's ok otherwise false
    • unload

      public boolean unload()
      Description copied from interface: IModule
      Unload the module
      Specified by:
      unload in interface IModule
      Returns:
      true if everything's ok otherwise false
    • getBanMessage

      public net.md_5.bungee.api.chat.BaseComponent[] getBanMessage(net.md_5.bungee.api.connection.PendingConnection pConn, String server)
    • isBan

      public boolean isBan(net.md_5.bungee.api.connection.ProxiedPlayer player, String server)
      Check if both ip and name of this player are banned
      Parameters:
      player -
      server -
      Returns:
      true if name or ip is banned
    • isBan

      public boolean isBan(InetAddress inetAddress, String server)
    • isBan

      public boolean isBan(String bannedEntity, String server)
      Check if this entity (player or ip) is banned
      Parameters:
      bannedEntity - | can be an ip or a player name
      server - | if server equals to (any) check if the player is ban on a server
    • ban

      public String ban(String bannedEntity, String server, String staff, long expirationTimestamp, String reason)
      Ban this entity (player or ip)
      Parameters:
      bannedEntity - | can be an ip or a player name
      server - ; set to "(global)", to global ban
      staff -
      expirationTimestamp - ; set to 0 for ban def
      reason - | optional
      Returns:
    • banIP

      public String banIP(net.md_5.bungee.api.connection.ProxiedPlayer player, String server, String staff, long expirationTimestamp, String reason)
      Ban the ip of an online player
      Parameters:
      server - ; set to "(global)", to global ban
      staff -
      expirationTimestamp - ; set to 0 for ban def
      reason - | optional
    • banRedisIP

      public String banRedisIP(UUID pUUID, String server, String staff, long expirationTimestamp, String reason)
    • unBan

      public String unBan(String bannedEntity, String server, String staff, String reason)
      Unban an entity (player or ip)
      Parameters:
      bannedEntity - | can be an ip or a player name
      server - | if equals to (any), unban from all servers | if equals to (global), remove global ban
      staff -
      reason -
    • unBanIP

      public String unBanIP(String entity, String server, String staff, String reason)
      Unban the ip of this entity
      Parameters:
      entity -
      server - | if equals to (any), unban from all servers | if equals to (global), remove global ban
      staff -
      reason - | optional
    • getBanData

      public List<BanEntry> getBanData(String entity)
      Get all ban data of an entity
      Should be runned async to optimize performance
      Parameters:
      entity -
      Returns:
      List of BanEntry of the player
    • getManagedBan

      public List<BanEntry> getManagedBan(String staff)
    • getBans

      public List<BanEntry> getBans(int amount, int startIndex)
      Parameters:
      amount -
      startIndex -
      Returns:
      Return amount ban entries starting from the startIndexth one, sorted by date
    • onServerConnect

      public void onServerConnect(net.md_5.bungee.api.event.ServerConnectEvent e)
    • onPlayerLogin

      public void onPlayerLogin(net.md_5.bungee.api.event.LoginEvent ev)