mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 7232d8f2a EntityLoadCrossbowEvent#shouldConsumeItem 4740bd6c8 Mark PlayerInventory#getItem as nullable bd9ace578 Add a config option to limit the number of entities of each type to load/save in a chunk (#4792) 6bafeb5a9 Move logic from last patch into correct place 9668118fd disable entity ticking flag after watchdog obliteration
40 lines
2.2 KiB
Diff
40 lines
2.2 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 408cfa460920f74e0394ab27101ecb12cceb9c43..3d4e34f7070a48c436284ba7744a94aeacbb7651 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 966834c737c4f388f76fcc515f266f684de593b5..47d323038914fd601e17499802bf3dae5f842d31 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -197,6 +197,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);
|