aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0748-Disable-component-selector-resolving-in-books-by-def.patch
blob: 97082feba7ed27a7798142e7b296131cc7763afb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <nassim@njahnke.dev>
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 81bb0abea7ebd2705f84fae31e4a3d2de92d7d18..793ab8acd7445984cff2628e3f001661dc20c8e5 100644
--- a/src/main/java/net/minecraft/world/item/WrittenBookItem.java
+++ b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
@@ -112,7 +112,7 @@ public class WrittenBookItem extends Item {
 
     public static boolean resolveBookComponents(ItemStack book, @Nullable CommandSourceStack commandSource, @Nullable Player player) {
         CompoundTag compoundTag = book.getTag();
-        if (compoundTag != null && !compoundTag.getBoolean("resolved")) {
+        if (io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.resolveSelectorsInBooks && compoundTag != null && !compoundTag.getBoolean("resolved")) { // Paper - Disable component selector resolving in books by default
             compoundTag.putBoolean("resolved", true);
             if (!makeSureTagIsValid(compoundTag)) {
                 return false;