Package fr.Alphart.BAT.Modules.Ban
Class Ban
java.lang.Object
fr.Alphart.BAT.Modules.Ban.Ban
- All Implemented Interfaces:
IModule
,net.md_5.bungee.api.plugin.Listener
-
Nested Class Summary
-
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 TypeMethodDescriptionBan this entity (player or ip)banIP
(net.md_5.bungee.api.connection.ProxiedPlayer player, String server, String staff, long expirationTimestamp, String reason) Ban the ip of an online playerbanRedisIP
(UUID pUUID, String server, String staff, long expirationTimestamp, String reason) getBanData
(String entity) Get all ban data of an entity
Should be runned async to optimize performancenet.md_5.bungee.api.chat.BaseComponent[]
getBanMessage
(net.md_5.bungee.api.connection.PendingConnection pConn, String server) getBans
(int amount, int startIndex) Get commands used by this moduleGet the configuration section of this moduleGet main command namegetManagedBan
(String staff) getName()
boolean
Check if this entity (player or ip) is bannedboolean
isBan
(InetAddress inetAddress, String server) boolean
Check if both ip and name of this player are bannedboolean
load()
Load the modulevoid
onPlayerLogin
(net.md_5.bungee.api.event.LoginEvent ev) void
onServerConnect
(net.md_5.bungee.api.event.ServerConnectEvent e) Unban an entity (player or ip)Unban the ip of this entityboolean
unload()
Unload the module
-
Constructor Details
-
Ban
-
-
Method Details
-
getCommands
Description copied from interface:IModule
Get commands used by this module- Specified by:
getCommands
in interfaceIModule
- Returns:
- list of commands
-
getName
-
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 -
load
public boolean load()Description copied from interface:IModule
Load the module -
unload
public boolean unload()Description copied from interface:IModule
Unload the module -
getBanMessage
public net.md_5.bungee.api.chat.BaseComponent[] getBanMessage(net.md_5.bungee.api.connection.PendingConnection pConn, String server) -
isBan
Check if both ip and name of this player are banned- Parameters:
player
-server
-- Returns:
- true if name or ip is banned
-
isBan
-
isBan
Check if this entity (player or ip) is banned- Parameters:
bannedEntity
- | can be an ip or a player nameserver
- | 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 nameserver
- ; set to "(global)", to global banstaff
-expirationTimestamp
- ; set to 0 for ban defreason
- | 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 banstaff
-expirationTimestamp
- ; set to 0 for ban defreason
- | optional
-
banRedisIP
-
unBan
Unban an entity (player or ip)- Parameters:
bannedEntity
- | can be an ip or a player nameserver
- | if equals to (any), unban from all servers | if equals to (global), remove global banstaff
-reason
-
-
unBanIP
Unban the ip of this entity- Parameters:
entity
-server
- | if equals to (any), unban from all servers | if equals to (global), remove global banstaff
-reason
- | optional
-
getBanData
Get all ban data of an entity
Should be runned async to optimize performance- Parameters:
entity
-- Returns:
- List of BanEntry of the player
-
getManagedBan
-
getBans
- 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)
-