Skip to content

Commit

Permalink
Enchantment mending compatibility infinity (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Jun 27, 2023
1 parent 4e00b39 commit cfc314c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
9 changes: 7 additions & 2 deletions patches/server/0004-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ index a53514f2c510b29f596c361de7bc0b405c27e964..269c7ba0707db4fdc45a70000e0be892
.withRequiredArg()
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..8a62ffa48472a3d3ef019154379bf2a5a30ce78c
index 0000000000000000000000000000000000000000..f901ec32a948fa9705dc53389a279bd466a02fa3
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,757 @@
@@ -0,0 +1,762 @@
+package top.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
Expand Down Expand Up @@ -714,6 +714,11 @@ index 0000000000000000000000000000000000000000..8a62ffa48472a3d3ef019154379bf2a5
+ optimizedDragonRespawn = getBoolean("settings.performance.optimized-dragon-respawn", optimizedDragonRespawn);
+ }
+
+ public static boolean mendingCompatibilityInfinity = false;
+ private static void mendingCompatibilityInfinity() {
+ mendingCompatibilityInfinity = getBoolean("settings.modify.mending-compatibility-infinity", mendingCompatibilityInfinity);
+ }
+
+ public static final class WorldConfig {
+
+ public final String worldName;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <[email protected]>
Date: Tue, 27 Jun 2023 13:48:36 +0800
Subject: [PATCH] Enchantment mending compatibility infinity


diff --git a/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java b/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java
index 518d85a13c37a2f7d32ca0718323181048559986..881d661326cbca3c5340a33a990f122737a37ef3 100644
--- a/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java
+++ b/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java
@@ -19,6 +19,6 @@ public class ArrowInfiniteEnchantment extends Enchantment {

@Override
public boolean checkCompatibility(Enchantment other) {
- return other instanceof MendingEnchantment ? false : super.checkCompatibility(other);
+ return (!top.leavesmc.leaves.LeavesConfig.mendingCompatibilityInfinity && other instanceof MendingEnchantment) ? false : super.checkCompatibility(other); // Leaves - mendingCompatibilityInfinity
}
}

0 comments on commit cfc314c

Please sign in to comment.