Files
Purpur/patches/server/0133-Allow-infinite-and-mending-enchantments-together.patch
BillyGalbreath b8fb7ff5b5 Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
821ce25d9 Significantly improve performance of the end generation
2b2e4fd65 Add Wandering Trader spawn rate config options
7263cbca7 [CI-SKIP] [Auto] Rebuild Patches
1c63aff6d Villager resetOffers API
8d8d74a5f Patch 2 references an invalid variable
e6d7bdca1 [CI-SKIP] fixed sed -i for bsd sed (#4782)
7ae47d4eb [CI-SKIP] Remove Waving banner fix (#4786)
2020-11-19 21:31:10 -06:00

51 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Tue, 13 Oct 2020 20:04:33 -0500
Subject: [PATCH] Allow infinite and mending enchantments together
diff --git a/src/main/java/net/minecraft/server/EnchantmentInfiniteArrows.java b/src/main/java/net/minecraft/server/EnchantmentInfiniteArrows.java
index 408cfa460..3d4e34f70 100644
--- a/src/main/java/net/minecraft/server/EnchantmentInfiniteArrows.java
+++ b/src/main/java/net/minecraft/server/EnchantmentInfiniteArrows.java
@@ -23,6 +23,6 @@ public class EnchantmentInfiniteArrows extends Enchantment {
@Override
public boolean a(Enchantment enchantment) {
- return enchantment instanceof EnchantmentMending ? false : super.a(enchantment);
+ return enchantment instanceof EnchantmentMending ? net.pl3x.purpur.PurpurConfig.allowInfinityMending : super.a(enchantment); // Purpur
}
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 9f68a9d64..a849f200d 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -55,8 +55,8 @@ public class PurpurConfig {
commands = new HashMap<>();
commands.put("purpur", new PurpurCommand("purpur"));
- version = getInt("config-version", 4);
- set("config-version", 4);
+ version = getInt("config-version", 5);
+ set("config-version", 5);
readConfig(PurpurConfig.class, null);
}
@@ -194,6 +194,16 @@ public class PurpurConfig {
cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame);
}
+ public static boolean allowInfinityMending = false;
+ private static void enchantmentSettings() {
+ if (version < 5) {
+ boolean oldValue = getBoolean("settings.enchantment.allow-infinite-and-mending-together", false);
+ set("settings.enchantment.allow-infinity-and-mending-together", oldValue);
+ set("settings.enchantment.allow-infinite-and-mending-together", null);
+ }
+ allowInfinityMending = getBoolean("settings.enchantment.allow-infinity-and-mending-together", allowInfinityMending);
+ }
+
public static boolean endermanShortHeight = false;
private static void entitySettings() {
endermanShortHeight = getBoolean("settings.entity.enderman.short-height", endermanShortHeight);