mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix: Lecterns not opening when there is no lectern cache (#4476)
... the LecternCache doesn't always exist. Oops.
This commit is contained in:
parent
123990a795
commit
79154f3d0c
2 changed files with 4 additions and 2 deletions
|
@ -285,7 +285,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
* See {@link WorldManager#sendLecternData(GeyserSession, int, int, int)}
|
||||
* for more information.
|
||||
*/
|
||||
private final Set<Vector3i> lecternCache;
|
||||
private final @Nullable Set<Vector3i> lecternCache;
|
||||
|
||||
/**
|
||||
* A list of all players that have a player head on with a custom texture.
|
||||
|
|
|
@ -193,9 +193,11 @@ public class LecternInventoryTranslator extends AbstractBlockInventoryTranslator
|
|||
lecternContainer.setPosition(position);
|
||||
|
||||
BlockEntityUtils.updateBlockEntity(session, blockEntityTag, position);
|
||||
session.getLecternCache().add(position);
|
||||
|
||||
if (shouldRefresh) {
|
||||
// the lectern cache doesn't always exist; only when we must refresh
|
||||
session.getLecternCache().add(position);
|
||||
|
||||
// Close the window - we will reopen it once the client has this data synced
|
||||
ServerboundContainerClosePacket closeWindowPacket = new ServerboundContainerClosePacket(lecternContainer.getJavaId());
|
||||
session.sendDownstreamGamePacket(closeWindowPacket);
|
||||
|
|
Loading…
Reference in a new issue