Skip to content

Commit

Permalink
Fix boss bars not showing up on dimension switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Camotoy committed May 7, 2023
1 parent 6e9b272 commit 0d25a3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ public void removeBossBar(UUID uuid) {
}
}

/**
* 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public void translate(GeyserSession session, PlayerActionPacket packet) {
attributesPacket.getAttributes().addAll(entity.getAttributes().values());
session.sendUpstreamPacket(attributesPacket);

session.getEntityCache().updateBossBars();
session.getEntityCache().addBossBars();
break;
case JUMP:
entity.setOnGround(false); // Increase block break time while jumping
Expand Down

0 comments on commit 0d25a3f

Please sign in to comment.