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

Explain new changes in BedrockMovePlayerTranslator

Dieser Commit ist enthalten in:
Camotoy 2021-07-15 18:27:43 -04:00
Ursprung 11874aaa9b
Commit 89370ef648
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -117,11 +117,13 @@ public class BedrockMovePlayerTranslator extends PacketTranslator<MovePlayerPack
if (notMovingUp) { if (notMovingUp) {
int floorY = position.getFloorY(); int floorY = position.getFloorY();
boolean overworld = session.getChunkCache().isExtendedHeight(); // If the client believes the world has extended height, then it also believes the void floor
if (floorY <= (overworld ? BEDROCK_OVERWORLD_VOID_FLOOR_LOWER_Y : -38) // still exists, just at a lower spot
&& floorY >= (overworld ? BEDROCK_OVERWORLD_VOID_FLOOR_UPPER_Y : -40)) { boolean extendedWorld = session.getChunkCache().isExtendedHeight();
// Work around there being a floor at Y -40 (Y - and teleport the player below it if (floorY <= (extendedWorld ? BEDROCK_OVERWORLD_VOID_FLOOR_LOWER_Y : -38)
// Moving from below Y -40 to above the void floor works fine && 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)); entity.setPosition(entity.getPosition().sub(0, 4f, 0));
MovePlayerPacket movePlayerPacket = new MovePlayerPacket(); MovePlayerPacket movePlayerPacket = new MovePlayerPacket();
movePlayerPacket.setRuntimeEntityId(entity.getGeyserId()); movePlayerPacket.setRuntimeEntityId(entity.getGeyserId());