mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-25 03:25:11 +01:00
Fix PLAYER_POSITION delta movement (#7)
This commit is contained in:
parent
e82f28c1ac
commit
dc7b708556
@ -137,11 +137,16 @@ public final class EntityPacketRewriter1_21_2 extends EntityRewriter<Clientbound
|
|||||||
wrapper.passthrough(Types.FLOAT); // Y rot
|
wrapper.passthrough(Types.FLOAT); // Y rot
|
||||||
wrapper.passthrough(Types.FLOAT); // X rot
|
wrapper.passthrough(Types.FLOAT); // X rot
|
||||||
|
|
||||||
// Add new delta movement flags so their current veloticy is kept
|
int relativeArguments = wrapper.read(Types.BYTE) & 0b00011111;
|
||||||
int relativeArguments = wrapper.read(Types.BYTE);
|
if ((relativeArguments & (1 << 0)) != 0) { // relative X
|
||||||
relativeArguments |= 1 << 5;
|
relativeArguments |= 1 << 5; // relative delta movement X
|
||||||
relativeArguments |= 1 << 6;
|
}
|
||||||
relativeArguments |= 1 << 7;
|
if ((relativeArguments & (1 << 1)) != 0) { // relative Y
|
||||||
|
relativeArguments |= 1 << 6; // relative delta movement Y
|
||||||
|
}
|
||||||
|
if ((relativeArguments & (1 << 2)) != 0) { // relative Z
|
||||||
|
relativeArguments |= 1 << 7; // relative delta movement Z
|
||||||
|
}
|
||||||
wrapper.write(Types.INT, relativeArguments);
|
wrapper.write(Types.INT, relativeArguments);
|
||||||
|
|
||||||
final int teleportId = wrapper.read(Types.VAR_INT);
|
final int teleportId = wrapper.read(Types.VAR_INT);
|
||||||
|
Loading…
Reference in New Issue
Block a user