Class BlockInfoStorage

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
de.minebench.blockinfostorage.BlockInfoStorage
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.event.Listener, org.bukkit.plugin.Plugin

public class BlockInfoStorage
extends org.bukkit.plugin.java.JavaPlugin
implements org.bukkit.event.Listener
  • Constructor Summary

    Constructors
    Constructor Description
    BlockInfoStorage()  
  • Method Summary

    Modifier and Type Method Description
    static BlockInfoStorage get()
    Get the storage instance
    org.bukkit.configuration.ConfigurationSection getBlockInfo​(org.bukkit.block.Block block, String type)
    Get information from a block.
    org.bukkit.configuration.ConfigurationSection getBlockInfo​(org.bukkit.block.Block block, org.bukkit.plugin.Plugin plugin)
    Get information from a block.
    org.bukkit.configuration.ConfigurationSection getBlockInfo​(org.bukkit.Location location, String type)
    Get information from a block.
    org.bukkit.configuration.ConfigurationSection getBlockInfo​(org.bukkit.Location location, org.bukkit.plugin.Plugin plugin)
    Get information from a block.
    Object getBlockInfoValue​(org.bukkit.block.Block block, org.bukkit.NamespacedKey key)
    Get information from a block.
    Object getBlockInfoValue​(org.bukkit.Location location, org.bukkit.NamespacedKey key)
    Get information from a block.
    void onDisable()  
    void onEnable()  
    void removeBlockInfo​(org.bukkit.block.Block block)
    Remove all block info (TODO: Decide whether or not this is too dangerous to expose)
    void removeBlockInfo​(org.bukkit.block.Block block, String type)
    Remove block info
    void removeBlockInfo​(org.bukkit.block.Block block, org.bukkit.NamespacedKey key)
    Remove block info
    void removeBlockInfo​(org.bukkit.block.Block block, org.bukkit.plugin.Plugin plugin)
    Remove block info
    void removeBlockInfo​(org.bukkit.Location location)
    Remove all block info (TODO: Decide whether or not this is too dangerous to expose)
    void removeBlockInfo​(org.bukkit.Location location, String type)
    Remove block info
    void removeBlockInfo​(org.bukkit.Location location, org.bukkit.NamespacedKey key)
    Remove block info
    void removeBlockInfo​(org.bukkit.Location location, org.bukkit.plugin.Plugin plugin)
    Remove block info
    void setBlockInfo​(org.bukkit.block.Block block, org.bukkit.NamespacedKey key, Object value)
    Set block info
    void setBlockInfo​(org.bukkit.Location location, org.bukkit.NamespacedKey key, Object value)
    Set block info

    Methods inherited from class org.bukkit.plugin.java.JavaPlugin

    getClassLoader, getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onLoad, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString

    Methods inherited from class org.bukkit.plugin.PluginBase

    equals, getName, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BlockInfoStorage

      public BlockInfoStorage()
  • Method Details

    • onEnable

      public void onEnable()
      Specified by:
      onEnable in interface org.bukkit.plugin.Plugin
      Overrides:
      onEnable in class org.bukkit.plugin.java.JavaPlugin
    • onDisable

      public void onDisable()
      Specified by:
      onDisable in interface org.bukkit.plugin.Plugin
      Overrides:
      onDisable in class org.bukkit.plugin.java.JavaPlugin
    • get

      public static BlockInfoStorage get()
      Get the storage instance
      Returns:
      The storage instance
    • setBlockInfo

      public void setBlockInfo​(org.bukkit.block.Block block, org.bukkit.NamespacedKey key, Object value)
      Set block info
      Parameters:
      block - The block to attach the info to
      key - The key to set
      value - The value to set
    • setBlockInfo

      public void setBlockInfo​(org.bukkit.Location location, org.bukkit.NamespacedKey key, Object value)
      Set block info
      Parameters:
      location - The location of the block to attach the info to
      key - The key to set
      value - The value to set
    • getBlockInfo

      public org.bukkit.configuration.ConfigurationSection getBlockInfo​(org.bukkit.block.Block block, org.bukkit.plugin.Plugin plugin)
      Get information from a block. This is only for reading, use setBlockInfo(Block, NamespacedKey, Object) for writing!
      Parameters:
      block - The block to attach the info to
      plugin - The plugin for the info
      Returns:
      All the info that the plugin assigned to the block or null if none was found
    • getBlockInfo

      public org.bukkit.configuration.ConfigurationSection getBlockInfo​(org.bukkit.Location location, org.bukkit.plugin.Plugin plugin)
      Get information from a block. This is only for reading, use setBlockInfo(Block, NamespacedKey, Object) for writing!
      Parameters:
      location - The location of the block to get the info from
      plugin - The plugin for the info
      Returns:
      All the info that the plugin assigned to the block or null if none was found
    • getBlockInfo

      public org.bukkit.configuration.ConfigurationSection getBlockInfo​(org.bukkit.block.Block block, String type)
      Get information from a block. This is only for reading, use setBlockInfo(Block, NamespacedKey, Object) for writing!
      Parameters:
      block - The block to get the info from
      type - The type of info to get
      Returns:
      All the info of that type that is assigned to the block or null if none was found
    • getBlockInfo

      public org.bukkit.configuration.ConfigurationSection getBlockInfo​(org.bukkit.Location location, String type)
      Get information from a block. This is only for reading, use setBlockInfo(Block, NamespacedKey, Object) for writing!
      Parameters:
      location - The location of the block to get the info from
      type - The type of info to get
      Returns:
      All the info of that type that is assigned to the block or null if none was found
    • getBlockInfoValue

      public Object getBlockInfoValue​(org.bukkit.block.Block block, org.bukkit.NamespacedKey key)
      Get information from a block. This is only for reading, use setBlockInfo(Block, NamespacedKey, Object) for writing!
      Parameters:
      block - The block to get the info from
      key - The namespaced key for the info to get
      Returns:
      The info value assigned to the block or null if none was found
    • getBlockInfoValue

      public Object getBlockInfoValue​(org.bukkit.Location location, org.bukkit.NamespacedKey key)
      Get information from a block. This is only for reading, use setBlockInfo(Block, NamespacedKey, Object) for writing!
      Parameters:
      location - The location of the block to get the info from
      key - The namespaced key for the info to get
      Returns:
      The info value assigned to the block or null if none was found
    • removeBlockInfo

      public void removeBlockInfo​(org.bukkit.block.Block block, org.bukkit.plugin.Plugin plugin)
      Remove block info
      Parameters:
      block - The block the info is attached to
      plugin - The plugin which's info to remove
    • removeBlockInfo

      public void removeBlockInfo​(org.bukkit.Location location, org.bukkit.plugin.Plugin plugin)
      Remove block info
      Parameters:
      location - The location of the block the info is attached to
      plugin - The plugin which's info to remove
    • removeBlockInfo

      public void removeBlockInfo​(org.bukkit.block.Block block, org.bukkit.NamespacedKey key)
      Remove block info
      Parameters:
      block - The block the info is attached to
      key - The key to remove
    • removeBlockInfo

      public void removeBlockInfo​(org.bukkit.Location location, org.bukkit.NamespacedKey key)
      Remove block info
      Parameters:
      location - The location of the block the info is attached to
      key - The key to remove
    • removeBlockInfo

      public void removeBlockInfo​(org.bukkit.block.Block block, String type)
      Remove block info
      Parameters:
      block - The block the info is attached to
      type - The type to remove
    • removeBlockInfo

      public void removeBlockInfo​(org.bukkit.Location location, String type)
      Remove block info
      Parameters:
      location - The location of the block the info is attached to
      type - The type to remove
    • removeBlockInfo

      public void removeBlockInfo​(org.bukkit.block.Block block)
      Remove all block info (TODO: Decide whether or not this is too dangerous to expose)
      Parameters:
      block - The block info is attached to
    • removeBlockInfo

      public void removeBlockInfo​(org.bukkit.Location location)
      Remove all block info (TODO: Decide whether or not this is too dangerous to expose)
      Parameters:
      location - The location of the block info is attached to