3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-03 14:50:19 +01:00

Send confirmation packet when spawning

Fixes some chunk bugs
Dieser Commit ist enthalten in:
AJ Ferguson 2020-02-05 19:23:08 -09:00
Ursprung 13f198845c
Commit e0a1435d51

Datei anzeigen

@ -51,7 +51,7 @@ public class JavaPlayerPositionRotationTranslator extends PacketTranslator<Serve
entity.moveAbsolute(pos, packet.getYaw(), packet.getPitch()); entity.moveAbsolute(pos, packet.getYaw(), packet.getPitch());
RespawnPacket respawnPacket = new RespawnPacket(); RespawnPacket respawnPacket = new RespawnPacket();
respawnPacket.setRuntimeEntityId(0); respawnPacket.setRuntimeEntityId(entity.getGeyserId());
respawnPacket.setPosition(pos); respawnPacket.setPosition(pos);
respawnPacket.setSpawnState(RespawnPacket.State.SERVER_READY); respawnPacket.setSpawnState(RespawnPacket.State.SERVER_READY);
session.getUpstream().sendPacket(respawnPacket); session.getUpstream().sendPacket(respawnPacket);
@ -78,6 +78,9 @@ public class JavaPlayerPositionRotationTranslator extends PacketTranslator<Serve
session.getUpstream().sendPacket(movePlayerPacket); session.getUpstream().sendPacket(movePlayerPacket);
session.setSpawned(true); session.setSpawned(true);
ClientTeleportConfirmPacket teleportConfirmPacket = new ClientTeleportConfirmPacket(packet.getTeleportId());
session.getDownstream().getSession().send(teleportConfirmPacket);
GeyserLogger.DEFAULT.info("Spawned player at " + packet.getX() + " " + packet.getY() + " " + packet.getZ()); GeyserLogger.DEFAULT.info("Spawned player at " + packet.getX() + " " + packet.getY() + " " + packet.getZ());
return; return;
} }