Class SerializableBukkit

java.lang.Object
me.thehandsomeyoni.persistentdataapi.manager.SerializableBukkit

public class SerializableBukkit extends Object
A class with default methods to store and get serializable Bukkit classes.
Since:
1.9.0
Author:
TheHandsomeYoni
  • Constructor Summary

    Constructors
    Constructor
    Description
    SerializableBukkit(org.bukkit.persistence.PersistentDataContainer container)
    Initializes the class.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.attribute.AttributeModifier
    Gives back the AttributeModifier stored in the given data container with the given key.
    org.bukkit.util.BlockVector
    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
    Gives back the Inventory stored in the given data container with the given key.
    org.bukkit.inventory.ItemStack
    Gives back the ItemStack stored in the given data container with the given key.
    org.bukkit.Location
    Gives back the Location stored in the given data container with the given key.
    org.bukkit.block.banner.Pattern
    Gives back the Pattern stored in the given data container with the given key.
    org.bukkit.potion.PotionEffect
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public void storeItemStack(org.bukkit.inventory.ItemStack itemStack, String key)
      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

      public org.bukkit.inventory.ItemStack getItemStack(String key)
      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

      public void storeInventory(org.bukkit.inventory.Inventory inventory, String key)
      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

      public org.bukkit.inventory.Inventory getInventory(String key)
      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

      public void storeLocation(org.bukkit.Location location, String key)
      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

      public org.bukkit.Location getLocation(String key)
      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

      public void storeVector(org.bukkit.util.Vector vector, String key)
      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

      public org.bukkit.util.Vector getVector(String key)
      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

      public void storePotionEffect(org.bukkit.potion.PotionEffect potionEffect, String key)
      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

      public org.bukkit.potion.PotionEffect getPotionEffect(String key)
      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

      public void storeBlockVector(org.bukkit.util.BlockVector blockVector, String key)
      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

      public org.bukkit.util.BlockVector getBlockVector(String key)
      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

      public void storeColor(org.bukkit.Color color, String key)
      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

      public org.bukkit.Color getColor(String key)
      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

      public void storePattern(org.bukkit.block.banner.Pattern pattern, String key)
      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

      public org.bukkit.block.banner.Pattern getPattern(String key)
      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

      public org.bukkit.attribute.AttributeModifier getAttributeModifier(String key)
      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.