aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2022-06-02 20:40:24 +0200
committerNassim Jahnke <[email protected]>2022-06-02 20:40:24 +0200
commit1d08ce85832f301b2ee350469f64473c57c836b3 (patch)
tree163a3f58f6a3af8d1bebb9c075dabf66029f188b
parentb1ac25fdb8e2c011cc0b006d0b478e11879a29d8 (diff)
downloadPaper-1d08ce85832f301b2ee350469f64473c57c836b3.tar.gz
Paper-1d08ce85832f301b2ee350469f64473c57c836b3.zip
Disable book selector resolving by default
-rw-r--r--patches/server/0910-Disable-component-selector-resolving-in-books-by-def.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/patches/server/0910-Disable-component-selector-resolving-in-books-by-def.patch b/patches/server/0910-Disable-component-selector-resolving-in-books-by-def.patch
new file mode 100644
index 0000000000..30b2816744
--- /dev/null
+++ b/patches/server/0910-Disable-component-selector-resolving-in-books-by-def.patch
@@ -0,0 +1,33 @@
+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/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
+index fafbebbb5e8c1a381b673f97f1fa210687b52823..8379c6313f06ab3eeaf02bad41d8b835d50e093f 100644
+--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
+@@ -693,4 +693,9 @@ public class PaperConfig {
+ private static void useProxyProtocol() {
+ useProxyProtocol = getBoolean("settings.proxy-protocol", false);
+ }
++
++ public static boolean resolveSelectorsInBooks;
++ private static void resolveSelectorsInBooks() {
++ resolveSelectorsInBooks = getBoolean("settings.resolve-selectors-in-books", false);
++ }
+ }
+diff --git a/src/main/java/net/minecraft/world/item/WrittenBookItem.java b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
+index 0600bfcc3a4f9043324c046b6c0d2b579ab151cb..01e09feb142ca3cc8875e796b0c3db2bb9559246 100644
+--- a/src/main/java/net/minecraft/world/item/WrittenBookItem.java
++++ b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
+@@ -113,7 +113,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 (com.destroystokyo.paper.PaperConfig.resolveSelectorsInBooks && compoundTag != null && !compoundTag.getBoolean("resolved")) { // Paper
+ compoundTag.putBoolean("resolved", true);
+ if (!makeSureTagIsValid(compoundTag)) {
+ return false;