mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00: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;
|
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
|
@Override
|
||||||
public boolean setBoundingBoxHeight(float height) {
|
public boolean setBoundingBoxHeight(float height) {
|
||||||
if (super.setBoundingBoxHeight(height)) {
|
if (super.setBoundingBoxHeight(height)) {
|
||||||
|
|
|
@ -75,6 +75,9 @@ public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket
|
||||||
attributesPacket.setRuntimeEntityId(entity.getGeyserId());
|
attributesPacket.setRuntimeEntityId(entity.getGeyserId());
|
||||||
attributesPacket.getAttributes().addAll(entity.getAttributes().values());
|
attributesPacket.getAttributes().addAll(entity.getAttributes().values());
|
||||||
session.sendUpstreamPacket(attributesPacket);
|
session.sendUpstreamPacket(attributesPacket);
|
||||||
|
|
||||||
|
// Bounding box must be sent after a player dies and respawns since 1.19.40
|
||||||
|
entity.updateBoundingBox();
|
||||||
break;
|
break;
|
||||||
case START_SWIMMING:
|
case START_SWIMMING:
|
||||||
if (!entity.getFlag(EntityFlag.SWIMMING)) {
|
if (!entity.getFlag(EntityFlag.SWIMMING)) {
|
||||||
|
|
Loading…
Reference in a new issue