1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Fix: force flag update for session players entity flags (#5810)

* Force flag update for session player when living entity flag update.

* Requested changes.

* Removed useless import.
This commit is contained in:
oryxel
2025-09-12 07:13:57 +07:00
committed by GitHub
parent 5b16c9caa2
commit 18c710547b

View File

@@ -397,6 +397,17 @@ public class SessionPlayerEntity extends PlayerEntity {
super.setAbsorptionHearts(entityMetadata);
}
@Override
public void setLivingEntityFlags(ByteEntityMetadata entityMetadata) {
super.setLivingEntityFlags(entityMetadata);
// Forcefully update flags since we're not tracking thing like using item properly.
// For eg: when player start using item client-sided (and the USING_ITEM flag is false on geyser side)
// If the server disagree with the player using item state, it will send a metadata set USING_ITEM flag to false
// But since it never got set to true, nothing changed, causing the client to not receive the USING_ITEM flag they're supposed to.
this.forceFlagUpdate();
}
@Override
public void resetMetadata() {
super.resetMetadata();