mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
Don't send itemmeta for books with the hide option enabled (#7734)
This commit is contained in:
parent
915e452d12
commit
5ea6685328
2 changed files with 8 additions and 7 deletions
|
@ -91,6 +91,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ tag.put("Enchantments", enchantments);
|
+ tag.put("Enchantments", enchantments);
|
||||||
+ }
|
+ }
|
||||||
+ tag.remove("AttributeModifiers");
|
+ 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;
|
+ return copy;
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package io.papermc.paper.testplugin;
|
package io.papermc.paper.testplugin;
|
||||||
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerItemDamageEvent;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
public final class TestPlugin extends JavaPlugin implements Listener {
|
public final class TestPlugin extends JavaPlugin implements Listener {
|
||||||
|
@ -10,9 +8,4 @@ public final class TestPlugin extends JavaPlugin implements Listener {
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
this.getServer().getPluginManager().registerEvents(this, this);
|
this.getServer().getPluginManager().registerEvents(this, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void a(PlayerItemDamageEvent event) {
|
|
||||||
System.out.println(event.getOriginalDamage() + " to " + event.getDamage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue