From 5ea66853284526599bd6a7c295c1bb6422122e49 Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Mon, 18 Apr 2022 12:23:37 +0200 Subject: [PATCH] Don't send itemmeta for books with the hide option enabled (#7734) --- .../server/Hide-unnecessary-itemmeta-from-clients.patch | 8 ++++++++ .../main/java/io/papermc/paper/testplugin/TestPlugin.java | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/patches/server/Hide-unnecessary-itemmeta-from-clients.patch b/patches/server/Hide-unnecessary-itemmeta-from-clients.patch index 70cc16f07d..7233f61ab3 100644 --- a/patches/server/Hide-unnecessary-itemmeta-from-clients.patch +++ b/patches/server/Hide-unnecessary-itemmeta-from-clients.patch @@ -91,6 +91,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + tag.put("Enchantments", enchantments); + } + tag.remove("AttributeModifiers"); ++ ++ // Books ++ tag.remove("author"); ++ tag.remove("filtered_title"); ++ tag.remove("pages"); ++ tag.remove("filtered_pages"); ++ tag.remove("title"); ++ tag.remove("generation"); + } + } + return copy; diff --git a/test-plugin/src/main/java/io/papermc/paper/testplugin/TestPlugin.java b/test-plugin/src/main/java/io/papermc/paper/testplugin/TestPlugin.java index 45279181cc..a0c78b9d68 100644 --- a/test-plugin/src/main/java/io/papermc/paper/testplugin/TestPlugin.java +++ b/test-plugin/src/main/java/io/papermc/paper/testplugin/TestPlugin.java @@ -1,8 +1,6 @@ package io.papermc.paper.testplugin; -import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerItemDamageEvent; import org.bukkit.plugin.java.JavaPlugin; public final class TestPlugin extends JavaPlugin implements Listener { @@ -10,9 +8,4 @@ public final class TestPlugin extends JavaPlugin implements Listener { public void onEnable() { this.getServer().getPluginManager().registerEvents(this, this); } - - @EventHandler - public void a(PlayerItemDamageEvent event) { - System.out.println(event.getOriginalDamage() + " to " + event.getDamage()); - } }