diff --git a/paper-server/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch b/paper-server/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch index 6cc9ed9fd6..a723b845be 100644 --- a/paper-server/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch +++ b/paper-server/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/inventory/ContainerAnvil.java +++ b/net/minecraft/world/inventory/ContainerAnvil.java -@@ -18,6 +18,10 @@ +@@ -18,12 +18,16 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -11,6 +11,13 @@ public class ContainerAnvil extends ContainerAnvilAbstract { private static final Logger LOGGER = LogManager.getLogger(); + private static final boolean DEBUG_COST = false; + public static final int MAX_NAME_LENGTH = 50; +- private int repairItemCountCost; ++ public int repairItemCountCost; // PAIL private -> public + public String itemName; + public final ContainerProperty cost; + private static final int COST_FAIL = 0; @@ -33,6 +37,10 @@ private static final int COST_REPAIR_SACRIFICE = 2; private static final int COST_INCOMPATIBLE_PENALTY = 1; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java index 2386eb2a0a..6d27ac2841 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java @@ -27,6 +27,16 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn return container.itemName; } + @Override + public int getRepairCostAmount() { + return container.repairItemCountCost; + } + + @Override + public void setRepairCostAmount(int amount) { + container.repairItemCountCost = amount; + } + @Override public int getRepairCost() { return container.cost.get();