Class SerializableBukkit
java.lang.Object
me.thehandsomeyoni.persistentdataapi.manager.SerializableBukkit
A class with default methods to store and get serializable Bukkit classes.
- Since:
- 1.9.0
- Author:
- TheHandsomeYoni
-
Constructor Summary
ConstructorsConstructorDescriptionSerializableBukkit
(org.bukkit.persistence.PersistentDataContainer container) Initializes the class. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.attribute.AttributeModifier
Gives back the AttributeModifier stored in the given data container with the given key.org.bukkit.util.BlockVector
getBlockVector
(String key) Gives back the BlockVector stored in the given data container with the given key.org.bukkit.Color
Gives back the Color stored in the given data container with the given key.org.bukkit.inventory.Inventory
getInventory
(String key) Gives back the Inventory stored in the given data container with the given key.org.bukkit.inventory.ItemStack
getItemStack
(String key) Gives back the ItemStack stored in the given data container with the given key.org.bukkit.Location
getLocation
(String key) Gives back the Location stored in the given data container with the given key.org.bukkit.block.banner.Pattern
getPattern
(String key) Gives back the Pattern stored in the given data container with the given key.org.bukkit.potion.PotionEffect
getPotionEffect
(String key) Gives back the PotionEffect stored in the given data container with the given key.org.bukkit.util.Vector
Gives back the Vector stored in the given data container with the given key.void
storeAttributeModifier
(org.bukkit.attribute.AttributeModifier attributeModifier, String key) Stores an AttributeModifier in the given data container with the given key.void
storeBlockVector
(org.bukkit.util.BlockVector blockVector, String key) Stores a BlockVector in the given data container with the given key.void
storeColor
(org.bukkit.Color color, String key) Stores a Color in the given data container with the given key.void
storeInventory
(org.bukkit.inventory.Inventory inventory, String key) Stores an Inventory in the given data container with the given key.void
storeItemStack
(org.bukkit.inventory.ItemStack itemStack, String key) Stores an ItemStack in the given data container with the given key.void
storeLocation
(org.bukkit.Location location, String key) Stores a Location in the given data container with the given key.void
storePattern
(org.bukkit.block.banner.Pattern pattern, String key) Stores a Pattern in the given data container with the given key.void
storePotionEffect
(org.bukkit.potion.PotionEffect potionEffect, String key) Stores a PotionEffect in the given data container with the given key.void
storeVector
(org.bukkit.util.Vector vector, String key) Stores a Vector in the given data container with the given key.
-
Constructor Details
-
SerializableBukkit
public SerializableBukkit(org.bukkit.persistence.PersistentDataContainer container) Initializes the class.- Parameters:
container
- The persistent data container that will be affected.
-
-
Method Details
-
storeItemStack
Stores an ItemStack in the given data container with the given key.- Parameters:
itemStack
- The ItemStack to be stored.key
- The key of the data.
-
getItemStack
Gives back the ItemStack stored in the given data container with the given key. If the key is not found, it returns null.- Parameters:
key
- The key of the data.- Returns:
- The ItemStack stored in the given data container with the given key.
-
storeInventory
Stores an Inventory in the given data container with the given key.- Parameters:
inventory
- The Inventory to store.key
- The key of the data.
-
getInventory
Gives back the Inventory stored in the given data container with the given key. If the key is not found, it returns null.- Parameters:
key
- The key of the data.- Returns:
- The Inventory stored in the given data container with the given key.
-
storeLocation
Stores a Location in the given data container with the given key.- Parameters:
location
- The Location to store.key
- The key of the data.
-
getLocation
Gives back the Location stored in the given data container with the given key.- Parameters:
key
- The key of the data.- Returns:
- The Location stored in the given data container with the given key.
-
storeVector
Stores a Vector in the given data container with the given key.- Parameters:
vector
- The Vector to store.key
- The key of the data.
-
getVector
Gives back the Vector stored in the given data container with the given key.- Parameters:
key
- The key of the data.- Returns:
- The Vector stored in the given data container with the given key.
-
storePotionEffect
Stores a PotionEffect in the given data container with the given key.- Parameters:
potionEffect
- The PotionEffect to store.key
- The key of the data.
-
getPotionEffect
Gives back the PotionEffect stored in the given data container with the given key.- Parameters:
key
- The key of the data.- Returns:
- The PotionEffect stored in the given data container with the given key.
-
storeBlockVector
Stores a BlockVector in the given data container with the given key.- Parameters:
blockVector
- The BlockVector to store.key
- The key of the data.
-
getBlockVector
Gives back the BlockVector stored in the given data container with the given key.- Parameters:
key
- The key of the data.- Returns:
- The BlockVector stored in the given data container with the given key.
-
storeColor
Stores a Color in the given data container with the given key.- Parameters:
color
- The Color to store.key
- The key of the data.
-
getColor
Gives back the Color stored in the given data container with the given key.- Parameters:
key
- The key of the data.- Returns:
- The Color stored in the given data container with the given key.
-
storePattern
Stores a Pattern in the given data container with the given key.- Parameters:
pattern
- The Pattern to store.key
- The key of the data.
-
getPattern
Gives back the Pattern stored in the given data container with the given key.- Parameters:
key
- The key of the data.- Returns:
- The Pattern stored in the given data container with the given key.
-
storeAttributeModifier
public void storeAttributeModifier(org.bukkit.attribute.AttributeModifier attributeModifier, String key) Stores an AttributeModifier in the given data container with the given key.- Parameters:
attributeModifier
- The AttributeModifier to store.key
- The key of the data.
-
getAttributeModifier
Gives back the AttributeModifier stored in the given data container with the given key.- Parameters:
key
- The key of the data.- Returns:
- The AttributeModifier stored in the given data container with the given key.
-