-
-
Notifications
You must be signed in to change notification settings - Fork 239
Description
Hey, I’ve been going over the various types in protocol.json, and I noticed that the bitflags type sometimes includes a boolean field named big.
I’m trying to understand what this field actually means. My assumption is that it’s related to endianness, but how should that be interpreted here exactly?
For example, in Bedrock 1.21.100, the type protocol/types/InputFlag looks like this:
[
"bitflags",
{
"type": "varint128",
"big": true,
"flags": [
"ascend",
"descend",
"north_jump",
"jump_down",
"sprint_down",
"change_height",
"jumping",
"auto_jumping_in_water",
"sneaking",
"sneak_down",
"up",
"down",
"left",
"right",
"up_left",
"up_right",
"want_up",
"want_down",
"want_down_slow",
"want_up_slow",
"sprinting",
"ascend_block",
"descend_block",
"sneak_toggle_down",
"persist_sneak",
"start_sprinting",
"stop_sprinting",
"start_sneaking",
"stop_sneaking",
"start_swimming",
"stop_swimming",
"start_jumping",
"start_gliding",
"stop_gliding",
"item_interact",
"block_action",
"item_stack_request",
"handled_teleport",
"emoting",
"missed_swing",
"start_crawling",
"stop_crawling",
"start_flying",
"stop_flying",
"received_server_data",
"client_predicted_vehicle",
"paddling_left",
"paddling_right",
"block_breaking_delay_enabled",
"horizontal_collision",
"vertical_collision",
"down_left",
"down_right",
"start_using_item",
"camera_relative_movement_enabled",
"rot_controlled_by_move_direction",
"start_spin_attack",
"stop_spin_attack",
"hotbar_only_touch",
"jump_released_raw",
"jump_pressed_raw",
"jump_current_raw",
"sneak_released_raw",
"sneak_pressed_raw",
"sneak_current_raw"
]
}
]There are 65 flags here for a varint128 with "big": true. How should I interpret this?
I understand that Minecraft varints themselves are always little-endian, so I don’t suppose this flag refers to byte order. My current theory is that it's about the bit order - that is, whether flag 0 corresponds to the most significant bit or the least significant bit.
Is that correct? Or does "big" mean something else in this context?