Package org.bukkit.inventory
Interface AnvilInventory
Interface to the inventory of an Anvil.
- 
Method SummaryModifier and TypeMethodDescriptionGets the item in the left input slot.intGet the maximum experience cost (in levels) to be allowed by the current repair.Get the name to be applied to the repaired item.intGet the experience cost (in levels) to complete the current repair.intGet the item cost (in amount) to complete the current repair.Gets the item in the result slot.Gets the item in the right input slot.default voidsetFirstItem(@Nullable ItemStack firstItem) Sets the item in the left input slot.voidsetMaximumRepairCost(int levels) Set the maximum experience cost (in levels) to be allowed by the current repair.voidsetRepairCost(int levels) Set the experience cost (in levels) to complete the current repair.voidsetRepairCostAmount(int amount) Set the item cost (in amount) to complete the current repair.default voidSets the item in the result slot.default voidsetSecondItem(@Nullable ItemStack secondItem) Sets the item in the right input slot.Methods inherited from interface org.bukkit.inventory.InventoryaddItem, 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, setStorageContentsMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Method Details- 
getRenameTextGet the name to be applied to the repaired item. An empty string denotes the default item name.- Returns:
- the rename text
 
- 
getRepairCostAmountint getRepairCostAmount()Get the item cost (in amount) to complete the current repair.- Returns:
- the amount
 
- 
setRepairCostAmountvoid setRepairCostAmount(int amount) Set the item cost (in amount) to complete the current repair.- Parameters:
- amount- the amount
 
- 
getRepairCostint getRepairCost()Get the experience cost (in levels) to complete the current repair.- Returns:
- the experience cost
 
- 
setRepairCostvoid setRepairCost(int levels) Set the experience cost (in levels) to complete the current repair.- Parameters:
- levels- the experience cost
 
- 
getMaximumRepairCostint getMaximumRepairCost()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
 
- 
setMaximumRepairCostvoid setMaximumRepairCost(int levels) 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
 
- 
getFirstItemGets the item in the left input slot.- Returns:
- item in the first slot
 
- 
setFirstItemSets the item in the left input slot.- Parameters:
- firstItem- item to set
 
- 
getSecondItemGets the item in the right input slot.- Returns:
- item in the second slot
 
- 
setSecondItemSets the item in the right input slot.- Parameters:
- secondItem- item to set
 
- 
getResultGets the item in the result slot.- Returns:
- item in the result slot
 
- 
setResultSets 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
 
 
-