diff options
author | Parker Hawke <hawkeboyz2@hotmail.com> | 2018-10-05 21:48:54 -0400 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-10-06 19:26:40 +1000 |
commit | 1ceee63341927e71e23293be6cb7466bd3045e9e (patch) | |
tree | 9e48ed33a96ff148e6932bcebba8bb5b8abf3904 /src/main/java/org | |
parent | 6a0c4e1cc2518ad246ad51dc9c06412f3c46371f (diff) | |
download | craftbukkit-1ceee63341927e71e23293be6cb7466bd3045e9e.tar craftbukkit-1ceee63341927e71e23293be6cb7466bd3045e9e.tar.gz craftbukkit-1ceee63341927e71e23293be6cb7466bd3045e9e.tar.lz craftbukkit-1ceee63341927e71e23293be6cb7466bd3045e9e.tar.xz craftbukkit-1ceee63341927e71e23293be6cb7466bd3045e9e.zip |
Implement maximum repair cost API to AnvilInventory
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java index f9bbd711..ca19600d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.inventory; +import com.google.common.base.Preconditions; import net.minecraft.server.ContainerAnvil; import net.minecraft.server.IInventory; import org.bukkit.Location; @@ -71,4 +72,15 @@ public class CraftInventoryAnvil extends CraftInventory implements AnvilInventor public void setRepairCost(int i) { container.levelCost = i; } + + @Override + public int getMaximumRepairCost() { + return container.maximumRepairCost; + } + + @Override + public void setMaximumRepairCost(int levels) { + Preconditions.checkArgument(levels >= 0, "Maximum repair cost must be positive (or 0)"); + container.maximumRepairCost = levels; + } } |