3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 16:12:46 +01:00

Fix: Lecterns not opening when there is no lectern cache (#4476)

... the LecternCache doesn't always exist. Oops.
Dieser Commit ist enthalten in:
chris 2024-03-04 00:39:57 +01:00 committet von GitHub
Ursprung 123990a795
Commit 79154f3d0c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
2 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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.

Datei anzeigen

@ -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);