Package fr.Alphart.BAT.Modules.Mute
Class Mute
java.lang.Object
fr.Alphart.BAT.Modules.Mute.Mute
- All Implemented Interfaces:
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.
The mute data of online players are cached in order to avoid lag.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
static class
This class is used to cache the mute data of a player. -
Field Summary
Fields inherited from interface fr.Alphart.BAT.Modules.IModule
ANY_SERVER, GLOBAL_SERVER, NO_REASON, OFF_STATE, ON_STATE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet commands used by this moduleGet the configuration section of this moduleGet main command namegetManagedMute
(String staff) getMuteData
(String entity) Get all mute data of an entity
Should be run async to optimize performancegetName()
boolean
Check if this entity (player or ip) is muted
Use uncached data.int
Check if both ip and name of this player are muted
Use cached databoolean
load()
Load the modulevoid
loadMuteMessage
(String pName, String server) Mute this entity (player or ip)muteIP
(net.md_5.bungee.api.connection.ProxiedPlayer player, String server, String staff, long expirationTimestamp, String reason) Mute the ip of an online playervoid
onPlayerChat
(net.md_5.bungee.api.event.ChatEvent e) void
onPlayerDisconnect
(net.md_5.bungee.api.event.PlayerDisconnectEvent e) void
onServerConnect
(net.md_5.bungee.api.event.ServerConnectedEvent e) boolean
unload()
Unload the modulevoid
unloadMuteData
(net.md_5.bungee.api.connection.ProxiedPlayer player) Unmute an entity (player or ip)Unmute the ip of this entityvoid
updateMuteData
(String pName)
-
Constructor Details
-
Mute
-
-
Method Details
-
getCommands
Description copied from interface:IModule
Get commands used by this module- Specified by:
getCommands
in interfaceIModule
- Returns:
- list of commands
-
getMainCommand
Description copied from interface:IModule
Get main command name- Specified by:
getMainCommand
in interfaceIModule
- Returns:
- name of the main command without a slash
-
getConfig
Description copied from interface:IModule
Get the configuration section of this module -
getName
-
load
public boolean load()Description copied from interface:IModule
Load the module -
unload
public boolean unload()Description copied from interface:IModule
Unload the module -
loadMuteMessage
-
isMute
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
Check if this entity (player or ip) is muted
Use uncached data. UseisMute(ProxiedPlayer, String)
instead of this method if the player is available- Parameters:
mutedEntity
- | can be an ip or a player nameserver
- | if server equals to (any) check if the player is mute on a serverforceUseUncachedData
- | 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 nameserver
- ; set to "(global)", to global mutestaff
-expirationTimestamp
- ; set to 0 for mute defreason
- | 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 mutestaff
-expirationTimestamp
- ; set to 0 for mute defreason
- | optional
-
unMute
Unmute an entity (player or ip)- Parameters:
mutedEntity
- | can be an ip or a player nameserver
- | if equals to (any), unmute from all servers | if equals to (global), remove global mutestaff
-reason
-
-
unMuteIP
Unmute the ip of this entity- Parameters:
entity
-server
- | if equals to (any), unmute from all servers | if equals to (global), remove global mutestaff
-reason
- | optional
-
getMuteData
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
-
getManagedMute
-
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)
-