mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 00:20:44 +01:00
19 lines
1.4 KiB
Diff
19 lines
1.4 KiB
Diff
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
|
+++ b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
|
|
@@ -0,0 +0,0 @@ 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);
|