mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-03-23 07:19:29 +01: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)}
|
* See {@link WorldManager#sendLecternData(GeyserSession, int, int, int)}
|
||||||
* for more information.
|
* 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.
|
* 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);
|
lecternContainer.setPosition(position);
|
||||||
|
|
||||||
BlockEntityUtils.updateBlockEntity(session, blockEntityTag, position);
|
BlockEntityUtils.updateBlockEntity(session, blockEntityTag, position);
|
||||||
session.getLecternCache().add(position);
|
|
||||||
|
|
||||||
if (shouldRefresh) {
|
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
|
// Close the window - we will reopen it once the client has this data synced
|
||||||
ServerboundContainerClosePacket closeWindowPacket = new ServerboundContainerClosePacket(lecternContainer.getJavaId());
|
ServerboundContainerClosePacket closeWindowPacket = new ServerboundContainerClosePacket(lecternContainer.getJavaId());
|
||||||
session.sendDownstreamGamePacket(closeWindowPacket);
|
session.sendDownstreamGamePacket(closeWindowPacket);
|
||||||
|
|
Loading…
Add table
Reference in a new issue