Move config option check for player face fix into packet handlers (#913)

This commit is contained in:
EnZaXD 2024-11-07 09:11:38 +01:00 committed by GitHub
parent 498bec9065
commit 04a692022a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -237,8 +237,10 @@ public class EntityPacketRewriter1_13 extends LegacyEntityRewriter<ClientboundPa
positionAndLook.send(Protocol1_13To1_12_2.class);
});
if (ViaBackwards.getConfig().isFix1_13FacePlayer()) {
PacketHandler movementRemapper = wrapper -> {
if (!ViaBackwards.getConfig().isFix1_13FacePlayer()) {
return;
}
final double x = wrapper.passthrough(Types.DOUBLE);
final double y = wrapper.passthrough(Types.DOUBLE);
final double z = wrapper.passthrough(Types.DOUBLE);
@ -248,7 +250,6 @@ public class EntityPacketRewriter1_13 extends LegacyEntityRewriter<ClientboundPa
protocol.registerServerbound(ServerboundPackets1_12_1.MOVE_PLAYER_POS_ROT, movementRemapper); // Player Position And Look (serverbound)
protocol.registerServerbound(ServerboundPackets1_12_1.MOVE_VEHICLE, movementRemapper); // Vehicle Move (serverbound)
}
}
@Override
protected void registerRewrites() {