From c0c97b852e8ddeb244ef40322b2ee575fb555979 Mon Sep 17 00:00:00 2001 From: liach <7806504+liach@users.noreply.github.com> Date: Sun, 28 Mar 2021 03:10:22 +0700 Subject: [PATCH] Book using (#2198) * Book using Fixes #2181 Signed-off-by: liach * Apply suggestions from code review Co-authored-by: YanisBft Co-authored-by: liach Co-authored-by: YanisBft --- .../entity/player/PlayerEntity.mapping | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/mappings/net/minecraft/entity/player/PlayerEntity.mapping b/mappings/net/minecraft/entity/player/PlayerEntity.mapping index 2ad6155c87..629eb848e9 100644 --- a/mappings/net/minecraft/entity/player/PlayerEntity.mapping +++ b/mappings/net/minecraft/entity/player/PlayerEntity.mapping @@ -182,9 +182,24 @@ CLASS net/minecraft/class_1657 net/minecraft/entity/player/PlayerEntity METHOD method_7311 openEditSignScreen (Lnet/minecraft/class_2625;)V ARG 1 sign METHOD method_7313 updateCapeAngles ()V - METHOD method_7315 openEditBookScreen (Lnet/minecraft/class_1799;Lnet/minecraft/class_1268;)V + METHOD method_7315 useBook (Lnet/minecraft/class_1799;Lnet/minecraft/class_1268;)V + COMMENT Called when the player uses (defaults to right click) a writable or written + COMMENT book item. + COMMENT + COMMENT

This can be called either on the client or the server player. Check {@code + COMMENT book} for whether this is a written or a writable book. + COMMENT + COMMENT @implNote The writing of a writable book in vanilla is totally controlled by + COMMENT the client; the server cannot make the client open a book edit screen by + COMMENT making a server player use a writable book. Only when the client finishes + COMMENT writing a book it will send a {@linkplain net.minecraft.network.packet.c2s.play.BookUpdateC2SPacket book update C2S packet}. + COMMENT + COMMENT

Meanwhile, the reading of a written book is totally controlled and initiated + COMMENT by the server. ARG 1 book + COMMENT the book ARG 2 hand + COMMENT the hand holding the book METHOD method_7316 addExperienceLevels (I)V ARG 1 levels METHOD method_7317 canFoodHeal ()Z