mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Only send one empty chunk upon login
This commit is contained in:
parent
73c9ee313c
commit
51c1792d67
1 changed files with 11 additions and 16 deletions
|
@ -135,25 +135,22 @@ public class GeyserSession implements Player {
|
||||||
Vector3f pos = Vector3f.ZERO;
|
Vector3f pos = Vector3f.ZERO;
|
||||||
int chunkX = pos.getFloorX() >> 4;
|
int chunkX = pos.getFloorX() >> 4;
|
||||||
int chunkZ = pos.getFloorZ() >> 4;
|
int chunkZ = pos.getFloorZ() >> 4;
|
||||||
for (int x = -5; x < 5; x++) {
|
|
||||||
for (int z = -5; z < 5; z++) {
|
|
||||||
NetworkChunkPublisherUpdatePacket chunkPublisherUpdatePacket = new NetworkChunkPublisherUpdatePacket();
|
NetworkChunkPublisherUpdatePacket chunkPublisherUpdatePacket = new NetworkChunkPublisherUpdatePacket();
|
||||||
chunkPublisherUpdatePacket.setPosition(pos.toInt());
|
chunkPublisherUpdatePacket.setPosition(pos.toInt());
|
||||||
chunkPublisherUpdatePacket.setRadius(renderDistance << 4);
|
chunkPublisherUpdatePacket.setRadius(renderDistance << 4);
|
||||||
upstream.sendPacket(chunkPublisherUpdatePacket);
|
upstream.sendPacket(chunkPublisherUpdatePacket);
|
||||||
|
|
||||||
LevelChunkPacket data = new LevelChunkPacket();
|
LevelChunkPacket data = new LevelChunkPacket();
|
||||||
data.setChunkX(chunkX + x);
|
data.setChunkX(chunkX);
|
||||||
data.setChunkZ(chunkZ + z);
|
data.setChunkZ(chunkZ);
|
||||||
data.setSubChunksLength(0);
|
data.setSubChunksLength(0);
|
||||||
data.setData(TranslatorsInit.EMPTY_LEVEL_CHUNK_DATA);
|
data.setData(TranslatorsInit.EMPTY_LEVEL_CHUNK_DATA);
|
||||||
upstream.sendPacket(data);
|
upstream.sendPacket(data);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BiomeDefinitionListPacket biomePacket = new BiomeDefinitionListPacket();
|
BiomeDefinitionListPacket biomePacket = new BiomeDefinitionListPacket();
|
||||||
biomePacket.setTag(CompoundTag.EMPTY);
|
biomePacket.setTag(CompoundTag.EMPTY);
|
||||||
upstream.sendPacket(biomePacket);
|
upstream.sendPacket(biomePacket);
|
||||||
|
|
||||||
AvailableEntityIdentifiersPacket entityPacket = new AvailableEntityIdentifiersPacket();
|
AvailableEntityIdentifiersPacket entityPacket = new AvailableEntityIdentifiersPacket();
|
||||||
entityPacket.setTag(CompoundTag.EMPTY);
|
entityPacket.setTag(CompoundTag.EMPTY);
|
||||||
upstream.sendPacket(entityPacket);
|
upstream.sendPacket(entityPacket);
|
||||||
|
@ -161,8 +158,6 @@ public class GeyserSession implements Player {
|
||||||
PlayStatusPacket playStatusPacket = new PlayStatusPacket();
|
PlayStatusPacket playStatusPacket = new PlayStatusPacket();
|
||||||
playStatusPacket.setStatus(PlayStatusPacket.Status.PLAYER_SPAWN);
|
playStatusPacket.setStatus(PlayStatusPacket.Status.PLAYER_SPAWN);
|
||||||
upstream.sendPacket(playStatusPacket);
|
upstream.sendPacket(playStatusPacket);
|
||||||
|
|
||||||
connector.getLogger().debug("play status sent");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void authenticate(String username) {
|
public void authenticate(String username) {
|
||||||
|
|
Loading…
Reference in a new issue