mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-23 15:00:37 +01:00
Boss bars should actually be more reliable on dimension switch
This commit is contained in:
parent
a0b63abc6e
commit
ed21a10101
2 changed files with 3 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue