-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aff95ee
commit 6a67554
Showing
4 changed files
with
55 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
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/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java | ||
index e0c3a4ba27e21c3692e601acd0af60873bcbb84c..b9fcf49ed88c62265d9aa8926c1228b96bf314b6 100644 | ||
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java | ||
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java | ||
@@ -293,7 +293,7 @@ public class AnvilMenu extends ItemCombinerMenu { | ||
this.cost.set(this.maximumRepairCost - 1); // CraftBukkit | ||
} | ||
|
||
- if (this.cost.get() >= this.maximumRepairCost && !this.player.getAbilities().instabuild) { // CraftBukkit | ||
+ if (this.cost.get() >= this.maximumRepairCost && (!top.leavesmc.leaves.LeavesConfig.avoidAnvilTooExpensive || this.cost.get() == DEFAULT_DENIED_COST) && !this.player.getAbilities().instabuild) { // CraftBukkit // Leaves - avoid anvil too expensive | ||
itemstack1 = ItemStack.EMPTY; | ||
} | ||
|
||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java | ||
index 071360899dc841f386ba536503e8b95c2b2a5214..ad0c06c1daba983dfd2660c6538dba0073f813d4 100644 | ||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java | ||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java | ||
@@ -602,6 +602,7 @@ public final class LeavesConfig { | ||
|
||
public static void registerCarpetRules() { | ||
CarpetRules.register(CarpetRule.of("carpet", "creativeNoClip", creativeNoClip)); | ||
+ CarpetRules.register(CarpetRule.of("pca", "avoidAnvilTooExpensive", avoidAnvilTooExpensive)); | ||
} | ||
|
||
public static boolean creativeNoClip = false; |