From 37945d9ca3a165c4b7401d4cfcfe492f350b4dbb Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Fri, 5 Oct 2018 15:04:22 -0400 Subject: [PATCH] Add maximum repair cost API to AnvilInventory By: Parker Hawke --- .../org/bukkit/inventory/AnvilInventory.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/inventory/AnvilInventory.java b/paper-api/src/main/java/org/bukkit/inventory/AnvilInventory.java index 289a630e88..b2c6e2150b 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/AnvilInventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/AnvilInventory.java @@ -26,4 +26,24 @@ public interface AnvilInventory extends Inventory { * @param levels the experience cost */ void setRepairCost(int levels); + + /** + * Get the maximum experience cost (in levels) to be allowed by the current + * repair. If the result of {@link #getRepairCost()} 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. + * + * @return the maximum experience cost + */ + int getMaximumRepairCost(); + + /** + * Set the maximum experience cost (in levels) to be allowed by the current + * repair. The default value set by vanilla Minecraft is 40. + * + * @param levels the maximum experience cost + */ + void setMaximumRepairCost(int levels); }