public final class BanUtils extends Object
Modifier and Type | Method and Description |
---|---|
void |
checkForUpdate()
Send a message if an update is available
This must be executed async
|
void |
checkPlayerArmors(org.bukkit.entity.Player p)
Used to check a player armor inventory
|
void |
deleteItemFromInventoryView(org.bukkit.entity.Player player)
Method to check and delete banned item from the player opened inventories
|
BanActionData |
getBanActionsForItem(List<org.bukkit.World> worlds,
org.bukkit.configuration.ConfigurationSection itemSection,
String key,
Debug d)
Get ban actions data for a section
|
Map<BanAction,BanActionData> |
getBanActionsFromItemSection(List<org.bukkit.World> worlds,
org.bukkit.configuration.ConfigurationSection section,
Debug d)
Get a map of actions and actions data from a section
|
Map<String,String> |
getCommandsAliases()
Get the sub commands aliases
|
String |
getCooldownString(long time)
Get a friendly string of remaining time
|
Set<UUID> |
getLogging()
This map contains the players who activated the log in game with /banitem log
Players which log mode is activated will receive the logs messages for the banned items, if set in config
|
Map<UUID,Long> |
getMessagesCooldown()
Get the messages cooldown map
|
WearScanner |
getWearScanner()
Get the WearScanner handler
|
boolean |
hasPermission(org.bukkit.entity.Player player,
String itemName,
BanAction action,
BanData... data)
Method to check if the player has the bypass permission for either the item (material name) or custom name
|
void |
sendMessage(org.bukkit.command.CommandSender sender,
String message)
Sending a prefixed and colored (if player) message to sender
|
void |
sendMessage(org.bukkit.entity.Player player,
BanAction action,
List<String> messages)
This method is used to send a ban message to player, if exists.
|
void |
sendMessage(org.bukkit.entity.Player player,
String itemName,
BanAction action,
BanActionData data)
This method is used to send a ban message to player, if exists.
|
@NotNull public Map<BanAction,BanActionData> getBanActionsFromItemSection(@NotNull List<org.bukkit.World> worlds, @Nullable org.bukkit.configuration.ConfigurationSection section, @NotNull Debug d)
worlds
- list of worldssection
- sectiond
- debug@NotNull public BanActionData getBanActionsForItem(@NotNull List<org.bukkit.World> worlds, @NotNull org.bukkit.configuration.ConfigurationSection itemSection, @NotNull String key, @NotNull Debug d)
worlds
- list of worlds, used for regionsitemSection
- the action sectionkey
- the current data keyd
- debugpublic void deleteItemFromInventoryView(@NotNull org.bukkit.entity.Player player)
player
- any playerpublic void sendMessage(@NotNull org.bukkit.entity.Player player, @NotNull String itemName, @NotNull BanAction action, @Nullable BanActionData data)
player
- player involved in the actionitemName
- the item name involvedaction
- the ban action (used for log)data
- the ban data (containing the messages)public void sendMessage(@NotNull org.bukkit.entity.Player player, @NotNull BanAction action, @NotNull List<String> messages)
player
- send the message toaction
- the ban action (used for log)messages
- list of messagespublic boolean hasPermission(@NotNull org.bukkit.entity.Player player, @NotNull String itemName, @NotNull BanAction action, @Nullable BanData... data)
player
- player to checkitemName
- name of the itemaction
- action namedata
- additional data to check@NotNull public String getCooldownString(long time)
time
- time in millispublic void checkPlayerArmors(org.bukkit.entity.Player p)
p
- playerpublic void sendMessage(@NotNull org.bukkit.command.CommandSender sender, @Nullable String message)
sender
- sendermessage
- messagepublic void checkForUpdate()
@NotNull public WearScanner getWearScanner()
@NotNull public Map<String,String> getCommandsAliases()
@NotNull public Map<UUID,Long> getMessagesCooldown()
Copyright © 2021. All rights reserved.