Package org.bukkit.inventory
Interface AnvilInventory
Interface to the inventory of an Anvil.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated, for removal: This API element is subject to removal in a future version.boolean
Deprecated, for removal: This API element is subject to removal in a future version.Gets the item in the left input slot.int
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.int
Deprecated, for removal: This API element is subject to removal in a future version.int
Deprecated, for removal: This API element is subject to removal in a future version.Gets the item in the result slot.Gets the item in the right input slot.void
setBypassCost
(boolean bypassCost) Deprecated, for removal: This API element is subject to removal in a future version.void
setDoUnsafeEnchants
(boolean canDoUnsafeEnchants) Deprecated, for removal: This API element is subject to removal in a future version.default void
setFirstItem
(@Nullable ItemStack firstItem) Sets the item in the left input slot.void
setMaximumRepairCost
(int levels) Deprecated, for removal: This API element is subject to removal in a future version.void
setRepairCost
(int levels) Deprecated, for removal: This API element is subject to removal in a future version.void
setRepairCostAmount
(int amount) Deprecated, for removal: This API element is subject to removal in a future version.default void
Sets the item in the result slot.default void
setSecondItem
(@Nullable ItemStack secondItem) Sets the item in the right input slot.Methods inherited from interface org.bukkit.inventory.Inventory
addItem, all, all, clear, clear, close, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, getContents, getHolder, getHolder, getItem, getLocation, getMaxStackSize, getSize, getStorageContents, getType, getViewers, isEmpty, iterator, iterator, remove, remove, removeItem, removeItemAnySlot, setContents, setItem, setMaxStackSize, setStorageContents
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getRenameText
Deprecated, for removal: This API element is subject to removal in a future version.Get the name to be applied to the repaired item. An empty string denotes the default item name.- Returns:
- the rename text
-
getRepairCostAmount
Deprecated, for removal: This API element is subject to removal in a future version.Get the item cost (in amount) to complete the current repair.- Returns:
- the amount
-
setRepairCostAmount
Deprecated, for removal: This API element is subject to removal in a future version.Set the item cost (in amount) to complete the current repair.- Parameters:
amount
- the amount
-
getRepairCost
Deprecated, for removal: This API element is subject to removal in a future version.Get the experience cost (in levels) to complete the current repair.- Returns:
- the experience cost
-
setRepairCost
Deprecated, for removal: This API element is subject to removal in a future version.Set the experience cost (in levels) to complete the current repair.- Parameters:
levels
- the experience cost
-
getMaximumRepairCost
Deprecated, for removal: This API element is subject to removal in a future version.Get the maximum experience cost (in levels) to be allowed by the current repair. If the result ofgetRepairCost()
exceeds the returned value, the repair result will be air to due being "too expensive".By default, this level is set to 40. Players in creative mode ignore the maximum repair cost.
- Returns:
- the maximum experience cost
-
setMaximumRepairCost
Deprecated, for removal: This API element is subject to removal in a future version.Set the maximum experience cost (in levels) to be allowed by the current repair. The default value set by vanilla Minecraft is 40.- Parameters:
levels
- the maximum experience cost
-
getFirstItem
Gets the item in the left input slot.- Returns:
- item in the first slot
-
setFirstItem
Sets the item in the left input slot.- Parameters:
firstItem
- item to set
-
getSecondItem
Gets the item in the right input slot.- Returns:
- item in the second slot
-
setSecondItem
Sets the item in the right input slot.- Parameters:
secondItem
- item to set
-
getResult
Gets the item in the result slot.- Returns:
- item in the result slot
-
setResult
Sets the item in the result slot. Note that the client might not be able to take out the item if it does not match the input items.- Parameters:
result
- item to set
-
canBypassCost
Deprecated, for removal: This API element is subject to removal in a future version.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
Deprecated, for removal: This API element is subject to removal in a future version.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
Deprecated, for removal: This API element is subject to removal in a future version.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
Deprecated, for removal: This API element is subject to removal in a future version.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
-
AnvilView.canBypassCost()
.