From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: 12emin34 <macanovic.emin@gmail.com>
Date: Fri, 21 May 2021 16:58:45 +0200
Subject: [PATCH] Make anvil cumulative cost configurable


diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
index f380659b261253e327f018ce9b54b15195ad65d7..080449cf3aa0394bd179e26fda8d7248f488ea8d 100644
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
@@ -341,7 +341,7 @@ public class AnvilMenu extends ItemCombinerMenu {
     }
 
     public static int calculateIncreasedRepairCost(int cost) {
-        return cost * 2 + 1;
+        return net.pl3x.purpur.PurpurConfig.anvilCumulativeCost ? cost * 2 + 1 : 0;
     }
 
     public void setItemName(String newItemName) {
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index b1cb0e5857509921c2f2c112e98ec2801ce5c4c2..dcb0aca3303b92f955700f784934396a4808f7ed 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -379,6 +379,7 @@ public class PurpurConfig {
     public static boolean enderChestPermissionRows = false;
     public static boolean cryingObsidianValidForPortalFrame = false;
     public static int beeInsideBeeHive = 3;
+    public static boolean anvilCumulativeCost = true;
     private static void blockSettings() {
         if (version < 3) {
             boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
@@ -395,6 +396,7 @@ public class PurpurConfig {
         enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
         cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame);
         beeInsideBeeHive = getInt("settings.blocks.beehive.max-bees-inside", beeInsideBeeHive);
+        anvilCumulativeCost = getBoolean("settings.blocks.anvil.cumulative-cost", anvilCumulativeCost);
     }
 
     public static boolean allowInfinityMending = false;
