PaperMC/paper-server/patches/sources/net/minecraft/world/item/WrittenBookItem.java.patch

12 lines
941 B
Diff
Raw Normal View History

2024-12-14 21:50:20 +01:00
--- a/net/minecraft/world/item/WrittenBookItem.java
+++ b/net/minecraft/world/item/WrittenBookItem.java
@@ -41,7 +_,7 @@
public static boolean resolveBookComponents(ItemStack bookStack, CommandSourceStack resolvingSource, @Nullable Player resolvingPlayer) {
WrittenBookContent writtenBookContent = bookStack.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 writtenBookContent1 = writtenBookContent.resolve(resolvingSource, resolvingPlayer);
if (writtenBookContent1 != null) {
bookStack.set(DataComponents.WRITTEN_BOOK_CONTENT, writtenBookContent1);