From a5c020e7eeff3527f82700026278f8a20edafa01 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 28 Dec 2020 13:16:17 -0500 Subject: [PATCH] More comments --- .../inventory/translators/LecternInventoryTranslator.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/inventory/translators/LecternInventoryTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/inventory/translators/LecternInventoryTranslator.java index 28562bb9a..0eabf951f 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/inventory/translators/LecternInventoryTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/inventory/translators/LecternInventoryTranslator.java @@ -72,7 +72,6 @@ public class LecternInventoryTranslator extends BaseInventoryTranslator { LecternContainer lecternContainer = (LecternContainer) inventory; lecternContainer.setCurrentBedrockPage(value / 2); lecternContainer.setBlockEntityTag(lecternContainer.getBlockEntityTag().toBuilder().putInt("page", lecternContainer.getCurrentBedrockPage()).build()); - System.out.println(lecternContainer.getBlockEntityTag()); BlockEntityUtils.updateBlockEntity(session, lecternContainer.getBlockEntityTag(), lecternContainer.getPosition()); } } @@ -100,7 +99,7 @@ public class LecternInventoryTranslator extends BaseInventoryTranslator { if (tag != null) { // Position has to be the last interacted position... right? Vector3i position = session.getLastInteractionPosition(); - // shouldRefresh means that we should boot out the + // shouldRefresh means that we should boot out the client on our side because their lectern GUI isn't updated yet boolean shouldRefresh = !session.getConnector().getWorldManager().shouldExpectLecternHandled() && !session.getLecternCache().contains(position); int pagesSize = ((ListTag) tag.get("pages")).size(); ItemData itemData = geyserItemStack.getItemData(session); @@ -116,7 +115,6 @@ public class LecternInventoryTranslator extends BaseInventoryTranslator { // Even with serverside access to lecterns, we don't easily know which lectern this is, so we need to rebuild // the block entity tag lecternContainer.setBlockEntityTag(blockEntityTag); - System.out.println(blockEntityTag); lecternContainer.setPosition(position); if (shouldRefresh) { // Update the lectern because it's not updated client-side @@ -148,6 +146,7 @@ public class LecternInventoryTranslator extends BaseInventoryTranslator { builder.putByte("hasBook", (byte) 1); builder.putInt("totalPages", totalPages); } else { + // Not usually needed, but helps with kicking out Bedrock players from reading the UI builder.putByte("hasBook", (byte) 0); } return builder;