From 89370ef6482e9c93cf2004e18c18c7698a4347ea Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Thu, 15 Jul 2021 18:27:43 -0400 Subject: [PATCH] Explain new changes in BedrockMovePlayerTranslator --- .../entity/player/BedrockMovePlayerTranslator.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockMovePlayerTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockMovePlayerTranslator.java index 8d3ca2f23..45e35a39c 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockMovePlayerTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockMovePlayerTranslator.java @@ -117,11 +117,13 @@ public class BedrockMovePlayerTranslator extends PacketTranslator= (overworld ? BEDROCK_OVERWORLD_VOID_FLOOR_UPPER_Y : -40)) { - // Work around there being a floor at Y -40 (Y - and teleport the player below it - // Moving from below Y -40 to above the void floor works fine + // If the client believes the world has extended height, then it also believes the void floor + // still exists, just at a lower spot + boolean extendedWorld = session.getChunkCache().isExtendedHeight(); + if (floorY <= (extendedWorld ? BEDROCK_OVERWORLD_VOID_FLOOR_LOWER_Y : -38) + && floorY >= (extendedWorld ? BEDROCK_OVERWORLD_VOID_FLOOR_UPPER_Y : -40)) { + // Work around there being a floor at the bottom of the world and teleport the player below it + // Moving from below to above the void floor works fine entity.setPosition(entity.getPosition().sub(0, 4f, 0)); MovePlayerPacket movePlayerPacket = new MovePlayerPacket(); movePlayerPacket.setRuntimeEntityId(entity.getGeyserId());