3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 15:00:11 +01:00

Fix more issues of chunks not appearing

Dieser Commit ist enthalten in:
Camotoy 2023-02-23 13:11:18 -05:00
Ursprung e42c2d8ed5
Commit e50226132f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 7 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -180,7 +180,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
private final AdvancementsCache advancementsCache; private final AdvancementsCache advancementsCache;
private final BookEditCache bookEditCache; private final BookEditCache bookEditCache;
private @org.checkerframework.checker.nullness.qual.NonNull final ChunkCache chunkCache; private final ChunkCache chunkCache;
private final EntityCache entityCache; private final EntityCache entityCache;
private final EntityEffectCache effectCache; private final EntityEffectCache effectCache;
private final FormCache formCache; private final FormCache formCache;
@ -1410,10 +1410,6 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
} }
public void setServerRenderDistance(int renderDistance) { public void setServerRenderDistance(int renderDistance) {
// +1 is for Fabric and Spigot
// Without the client misses loading some chunks per https://github.com/GeyserMC/Geyser/issues/3490
// Fog still appears essentially normally
renderDistance = renderDistance + 1;
this.serverRenderDistance = renderDistance; this.serverRenderDistance = renderDistance;
ChunkRadiusUpdatedPacket chunkRadiusUpdatedPacket = new ChunkRadiusUpdatedPacket(); ChunkRadiusUpdatedPacket chunkRadiusUpdatedPacket = new ChunkRadiusUpdatedPacket();
@ -1425,11 +1421,13 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
return this.upstream.getAddress(); return this.upstream.getAddress();
} }
@Override
public boolean sendForm(@NonNull Form form) { public boolean sendForm(@NonNull Form form) {
formCache.showForm(form); formCache.showForm(form);
return true; return true;
} }
@Override
public boolean sendForm(@NonNull FormBuilder<?, ?, ?> formBuilder) { public boolean sendForm(@NonNull FormBuilder<?, ?, ?> formBuilder) {
formCache.showForm(formBuilder.build()); formCache.showForm(formBuilder.build());
return true; return true;

Datei anzeigen

@ -25,6 +25,7 @@
package org.geysermc.geyser.util; package org.geysermc.geyser.util;
import com.nukkitx.math.GenericMath;
import com.nukkitx.math.vector.Vector2i; import com.nukkitx.math.vector.Vector2i;
import com.nukkitx.math.vector.Vector3i; import com.nukkitx.math.vector.Vector3i;
import com.nukkitx.protocol.bedrock.packet.LevelChunkPacket; import com.nukkitx.protocol.bedrock.packet.LevelChunkPacket;
@ -91,7 +92,9 @@ public class ChunkUtils {
if (chunkPos == null || !chunkPos.equals(newChunkPos)) { if (chunkPos == null || !chunkPos.equals(newChunkPos)) {
NetworkChunkPublisherUpdatePacket chunkPublisherUpdatePacket = new NetworkChunkPublisherUpdatePacket(); NetworkChunkPublisherUpdatePacket chunkPublisherUpdatePacket = new NetworkChunkPublisherUpdatePacket();
chunkPublisherUpdatePacket.setPosition(position); chunkPublisherUpdatePacket.setPosition(position);
chunkPublisherUpdatePacket.setRadius(session.getServerRenderDistance() << 4); // Mitigates chunks not loading on 1.17.1 Paper and 1.19.3 Fabric. As of Bedrock 1.19.60.
// https://github.com/GeyserMC/Geyser/issues/3490
chunkPublisherUpdatePacket.setRadius(GenericMath.ceil((session.getServerRenderDistance() + 1) * MathUtils.SQRT_OF_TWO) << 4);
session.sendUpstreamPacket(chunkPublisherUpdatePacket); session.sendUpstreamPacket(chunkPublisherUpdatePacket);
session.setLastChunkPosition(newChunkPos); session.setLastChunkPosition(newChunkPos);