9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-24 01:19:25 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0023-Make-book-writing-configurable.patch
Dreeam fbb7d752a0 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@51345a1c Correct nullable fall location type
PaperMC/Paper@93246a07 Fix errors when loading raid files without a PDC
PaperMC/Paper@cb3ffd0b Don't store empty PDCs on raids
PaperMC/Paper@d637ae85 Fix NoSuchElementException in EntityTransformEvent for slimes (#12510)
PaperMC/Paper@10742373 Pass correct draw strength for EntityShootBowEvent (#12308)
PaperMC/Paper@825685f8 Add PlayerPickBlockEvent and PlayerPickEntityEvent (#12425)
PaperMC/Paper@2bd84f6f Expand PotionMeta Api to allow getting effective potion colour and effects (#12390)
PaperMC/Paper@6f1f5b67 Fix ArmorStand items for canceled EntityDeathEvent (#12288)
2025-05-03 08:11:09 -04:00

40 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Mon, 26 Dec 2022 02:11:29 +0100
Subject: [PATCH] Make book writing configurable
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Add option to disable books"
By: Kevin Raneri <kevin.raneri@gmail.com>
As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
* Pufferfish description *
Books are commonly the target of duping-related exploits. If you
anticipate that your server will be an early target of duping attacks in
the event that new exploits are found, you may want to consider removing
the ability for non-privileged players to edit books. This patch allows
you to easily disable books, should you want to preemptively remove this
functionality before additional exploits are found.
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 064a9b6cf6792192fc1fa80095a48c2025cebf2a..7576932c6ccb0e018ad19ef6cf4f5d217de6bda4 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1225,6 +1225,11 @@ public class ServerGamePacketListenerImpl
@Override
public void handleEditBook(ServerboundEditBookPacket packet) {
+ // Gale start - Pufferfish - make book writing configurable
+ if (!(org.galemc.gale.configuration.GaleGlobalConfiguration.get().gameplayMechanics.enableBookWriting || this.player.getBukkitEntity().hasPermission(org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions.writeBooks) || this.player.getBukkitEntity().hasPermission("pufferfish.usebooks"))) {
+ return;
+ }
+ // Gale end - Pufferfish - make book writing configurable
// Paper start - Book size limits
final io.papermc.paper.configuration.type.number.IntOr.Disabled pageMax = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax;
if (!this.cserver.isPrimaryThread() && pageMax.enabled()) {