File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 33
33
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
34
34
import com.viaversion.viaversion.api.type.Type;
35
35
import com.viaversion.viaversion.api.type.types.UUIDIntArrayType;
36
+ import com.viaversion.viaversion.libs.gson.JsonElement;
36
37
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
37
38
import com.viaversion.viaversion.libs.opennbt.tag.builtin.IntArrayTag;
39
+ import com.viaversion.viaversion.libs.opennbt.tag.builtin.ListTag;
38
40
import com.viaversion.viaversion.libs.opennbt.tag.builtin.LongArrayTag;
39
41
import com.viaversion.viaversion.libs.opennbt.tag.builtin.StringTag;
40
42
import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag;
@@ -302,6 +304,22 @@ public Item handleItemToClient(Item item) {
302
304
}
303
305
}
304
306
307
+ // Handle hover event changes in book pages
308
+ if ((item.identifier() == 758 || item.identifier() == 759) && tag != null) {
309
+ Tag pagesTag = tag.get("pages");
310
+ if (pagesTag instanceof ListTag) {
311
+ for (Tag page : ((ListTag) pagesTag)) {
312
+ if (!(page instanceof StringTag)) {
313
+ continue;
314
+ }
315
+
316
+ StringTag pageTag = (StringTag) page;
317
+ JsonElement jsonElement = protocol.getTranslatableRewriter().processText(pageTag.getValue());
318
+ pageTag.setValue(jsonElement.toString());
319
+ }
320
+ }
321
+ }
322
+
305
323
InventoryPackets.newToOldAttributes(item);
306
324
enchantmentRewriter.handleToClient(item);
307
325
return item;
You can’t perform that action at this time.
0 commit comments