Package org.bukkit.inventory.view
Interface AnvilView
- All Superinterfaces:
InventoryView
An instance of
InventoryView
which provides extra methods related to
anvil view data.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.inventory.InventoryView
InventoryView.Property
-
Field Summary
Fields inherited from interface org.bukkit.inventory.InventoryView
OUTSIDE
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets if the player viewing the anvil inventory can bypass experience costboolean
Gets if the player viewing the anvil inventory can do unsafe enchantsint
Gets the maximum repair cost needed to repair.Gets the rename text specified within the anvil's text field.int
Gets the experience cost needed to repair.int
Gets the amount of items needed to repair.void
setBypassCost
(boolean bypassCost) Set if the player viewing the anvil inventory can bypass the experience costvoid
setDoUnsafeEnchants
(boolean canDoUnsafeEnchants) Set if the player viewing the anvil inventory can do unsafe enchantsvoid
setMaximumRepairCost
(int levels) Sets maximum repair cost in experience.void
setRepairCost
(int cost) Sets the repair cost in experience.void
setRepairItemCountCost
(int amount) Sets the amount of repair materials required to repair the item.Methods inherited from interface org.bukkit.inventory.InventoryView
close, convertSlot, countSlots, getBottomInventory, getCursor, getInventory, getItem, getOriginalTitle, getPlayer, getSlotType, getTitle, getTopInventory, getType, setCursor, setItem, setProperty, setTitle, title
-
Method Details
-
getRenameText
Gets the rename text specified within the anvil's text field.- Returns:
- The text within the anvil's text field if an item is present otherwise null
-
getRepairItemCountCost
int getRepairItemCountCost()Gets the amount of items needed to repair.- Returns:
- The amount of materials required to repair the item
-
getRepairCost
int getRepairCost()Gets the experience cost needed to repair.- Returns:
- The repair cost in experience
-
getMaximumRepairCost
int getMaximumRepairCost()Gets the maximum repair cost needed to repair.- Returns:
- The maximum repair cost in experience
-
setRepairItemCountCost
void setRepairItemCountCost(int amount) Sets the amount of repair materials required to repair the item.- Parameters:
amount
- the amount of repair materials
-
setRepairCost
void setRepairCost(int cost) Sets the repair cost in experience.- Parameters:
cost
- the experience cost to repair
-
setMaximumRepairCost
void setMaximumRepairCost(int levels) Sets maximum repair cost in experience.- Parameters:
levels
- the levels to set
-
canBypassCost
boolean canBypassCost()Gets if the player viewing the anvil inventory can bypass experience cost- Returns:
- whether the player viewing the anvil inventory can bypass the experience cost
-
setBypassCost
void setBypassCost(boolean bypassCost) Set if the player viewing the anvil inventory can bypass the experience cost- Parameters:
bypassCost
- whether the player viewing the anvil inventory can bypass the experience cost
-
canDoUnsafeEnchants
boolean canDoUnsafeEnchants()Gets if the player viewing the anvil inventory can do unsafe enchants- Returns:
- whether the player viewing the anvil inventory can do unsafe enchants
-
setDoUnsafeEnchants
void setDoUnsafeEnchants(boolean canDoUnsafeEnchants) Set if the player viewing the anvil inventory can do unsafe enchants- Parameters:
canDoUnsafeEnchants
- whether the player viewing the anvil inventory can do unsafe enchants
-