public final class Blacklist extends HashMap<org.bukkit.World,Items>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
Blacklist(BanItem pl,
BanDatabase database,
org.bukkit.command.CommandSender sender,
org.bukkit.configuration.ConfigurationSection section)
Constructor for a blacklist map
|
Modifier and Type | Method and Description |
---|---|
void |
addNewBan(org.bukkit.World world,
BannedItem item,
Map<BanAction,BanActionData> map)
This will add a new entry to the blacklist.
|
Map<BanAction,BanActionData> |
getBanActions(org.bukkit.World world,
BannedItem item)
Trying to get the ban actions with their respective ban actions data for this item in the said world.
|
BanActionData |
getBanData(org.bukkit.World world,
BannedItem item,
BanAction action)
Try to get the ban actions data for this item with this action.
|
int |
getTotal() |
boolean |
isBlacklisted(org.bukkit.entity.Player player,
org.bukkit.Location location,
BannedItem item,
boolean sendMessage,
BanAction action,
BanData... data)
Check if the action with the item is blacklisted for the player.
|
boolean |
isBlacklisted(org.bukkit.World world,
BannedItem item,
BanAction action,
BanData... data)
This method is used to check if the item is banned, not involving a player
This method is mainly used to check dispensers dispense and hoppers transfer
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
public Blacklist(@NotNull BanItem pl, @NotNull BanDatabase database, @NotNull org.bukkit.command.CommandSender sender, @Nullable org.bukkit.configuration.ConfigurationSection section)
pl
- the main instancedatabase
- the database instancesender
- CommandSender
to send the debug messages tosection
- ConfigurationSection
which contains the blacklist nodepublic void addNewBan(@NotNull org.bukkit.World world, @NotNull BannedItem item, @NotNull Map<BanAction,BanActionData> map)
world
- bukkit world (World
)item
- banned item (BannedItem
)map
- map containing BanAction
and their respective BanActionData
@Nullable public BanActionData getBanData(@NotNull org.bukkit.World world, @NotNull BannedItem item, @NotNull BanAction action)
world
- bukkit world (World
)item
- banned item (BannedItem
)action
- the ban action (BanAction
)BanActionData
object if the item is banned, or null if there is no banned action for this item with this action in this world@Nullable public Map<BanAction,BanActionData> getBanActions(@NotNull org.bukkit.World world, @NotNull BannedItem item)
world
- bukkit world (World
)item
- banned item (BannedItem
)public boolean isBlacklisted(@NotNull org.bukkit.entity.Player player, @Nullable org.bukkit.Location location, @NotNull BannedItem item, boolean sendMessage, @NotNull BanAction action, @Nullable BanData... data)
player
- player involvedlocation
- the effective location where the action occurs, using player location if nullitem
- the banned itemsendMessage
- send a message to the player if bannedaction
- action to checkdata
- some ban datapublic boolean isBlacklisted(@NotNull org.bukkit.World world, @NotNull BannedItem item, @NotNull BanAction action, @Nullable BanData... data)
world
- bukkit worlditem
- the banned itemaction
- ban actiondata
- optional ban datapublic int getTotal()
Copyright © 2021. All rights reserved.