aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0700-Disable-component-selector-resolving-in-books-by-def.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0700-Disable-component-selector-resolving-in-books-by-def.patch')
-rw-r--r--patches/server/0700-Disable-component-selector-resolving-in-books-by-def.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/0700-Disable-component-selector-resolving-in-books-by-def.patch b/patches/server/0700-Disable-component-selector-resolving-in-books-by-def.patch
new file mode 100644
index 0000000000..7231198032
--- /dev/null
+++ b/patches/server/0700-Disable-component-selector-resolving-in-books-by-def.patch
@@ -0,0 +1,19 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nassim Jahnke <[email protected]>
+Date: Thu, 2 Jun 2022 20:35:58 +0200
+Subject: [PATCH] Disable component selector resolving in books by default
+
+
+diff --git a/src/main/java/net/minecraft/world/item/WrittenBookItem.java b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
+index a282c1cbbdf8e5ebac547b45a58116f9b4b2d49e..0c54100fb72b79e0eb4bad8f6851648e084d9260 100644
+--- a/src/main/java/net/minecraft/world/item/WrittenBookItem.java
++++ b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
+@@ -41,7 +41,7 @@ public class WrittenBookItem extends Item {
+
+ public static boolean resolveBookComponents(ItemStack book, CommandSourceStack commandSource, @Nullable Player player) {
+ WrittenBookContent writtenBookContent = book.get(DataComponents.WRITTEN_BOOK_CONTENT);
+- if (writtenBookContent != null && !writtenBookContent.resolved()) {
++ if (io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.resolveSelectorsInBooks && writtenBookContent != null && !writtenBookContent.resolved()) { // Paper - Disable component selector resolving in books by default
+ WrittenBookContent writtenBookContent2 = writtenBookContent.resolve(commandSource, player);
+ if (writtenBookContent2 != null) {
+ book.set(DataComponents.WRITTEN_BOOK_CONTENT, writtenBookContent2);