mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Improve 1.19.50 flags (#3422)
This commit is contained in:
parent
49d3254ea9
commit
c7e79299b6
4 changed files with 7 additions and 16 deletions
|
@ -355,14 +355,11 @@ public class Entity {
|
|||
public void setFlags(ByteEntityMetadata entityMetadata) {
|
||||
byte xd = entityMetadata.getPrimitiveValue();
|
||||
setFlag(EntityFlag.ON_FIRE, ((xd & 0x01) == 0x01) && !getFlag(EntityFlag.FIRE_IMMUNE)); // Otherwise immune entities sometimes flicker onfire
|
||||
// As of 1.19.50, the client does not want the sprinting, sneaking or gliding set on itself
|
||||
if (!GameProtocol.supports1_19_50(session) || !(this instanceof SessionPlayerEntity)) {
|
||||
setFlag(EntityFlag.SNEAKING, (xd & 0x02) == 0x02);
|
||||
setFlag(EntityFlag.SPRINTING, (xd & 0x08) == 0x08);
|
||||
|
||||
// Swimming is ignored here and instead we rely on the pose
|
||||
setFlag(EntityFlag.GLIDING, (xd & 0x80) == 0x80);
|
||||
}
|
||||
|
||||
setInvisible((xd & 0x20) == 0x20);
|
||||
}
|
||||
|
|
|
@ -116,9 +116,7 @@ public class SessionPlayerEntity extends PlayerEntity {
|
|||
@Override
|
||||
public void setFlags(ByteEntityMetadata entityMetadata) {
|
||||
super.setFlags(entityMetadata);
|
||||
|
||||
byte flags = entityMetadata.getPrimitiveValue();
|
||||
session.setSwimmingInWater((flags & 0x10) == 0x10 && (flags & 0x08) == 0x08);
|
||||
session.setSwimmingInWater((entityMetadata.getPrimitiveValue() & 0x10) == 0x10 && getFlag(EntityFlag.SPRINTING));
|
||||
refreshSpeed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1284,12 +1284,8 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
this.pose = Pose.SNEAKING;
|
||||
playerEntity.setBoundingBoxHeight(1.5f);
|
||||
}
|
||||
|
||||
// As of 1.19.50, the client does not want sneaking set on itself
|
||||
if (!GameProtocol.supports1_19_50(this)) {
|
||||
playerEntity.setFlag(EntityFlag.SNEAKING, sneaking);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSwimming(boolean swimming) {
|
||||
if (swimming) {
|
||||
|
|
|
@ -5,7 +5,7 @@ netty = "4.1.80.Final"
|
|||
guava = "29.0-jre"
|
||||
gson = "2.3.1" # Provided by Spigot 1.8.8
|
||||
websocket = "1.5.1"
|
||||
protocol = "2.9.15-20221129.032348-1"
|
||||
protocol = "2.9.15-20221129.204554-2"
|
||||
raknet = "1.6.28-20220125.214016-6"
|
||||
mcauthlib = "d9d773e"
|
||||
mcprotocollib = "9f78bd5"
|
||||
|
|
Loading…
Reference in a new issue