Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 08:30:12 +01:00
Boss bars should actually be more reliable on dimension switch
Dieser Commit ist enthalten in:
Ursprung
a0b63abc6e
Commit
ed21a10101
@ -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() {
|
public void updateBossBars() {
|
||||||
bossBars.values().forEach(BossBar::updateBossBar);
|
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
|
// Bounding box must be sent after a player dies and respawns since 1.19.40
|
||||||
entity.updateBoundingBox();
|
entity.updateBoundingBox();
|
||||||
|
|
||||||
|
// Needed here since 1.19.81 for dimension switching
|
||||||
|
session.getEntityCache().updateBossBars();
|
||||||
break;
|
break;
|
||||||
case START_SWIMMING:
|
case START_SWIMMING:
|
||||||
if (!entity.getFlag(EntityFlag.SWIMMING)) {
|
if (!entity.getFlag(EntityFlag.SWIMMING)) {
|
||||||
@ -237,8 +240,6 @@ 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);
|
||||||
|
|
||||||
session.getEntityCache().addBossBars();
|
|
||||||
break;
|
break;
|
||||||
case JUMP:
|
case JUMP:
|
||||||
entity.setOnGround(false); // Increase block break time while jumping
|
entity.setOnGround(false); // Increase block break time while jumping
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren