Class Mute

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

public class Mute extends Object implements IModule, net.md_5.bungee.api.plugin.Listener
This module handles all the mute.
The mute data of online players are cached in order to avoid lag.
  • Constructor Details

    • Mute

      public Mute(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
    • 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
    • getName

      public String getName()
      Specified by:
      getName in interface IModule
    • 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
    • loadMuteMessage

      public void loadMuteMessage(String pName, String server)
    • isMute

      public int isMute(net.md_5.bungee.api.connection.ProxiedPlayer player, String server)
      Check if both ip and name of this player are muted
      Use cached data
      Parameters:
      player -
      server -
      Returns:
      • 1 if the player is muted from this server
      • 0 if he's not muted from this server
      • -1 if the data are loading
    • isMute

      public boolean isMute(String mutedEntity, String server, boolean forceUseUncachedData)
      Check if this entity (player or ip) is muted
      Use uncached data. Use isMute(ProxiedPlayer, String) instead of this method if the player is available
      Parameters:
      mutedEntity - | can be an ip or a player name
      server - | if server equals to (any) check if the player is mute on a server
      forceUseUncachedData - | use uncached data, for example to handle player or player's ip related mute
      Returns:
    • mute

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

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

      public String unMute(String mutedEntity, String server, String staff, String reason)
      Unmute an entity (player or ip)
      Parameters:
      mutedEntity - | can be an ip or a player name
      server - | if equals to (any), unmute from all servers | if equals to (global), remove global mute
      staff -
      reason -
    • unMuteIP

      public String unMuteIP(String entity, String server, String staff, String reason)
      Unmute the ip of this entity
      Parameters:
      entity -
      server - | if equals to (any), unmute from all servers | if equals to (global), remove global mute
      staff -
      reason - | optional
    • getMuteData

      public List<MuteEntry> getMuteData(String entity)
      Get all mute data of an entity
      Should be run async to optimize performance
      Parameters:
      entity - | can be an ip or a player name
      Returns:
      List of MuteEntry of the entity
    • updateMuteData

      public void updateMuteData(String pName)
    • getManagedMute

      public List<MuteEntry> getManagedMute(String staff)
    • unloadMuteData

      public void unloadMuteData(net.md_5.bungee.api.connection.ProxiedPlayer player)
    • onServerConnect

      public void onServerConnect(net.md_5.bungee.api.event.ServerConnectedEvent e)
    • onPlayerDisconnect

      public void onPlayerDisconnect(net.md_5.bungee.api.event.PlayerDisconnectEvent e)
    • onPlayerChat

      public void onPlayerChat(net.md_5.bungee.api.event.ChatEvent e)