9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/leaves-server/minecraft-patches/features/0069-Avoid-anvil-too-expensive.patch
MC_XiaoHei 90080d238e 1.21.10 (#752)
---------

Co-authored-by: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
2025-11-28 03:15:54 +08:00

20 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Sat, 22 Jul 2023 14:16:25 +0800
Subject: [PATCH] Avoid anvil too expensive
diff --git a/net/minecraft/world/inventory/AnvilMenu.java b/net/minecraft/world/inventory/AnvilMenu.java
index 9a3887752aa4b39224c9bf6e6145e20fa6962439..a7f84100b350b097d33b571be65296fe76d13e82 100644
--- a/net/minecraft/world/inventory/AnvilMenu.java
+++ b/net/minecraft/world/inventory/AnvilMenu.java
@@ -268,7 +268,7 @@ public class AnvilMenu extends ItemCombinerMenu {
this.onlyRenaming = true;
}
- if (this.cost.get() >= this.maximumRepairCost && !this.player.hasInfiniteMaterials()) { // CraftBukkit
+ if (this.cost.get() >= this.maximumRepairCost && (!org.leavesmc.leaves.LeavesConfig.modify.avoidAnvilTooExpensive || this.cost.get() == DEFAULT_DENIED_COST) && !this.player.hasInfiniteMaterials()) { // CraftBukkit // Leaves - avoid anvil too expensive
itemStack = ItemStack.EMPTY;
}