public interface Tool
Modifier and Type | Method and Description |
---|---|
void |
addBlacklistedDrop(java.lang.String drop)
Add a blacklisted drop to the tool.
|
void |
addBlacklistedMaterial(java.lang.String type)
Add a blacklisted material to the tool.
|
void |
addEnchantment(org.bukkit.enchantments.Enchantment ench,
int level)
Add an enchantment for the tool item.
|
void |
addWhitelistedDrop(java.lang.String drop)
Add a whitelisted drop to the tool.
|
void |
addWhitelistedMaterial(java.lang.String type)
Add a whitelisted material to the tool.
|
boolean |
canBreakBlock(org.bukkit.block.Block block,
org.bukkit.Material firstType,
short data)
Check whether or not the tool can break a block.
|
boolean |
canUse(java.util.UUID uuid)
Check whether or not a player can use this tool, and no cooldowns are active for him.
|
java.util.List<org.bukkit.inventory.ItemStack> |
filterDrops(java.util.List<org.bukkit.inventory.ItemStack> drops)
Filter all drops for this tool.
|
int |
getAnvilCombineExp()
Get the amount of exp required to combine this tool with another one.
|
int |
getAnvilCombineLimit()
Get the maximum uses a new tool can have from combining two tools in an anvil.
|
java.util.Set<java.lang.String> |
getBlacklistedDrops()
Get all the blacklisted block drops.
|
java.util.Set<java.lang.String> |
getBlacklistedMaterials()
Get all the blacklisted block materials.
|
long |
getCooldown()
Get the cooldown of the tool.
|
int |
getDefaultUses()
Get the default amount of uses of the tool.
|
int |
getDurability(org.bukkit.entity.Player player,
org.bukkit.inventory.ItemStack itemStack)
Get the durability of an item of this tool.
|
org.bukkit.inventory.ItemStack |
getFormattedItemStack()
Get a formatted item with default amount of uses.
|
org.bukkit.inventory.ItemStack |
getFormattedItemStack(int uses)
Get a formatted item with specific amount of uses.
|
org.bukkit.inventory.ItemStack |
getItemStack()
Get the raw item stack of the tool.
|
double |
getMultiplier()
Get the multiplier for prices of the tool.
|
java.lang.String |
getName()
Get the name of the tool.
|
long |
getTimeLeft(java.util.UUID uuid)
Get the amount of time left of cooldown for a player to use this tool.
|
ToolMode |
getToolMode()
Get the tool mode.
|
java.util.Set<java.lang.String> |
getWhitelistedDrops()
Get all the whitelisted block drops.
|
java.util.Set<java.lang.String> |
getWhitelistedMaterials()
Get all the whitelisted block materials.
|
boolean |
hasAnvilCombineLimit()
Check whether or not there is a maximum uses that a new tool can have from combining two tools.
|
boolean |
hasBlacklistedDrops()
Check whether or not the tool has blacklisted block drops.
|
boolean |
hasBlacklistedMaterials()
Check whether or not the tool has blacklisted block materials.
|
boolean |
hasKeepInventory()
Check whether or not the tool is kept in the inventories of players when they die.
|
boolean |
hasSilkTouch()
Check whether or not the tool acts like it has silk-touch.
|
boolean |
hasVanillaDamage()
Check whether or not the tool can take damage by other vanilla actions.
|
boolean |
hasWhitelistedDrops()
Check whether or not the tool has whitelisted block drops.
|
boolean |
hasWhitelistedMaterials()
Check whether or not the tool has whitelisted block materials.
|
boolean |
isAnvilCombine()
Check whether or not the tool can be combined with another tool in an anvil.
|
boolean |
isAutoCollect()
Check whether or not drops from the tool are added to the players' inventories.
|
boolean |
isBlacklistedDrop(org.bukkit.Material type,
short data)
Check whether or not a drop is blacklisted.
|
boolean |
isBlacklistedMaterial(org.bukkit.Material type,
short data)
Check whether or not a block is blacklisted.
|
boolean |
isBlacklistedWorld(java.lang.String world)
Check whether or not a world is blacklisted.
|
boolean |
isInstantBreak()
Check whether or not blocks broken by the tool are instant-broken.
|
boolean |
isOmni()
Check whether or not the tool switches types, depends on the broken block.
|
boolean |
isOnlyInsideClaim()
Check whether or not the tool only affects blocks inside players' claims.
|
boolean |
isOnlySameType()
Check whether or not the tool only affects blocks of the same type.
|
boolean |
isPrivate()
Check whether or not the tool is private.
|
boolean |
isSimilar(org.bukkit.inventory.ItemStack is)
Check whether or not an item is of this tool.
|
boolean |
isUnbreakable()
Check whether or not the tool is unbreakable.
|
boolean |
isUsesProgress()
Check whether or not the durability of the tool should be decreased in relation to the uses.
|
boolean |
isUsingDurability()
Check whether or not the tool is using vanilla durability.
|
boolean |
isWhitelistedDrop(org.bukkit.Material type,
short data)
Check whether or not a drop is whitelisted.
|
boolean |
isWhitelistedMaterial(org.bukkit.Material type,
short data)
Check whether or not a block is whitelisted.
|
boolean |
isWhitelistedWorld(java.lang.String world)
Check whether or not a world is whitelisted.
|
boolean |
onAirInteract(org.bukkit.event.player.PlayerInteractEvent e)
A method that is called when players hit air using this tool.
|
boolean |
onBlockBreak(org.bukkit.event.block.BlockBreakEvent e)
A method that is called when players break blocks using this tool.
|
boolean |
onBlockHit(org.bukkit.event.player.PlayerInteractEvent e)
A method that is called when players hit blocks using this tool.
|
boolean |
onBlockInteract(org.bukkit.event.player.PlayerInteractEvent e)
A method that is called when players interact with blocks using this tool.
|
void |
reduceDurablility(org.bukkit.entity.Player pl,
int amount,
org.bukkit.inventory.ItemStack itemStack)
Reduce durability of an item of this tool.
|
void |
setAnvilCombineExp(int anvilCombineExp)
Set the amount of exp required to combine this tool with another one.
|
void |
setAnvilCombineLimit(int anvilCombineMax)
Set the maximum uses a tool can have from combining tools.
|
void |
setAutoCollect(boolean autoCollect)
Set whether or not the drops from the tool should be added to the players' inventories.
|
void |
setBlacklistedWorlds(java.util.List<java.lang.String> worlds)
Set the blacklisted worlds of the tool.
|
void |
setCooldown(long cooldown)
Set a cooldown for using the tool.
|
void |
setDisplayName(java.lang.String name)
Set the display name of the tool's item.
|
void |
setInstantBreak(boolean instantBreak)
Set whether or not the blocks broken by the tool will be instant-broken.
|
void |
setKeepInventory(boolean keepInventory)
Set whether or not the tool should be kept in the inventories of players when they die.
|
void |
setLastUse(java.util.UUID uuid)
Update the last time a player used this tool.
|
void |
setLore(java.util.List<java.lang.String> lore)
Set the lore of the tool's item.
|
void |
setMultiplier(double multiplier)
Set a multiplier for prices of the tool.
|
void |
setOmni(boolean omni)
Set whether or not the tool should switch types, depends on the broken block.
|
void |
setOnlyInsideClaim(boolean onlyInsideClaim)
Set whether or not the tool should only affect blocks inside players' claims.
|
void |
setOnlySameType(boolean onlySameType)
Set whether or not the tool should only affect blocks of the same type.
|
void |
setPrivate(boolean privateTool)
Set whether or not the tool should be private.
|
void |
setSilkTouch(boolean silkTouch)
Set whether or not the tool will act like it has a silk-touch enchantment.
|
void |
setSpigotUnbreakable(boolean spigotUnbreakable)
Set whether or not the item should have spigot's unbreakable status.
|
void |
setUnbreakable(boolean unbreakable)
Set whether or not the tool should be unbreakable.
|
void |
setUsesLeft(int usesLeft)
Set the amount of uses the tool should have.
|
void |
setUsesProgress(boolean usesProgress)
Set whether or not the durability of the tool should be decreased in relation to the uses.
|
void |
setVanillaDamage(boolean vanillaDamage)
Set whether or not the tool should be damaged by other vanilla actions.
|
void |
setWhitelistedWorlds(java.util.List<java.lang.String> worlds)
Set the whitelisted worlds of the tool.
|
void setDisplayName(java.lang.String name)
name
- The new display name.void setLore(java.util.List<java.lang.String> lore)
lore
- The new lore.void setSpigotUnbreakable(boolean spigotUnbreakable)
spigotUnbreakable
- True if tool should have the status, otherwise false.void setOnlySameType(boolean onlySameType)
onlySameType
- True if tool should only affect similar blocks, otherwise false.void setOnlyInsideClaim(boolean onlyInsideClaim)
onlyInsideClaim
- True if tool should only affect inside claims, otherwise false.void setAutoCollect(boolean autoCollect)
autoCollect
- True if drops should be added, otherwise false.void setInstantBreak(boolean instantBreak)
instantBreak
- True if blocks should be instant-broken, otherwise false.void setSilkTouch(boolean silkTouch)
silkTouch
- True if tool should act like it has a silk-touch, otherwise false.void setUnbreakable(boolean unbreakable)
unbreakable
- True if tool should be unbreakable, otherwise false.void setVanillaDamage(boolean vanillaDamage)
vanillaDamage
- True if should take damage, otherwise false.void setUsesLeft(int usesLeft)
usesLeft
- The amount of uses of the tool.void setCooldown(long cooldown)
cooldown
- The cooldown (in milliseconds)void setKeepInventory(boolean keepInventory)
keepInventory
- True if tool should be kept, otherwise false.void setOmni(boolean omni)
omni
- True if tool should be omni, otherwise false.void setPrivate(boolean privateTool)
privateTool
- True if tool should be private, otherwise false.void setUsesProgress(boolean usesProgress)
usesProgress
- True if durability should decrease, otherwise false.void addEnchantment(org.bukkit.enchantments.Enchantment ench, int level)
ench
- The enchantment to add.level
- The level of the enchantment.void addBlacklistedMaterial(java.lang.String type)
type
- The material to be blacklisted.void addWhitelistedMaterial(java.lang.String type)
type
- The material to be whitelisted.void addBlacklistedDrop(java.lang.String drop)
drop
- The drop to be blacklisted.void addWhitelistedDrop(java.lang.String drop)
drop
- The drop to be whitelisted.void setMultiplier(double multiplier)
multiplier
- The multiplier to set.void setAnvilCombineExp(int anvilCombineExp)
anvilCombineExp
- The amount of exp needed to combine two tools.void setAnvilCombineLimit(int anvilCombineMax)
anvilCombineMax
- The maximum uses a new tool can have.void setBlacklistedWorlds(java.util.List<java.lang.String> worlds)
worlds
- The blacklisted worlds.void setWhitelistedWorlds(java.util.List<java.lang.String> worlds)
worlds
- The whitelisted worlds.org.bukkit.inventory.ItemStack getItemStack()
org.bukkit.inventory.ItemStack getFormattedItemStack()
org.bukkit.inventory.ItemStack getFormattedItemStack(int uses)
uses
- The amount of uses the item should have.ToolMode getToolMode()
java.lang.String getName()
boolean isUnbreakable()
boolean hasVanillaDamage()
boolean isAutoCollect()
boolean isInstantBreak()
boolean hasSilkTouch()
int getDefaultUses()
boolean isUsingDurability()
boolean isOnlySameType()
boolean isOnlyInsideClaim()
long getCooldown()
boolean hasKeepInventory()
boolean isOmni()
boolean isPrivate()
boolean isUsesProgress()
boolean isAnvilCombine()
boolean hasAnvilCombineLimit()
java.util.Set<java.lang.String> getBlacklistedMaterials()
java.util.Set<java.lang.String> getWhitelistedMaterials()
java.util.Set<java.lang.String> getBlacklistedDrops()
java.util.Set<java.lang.String> getWhitelistedDrops()
boolean hasBlacklistedMaterials()
boolean hasWhitelistedMaterials()
boolean hasBlacklistedDrops()
boolean hasWhitelistedDrops()
boolean isBlacklistedMaterial(org.bukkit.Material type, short data)
type
- The block's material type.data
- The block's data value.boolean isWhitelistedMaterial(org.bukkit.Material type, short data)
type
- The block's material type.data
- The block's data value.boolean isBlacklistedDrop(org.bukkit.Material type, short data)
type
- The drop's material type.data
- The drop's data value.boolean isWhitelistedDrop(org.bukkit.Material type, short data)
type
- The drop's material type.data
- The drop's data value.double getMultiplier()
int getAnvilCombineExp()
int getAnvilCombineLimit()
boolean isBlacklistedWorld(java.lang.String world)
world
- The world to check.boolean isWhitelistedWorld(java.lang.String world)
world
- The world to check.void reduceDurablility(org.bukkit.entity.Player pl, int amount, org.bukkit.inventory.ItemStack itemStack)
pl
- The player which holds/used the tool.amount
- The amount of durability to remove.itemStack
- The item to reduce it's durability.int getDurability(org.bukkit.entity.Player player, org.bukkit.inventory.ItemStack itemStack)
player
- The player which holds/used the tool.itemStack
- The item to check.boolean canBreakBlock(org.bukkit.block.Block block, org.bukkit.Material firstType, short data)
block
- The block to check.firstType
- The first broken-block's material type.data
- The first broken-block's data value.java.util.List<org.bukkit.inventory.ItemStack> filterDrops(java.util.List<org.bukkit.inventory.ItemStack> drops)
drops
- The original drops.boolean isSimilar(org.bukkit.inventory.ItemStack is)
is
- The item to check.void setLastUse(java.util.UUID uuid)
uuid
- The UUID of the player.boolean canUse(java.util.UUID uuid)
uuid
- The UUID of the player.long getTimeLeft(java.util.UUID uuid)
uuid
- The UUID of the player.boolean onBlockBreak(org.bukkit.event.block.BlockBreakEvent e)
e
- The block event that was fired.boolean onBlockInteract(org.bukkit.event.player.PlayerInteractEvent e)
e
- The interact event that was fired.boolean onBlockHit(org.bukkit.event.player.PlayerInteractEvent e)
e
- The block event that was fired.boolean onAirInteract(org.bukkit.event.player.PlayerInteractEvent e)
e
- The interact event that was fired.