mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-03-14 11:43:48 +01:00
Fix bounding box for 1.19.40 after death + respawn (#3374)
Co-authored-by: onebeastchris <105284508+onebeastchris@users.noreply.github.com>
This commit is contained in:
parent
0d3b77e567
commit
cc82f4b871
2 changed files with 13 additions and 0 deletions
|
@ -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)) {
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue