Package fr.andross.banitem.actions
Class BanActionData
java.lang.Object
fr.andross.banitem.actions.BanActionData
This class offers a way to store the ban actions data.
Example: the messages, if the action should be logged, any item...
The data type is written as description in
BanDataType
description.
I've also included some clear api methods to get them, at the bottom.- Version:
- 3.1
- Author:
- Andross
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Trying to check if a data is present in this ban action datas.long
Trying to get a cooldown added for this action<T> T
getData
(BanDataType type) Trying to get the data from this mapTrying to get a set of enchantmentwrapper added for this actionSet<org.bukkit.entity.EntityType>
Trying to get a set of entitytype added for this actionSet<org.bukkit.GameMode>
Trying to get a set of gamemodes added for this actionSet<org.bukkit.event.inventory.InventoryType>
Trying to get a set of inventory-from added for this actionSet<org.bukkit.event.inventory.InventoryType>
Trying to get a set of inventory-to added for this actionboolean
getLog()
Trying to check if the action should be loggedgetMap()
Get the mapSet<org.bukkit.Material>
Trying to get a set of materials added for this actionTrying to get the messages added for this actiongetRun()
Trying to get the commands run for this actionSerializing the data (to save them into config files)This will serialize a collection of object.
-
Constructor Details
-
BanActionData
public BanActionData()
-
-
Method Details
-
getData
Trying to get the data from this map- Type Parameters:
T
- the object of the data, retrievable and described inBanDataType
- Parameters:
type
- the type of data- Returns:
- the data, null if not found or not a valid type
-
contains
Trying to check if a data is present in this ban action datas. This is accepted only for Set datas, described inBanDataType
- Parameters:
data
- the ban data to check- Returns:
- true if the data matches, otherwise false
-
serialize
Serializing the data (to save them into config files)- Returns:
- a non null serialized map
-
serialize
This will serialize a collection of object. Mainly used to parse the maps into a config file- Parameters:
c
- collection of objects- Returns:
- a list of serialized object from the collection
-
getCooldown
public long getCooldown()Trying to get a cooldown added for this action- Returns:
- a cooldown long (millis)
-
getEntities
Trying to get a set of entitytype added for this action- Returns:
- the set of entitytype, null if there is none added
-
getEnchantments
Trying to get a set of enchantmentwrapper added for this action- Returns:
- the set of enchantmentwrapper, null if there is none added
-
getGamemodes
Trying to get a set of gamemodes added for this action- Returns:
- the set of gamemodes, null if there is none added
-
getInventoryFrom
Trying to get a set of inventory-from added for this action- Returns:
- the set of InventoryType, null if there is none added
-
getInventoryTo
Trying to get a set of inventory-to added for this action- Returns:
- the set of InventoryType, null if there is none added
-
getMaterial
Trying to get a set of materials added for this action- Returns:
- the set of material, null if there is none added
-
getLog
public boolean getLog()Trying to check if the action should be logged- Returns:
- true if the action is logged, otherwise false
-
getMessages
Trying to get the messages added for this action- Returns:
- the list of messages, null if there is no messages added
-
getRun
Trying to get the commands run for this action- Returns:
- the list of commands run, null if there is no commands added
-
getCooldowns
- Returns:
- map containing players cooldowns time
-
getMap
Get the map- Returns:
- the map
-