3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-10-05 09:20:07 +02:00

Fix bounding box for 1.19.40 after death + respawn (#3374)

Co-authored-by: onebeastchris <105284508+onebeastchris@users.noreply.github.com>
Dieser Commit ist enthalten in:
Konicai 2022-10-29 20:08:41 -04:00 committet von GitHub
Ursprung 0d3b77e567
Commit cc82f4b871
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 13 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -120,6 +120,16 @@ public class SessionPlayerEntity extends PlayerEntity {
refreshSpeed = true;
}
/**
* Since 1.19.40, the client must be re-informed of its bounding box on respawn
* See https://github.com/GeyserMC/Geyser/issues/3370
*/
public void updateBoundingBox() {
dirtyMetadata.put(EntityData.BOUNDING_BOX_HEIGHT, getBoundingBoxHeight());
dirtyMetadata.put(EntityData.BOUNDING_BOX_WIDTH, getBoundingBoxWidth());
updateBedrockMetadata();
}
@Override
public boolean setBoundingBoxHeight(float height) {
if (super.setBoundingBoxHeight(height)) {

Datei anzeigen

@ -75,6 +75,9 @@ public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket
attributesPacket.setRuntimeEntityId(entity.getGeyserId());
attributesPacket.getAttributes().addAll(entity.getAttributes().values());
session.sendUpstreamPacket(attributesPacket);
// Bounding box must be sent after a player dies and respawns since 1.19.40
entity.updateBoundingBox();
break;
case START_SWIMMING:
if (!entity.getFlag(EntityFlag.SWIMMING)) {