3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-07-01 19:08:07 +02:00

Boss bars should actually be more reliable on dimension switch

Dieser Commit ist enthalten in:
Camotoy 2023-05-09 01:41:57 -04:00
Ursprung a0b63abc6e
Commit ed21a10101
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 3 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -155,14 +155,6 @@ public class EntityCache {
}
}
/**
* Re-adds all boss bars to the client by re-creating the entities attached to them.
* This seems to fix boss bars showing up on dimension switch, as of Bedrock 1.19.81.
*/
public void addBossBars() {
bossBars.values().forEach(BossBar::addBossBar);
}
public void updateBossBars() {
bossBars.values().forEach(BossBar::updateBossBar);
}

Datei anzeigen

@ -87,6 +87,9 @@ public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket
// Bounding box must be sent after a player dies and respawns since 1.19.40
entity.updateBoundingBox();
// Needed here since 1.19.81 for dimension switching
session.getEntityCache().updateBossBars();
break;
case START_SWIMMING:
if (!entity.getFlag(EntityFlag.SWIMMING)) {
@ -237,8 +240,6 @@ public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket
attributesPacket.setRuntimeEntityId(entity.getGeyserId());
attributesPacket.getAttributes().addAll(entity.getAttributes().values());
session.sendUpstreamPacket(attributesPacket);
session.getEntityCache().addBossBars();
break;
case JUMP:
entity.setOnGround(false); // Increase block break time while jumping