From 3fb8f4b1d1533c2977e477dbd9161298c621fe1c Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 30 Jul 2024 07:11:55 +1000 Subject: [PATCH] SPIGOT-7853: AnvilInventory#getRepairCost() always returns 0 By: Miles Holder --- .../inventory/CraftInventoryAnvil.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) 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 4dbf4669be..5258224dc4 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 @@ -16,16 +16,16 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn private final Location location; private String renameText; - private int costAmount; - private int repairAmount; + private int repairCost; + private int repairCostAmount; private int maximumRepairCost; public CraftInventoryAnvil(Location location, IInventory inventory, IInventory resultInventory) { super(inventory, resultInventory); this.location = location; this.renameText = null; - this.costAmount = DEFAULT_REPAIR_COST_AMOUNT; - this.repairAmount = DEFAULT_REPAIR_COST; + this.repairCost = DEFAULT_REPAIR_COST; + this.repairCostAmount = DEFAULT_REPAIR_COST_AMOUNT; this.maximumRepairCost = DEFAULT_MAXIMUM_REPAIR_COST; } @@ -42,25 +42,25 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn @Override public int getRepairCostAmount() { - syncWithArbitraryViewValue((cav) -> this.costAmount = cav.getRepairItemCountCost()); - return this.repairAmount; + syncWithArbitraryViewValue((cav) -> this.repairCostAmount = cav.getRepairItemCountCost()); + return this.repairCostAmount; } @Override public void setRepairCostAmount(int amount) { - this.repairAmount = amount; + this.repairCostAmount = amount; syncViews((cav) -> cav.setRepairItemCountCost(amount)); } @Override public int getRepairCost() { - syncWithArbitraryViewValue((cav) -> this.repairAmount = cav.getRepairCost()); - return this.costAmount; + syncWithArbitraryViewValue((cav) -> this.repairCost = cav.getRepairCost()); + return this.repairCost; } @Override public void setRepairCost(int i) { - this.costAmount = i; + this.repairCost = i; syncViews((cav) -> cav.setRepairCost(i)); } @@ -78,11 +78,11 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn } public boolean isRepairCostSet() { - return this.costAmount != DEFAULT_REPAIR_COST; + return this.repairCost != DEFAULT_REPAIR_COST; } public boolean isRepairCostAmountSet() { - return this.repairAmount != DEFAULT_REPAIR_COST_AMOUNT; + return this.repairCostAmount != DEFAULT_REPAIR_COST_AMOUNT; } public boolean isMaximumRepairCostSet() {