public class BlockAPI
extends org.bukkit.plugin.java.JavaPlugin
| Modifier and Type | Field and Description |
|---|---|
private java.util.ArrayList<CustomBlock> |
customBlocks |
private java.util.logging.Logger |
logger
The Minecraft Logger ( in the console )
|
private BlockPersistence |
persist |
static BlockAPI |
plugin |
| Constructor and Description |
|---|
BlockAPI() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addMyCustomBlock(CustomBlock block)
Add your own custom block
|
int |
addMyCustomBlocks(CustomBlock... blocks)
Add your own custom blocks
|
int |
addMyCustomBlocks(java.util.List<CustomBlock> blockList)
Add your own custom blocks
|
static org.bukkit.inventory.Recipe |
createCraftRecipe(org.bukkit.inventory.ItemStack result,
org.bukkit.material.MaterialData[] stacks)
Create a shaped craft recipe, easily.
|
CustomBlock |
getCustomBlock(org.bukkit.block.Block block)
Get the custom block of this block.
|
CustomBlock |
getCustomBlock(org.bukkit.inventory.ItemStack item)
Get the custom block from a book item
If none match return null
|
CustomBlock |
getCustomBlock(java.lang.String identifier)
Get the custom block with the specified identifier.
|
static int |
getCustomBlockAmount(org.bukkit.inventory.ItemStack item)
Get the amount of a custom block that is represented as an item
|
private CustomBlock |
getCustomBlockFromName(java.lang.String name)
Get the custom block from its name
If none was found return null
|
java.util.ArrayList<CustomBlock> |
getCustomBlocks() |
static BlockAPI |
getInstance() |
static org.bukkit.inventory.ItemStack |
getItem(CustomBlock block)
Get a book that will match to the format of this custom block
|
private java.util.logging.Logger |
getLoggerSafely()
Get the Bukkit logger first, before we try to create our own
|
boolean |
isIdTaken(java.lang.String identifier)
Check if a specified identifier is taken if you will use your metadata value for some purposes,
you should check if your identifier is taken
|
boolean |
onCommand(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command cmd,
java.lang.String label,
java.lang.String[] args) |
void |
onDisable() |
void |
onEnable() |
void |
registerRecipe(org.bukkit.inventory.Recipe... recipes)
Register all the given recipe
|
static org.bukkit.block.Block |
setBlock(CustomBlock cblock,
org.bukkit.block.Block block)
Change that block to the given custom block
|
static org.bukkit.inventory.ItemStack |
setCustomBlockAmount(org.bukkit.inventory.ItemStack item,
int amount)
Change the amount of a custom block that is represented as an item
|
getClassLoader, getCommand, getConfig, getDatabase, getDatabaseClasses, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPluginLoader, getResource, getServer, initialize, installDDL, isEnabled, isInitialized, isNaggable, onLoad, onTabComplete, reloadConfig, removeDDL, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringpublic static BlockAPI plugin
private java.util.logging.Logger logger
private java.util.ArrayList<CustomBlock> customBlocks
private BlockPersistence persist
public void onEnable()
onEnable in interface org.bukkit.plugin.PluginonEnable in class org.bukkit.plugin.java.JavaPluginpublic void onDisable()
onDisable in interface org.bukkit.plugin.PluginonDisable in class org.bukkit.plugin.java.JavaPluginpublic boolean onCommand(org.bukkit.command.CommandSender sender,
org.bukkit.command.Command cmd,
java.lang.String label,
java.lang.String[] args)
onCommand in interface org.bukkit.command.CommandExecutoronCommand in class org.bukkit.plugin.java.JavaPluginprivate java.util.logging.Logger getLoggerSafely()
public java.util.ArrayList<CustomBlock> getCustomBlocks()
public boolean addMyCustomBlock(CustomBlock block)
public int addMyCustomBlocks(CustomBlock... blocks)
public int addMyCustomBlocks(java.util.List<CustomBlock> blockList)
public CustomBlock getCustomBlock(java.lang.String identifier)
private CustomBlock getCustomBlockFromName(java.lang.String name)
public CustomBlock getCustomBlock(org.bukkit.inventory.ItemStack item)
public CustomBlock getCustomBlock(org.bukkit.block.Block block)
public boolean isIdTaken(java.lang.String identifier)
public void registerRecipe(org.bukkit.inventory.Recipe... recipes)
public static BlockAPI getInstance()
CustomBlockpublic static org.bukkit.block.Block setBlock(CustomBlock cblock, org.bukkit.block.Block block)
public static org.bukkit.inventory.ItemStack getItem(CustomBlock block)
public static int getCustomBlockAmount(org.bukkit.inventory.ItemStack item)
public static org.bukkit.inventory.ItemStack setCustomBlockAmount(org.bukkit.inventory.ItemStack item,
int amount)
public static org.bukkit.inventory.Recipe createCraftRecipe(org.bukkit.inventory.ItemStack result,
org.bukkit.material.MaterialData[] stacks)
register(recipe)result - is the item the player will be givenstacks - is an itemstack( materialdata can be obtained from an item stack ) array the size must be 9, it will be like the recipe will be in the craft