mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
32 lines
1.8 KiB
Diff
32 lines
1.8 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/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 1e14eefdce8633f196868f2309dd832b00b3373f..9f95c37eca4f732e8ed15abef206c37b8afa71db 100644
|
|
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
|
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
|
@@ -605,6 +605,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;
|