mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Send a dimension change upon join game packet now sent by bungeecord on 1.16
This commit is contained in:
parent
69d7db4493
commit
d1e5960d69
1 changed files with 7 additions and 0 deletions
|
@ -52,6 +52,13 @@ public class JavaJoinGameTranslator extends PacketTranslator<ServerJoinGamePacke
|
||||||
public void translate(ServerJoinGamePacket packet, GeyserSession session) {
|
public void translate(ServerJoinGamePacket packet, GeyserSession session) {
|
||||||
PlayerEntity entity = session.getPlayerEntity();
|
PlayerEntity entity = session.getPlayerEntity();
|
||||||
entity.setEntityId(packet.getEntityId());
|
entity.setEntityId(packet.getEntityId());
|
||||||
|
// If the player is already initialized and a join game packet is sent, they
|
||||||
|
// are swapping servers
|
||||||
|
if (session.isSpawned()) {
|
||||||
|
String fakeDim = entity.getDimension().equals(DimensionUtils.OVERWORLD) ? DimensionUtils.NETHER : DimensionUtils.OVERWORLD;
|
||||||
|
DimensionUtils.switchDimension(session, fakeDim);
|
||||||
|
DimensionUtils.switchDimension(session, packet.getDimension());
|
||||||
|
}
|
||||||
|
|
||||||
AdventureSettingsPacket bedrockPacket = new AdventureSettingsPacket();
|
AdventureSettingsPacket bedrockPacket = new AdventureSettingsPacket();
|
||||||
bedrockPacket.setUniqueEntityId(session.getPlayerEntity().getGeyserId());
|
bedrockPacket.setUniqueEntityId(session.getPlayerEntity().getGeyserId());
|
||||||
|
|
Loading…
Reference in a new issue