Fix book screens opening on server thread
Build / build (push) Canceled after 0s

This commit is contained in:
dnorberg committed 2026-09-21 07:32:08 -04:00
1 parent 2b916ccd0b
commit 2a496524ba
3 files changed
+11 -1

No files matched your search

@@ -12,6 +12,12 @@ public final class ClientBookInteractionHandler {
}
public static void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
// NeoForge posts this common event on both logical sides in an
// integrated game. Screens may only be created by the client copy.
if (!event.getEntity().level().isClientSide()) {
return;
}
boolean linkingBook = event.getItemStack().is(ModItems.LINKING_BOOK.get());
boolean descriptiveBook = event.getItemStack().is(ModItems.DESCRIPTIVE_BOOK.get());
if (!linkingBook && !descriptiveBook) {