Package de.minebench.blockinfostorage
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic BlockInfoStorage
get()
Get the storage instanceorg.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.getBlockInfoValue
(org.bukkit.block.Block block, org.bukkit.NamespacedKey key) Get information from a block.getBlockInfoValue
(org.bukkit.Location location, org.bukkit.NamespacedKey key) Get information from a block.void
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 infovoid
removeBlockInfo
(org.bukkit.block.Block block, org.bukkit.NamespacedKey key) Remove block infovoid
removeBlockInfo
(org.bukkit.block.Block block, org.bukkit.plugin.Plugin plugin) Remove block infovoid
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 infovoid
removeBlockInfo
(org.bukkit.Location location, org.bukkit.NamespacedKey key) Remove block infovoid
removeBlockInfo
(org.bukkit.Location location, org.bukkit.plugin.Plugin plugin) Remove block infovoid
setBlockInfo
(org.bukkit.block.Block block, org.bukkit.NamespacedKey key, Object value) Set block infovoid
setBlockInfo
(org.bukkit.Location location, org.bukkit.NamespacedKey key, Object value) Set block infoMethods 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
-
Constructor Details
-
BlockInfoStorage
public BlockInfoStorage()
-
-
Method Details
-
onEnable
public void onEnable()- Specified by:
onEnable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onEnable
in classorg.bukkit.plugin.java.JavaPlugin
-
onDisable
public void onDisable()- Specified by:
onDisable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onDisable
in classorg.bukkit.plugin.java.JavaPlugin
-
get
Get the storage instance- Returns:
- The storage instance
-
setBlockInfo
Set block info- Parameters:
block
- The block to attach the info tokey
- The key to setvalue
- The value to set
-
setBlockInfo
Set block info- Parameters:
location
- The location of the block to attach the info tokey
- The key to setvalue
- 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, usesetBlockInfo(Block, NamespacedKey, Object)
for writing!- Parameters:
block
- The block to attach the info toplugin
- 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, usesetBlockInfo(Block, NamespacedKey, Object)
for writing!- Parameters:
location
- The location of the block to get the info fromplugin
- 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, usesetBlockInfo(Block, NamespacedKey, Object)
for writing!- Parameters:
block
- The block to get the info fromtype
- 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, usesetBlockInfo(Block, NamespacedKey, Object)
for writing!- Parameters:
location
- The location of the block to get the info fromtype
- 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
Get information from a block. This is only for reading, usesetBlockInfo(Block, NamespacedKey, Object)
for writing!- Parameters:
block
- The block to get the info fromkey
- The namespaced key for the info to get- Returns:
- The info value assigned to the block or null if none was found
-
getBlockInfoValue
Get information from a block. This is only for reading, usesetBlockInfo(Block, NamespacedKey, Object)
for writing!- Parameters:
location
- The location of the block to get the info fromkey
- 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 toplugin
- 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 toplugin
- 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 tokey
- 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 tokey
- The key to remove
-
removeBlockInfo
Remove block info- Parameters:
block
- The block the info is attached totype
- The type to remove
-
removeBlockInfo
Remove block info- Parameters:
location
- The location of the block the info is attached totype
- 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
-