-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.17.1 (756) protocol #605
Conversation
Current status: compiles, but not functional. The server kicks the client: Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: index: 4, length: 105 (expected: range(0, 24)) There are many changed packets on https://wiki.vg/index.php?title=Protocol&type=revision&diff=16918&oldid=16681 |
Getting closer:
but https://wiki.vg/Entity_metadata#Entity_Metadata_Format only says: 18 | Pose | A VarInt enum: 0: STANDING, 1: FALL_FLYING, 2: SLEEPING, 3: SWIMMING, 4: SPIN_ATTACK, 5: SNEAKING, 6: DYING - is pose 7 valid not yet documented? https://github.com/aadnk/ProtocolLib/blob/master/src/main/java/com/comphenix/protocol/wrappers/EnumWrappers.java#L373-L387 defines only these poses: public enum EntityPose {
STANDING,
FALL_FLYING,
SLEEPING,
SWIMMING,
SPIN_ATTACK,
CROUCHING,
DYING; https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Pose.html defines more:
updated https://wiki.vg/Entity_metadata#Entity_Metadata_Format |
https://wiki.vg/index.php?title=Protocol&oldid=16918#Chunk_Data The bitmask used to be a VarInt:
but now its a VarInt-prefixed array of Long:
to get it to compile I've passed the 0th element of this array: new, // TODO: what should this be?
chunk_data.bitmasks.data[0] as u16, // TODO: get all bitmasks which gives the above "partially loaded chunk" image, but will need to take into account all the bits. And what to do with Logging chunk_data.bitmasks.data.len(), connecting to a 1.17.1, test server, always 1 is observed - bugs elsewhere? Truncation from i64 -> i16? The mask is used in src/world/mod.rs load_chunk19_or_115: for i in 0..16 {
if chunk.sections[i].is_none() {
let mut fill_sky = chunk.sections.iter().skip(i).all(|v| v.is_none());
fill_sky &= (mask & !((1 << i) | ((1 << i) - 1))) == 0;
if !fill_sky || mask & (1 << i) != 0 {
chunk.sections[i] = Some(Section::new(i as u8, fill_sky));
}
}
if mask & (1 << i) == 0 {
continue;
} |
Still wrapping my head around the chunk changes. PrisimarineJS is another useful project for reference how they handled it, in their packet_map_chunk: https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.16.2/protocol.json#L1982 changing from: {
"name": "bitMap",
"type": "varint"
to: {
"name": "bitMap",
"type": [
"array",
{
"countType": "varint",
"type": "i64"
}
]
}, The data is handled in prismarine-chunk, here's their changes: PrismarineJS/prismarine-chunk#133
https://github.com/PrismarineJS/prismarine-chunk/blob/master/src/pc/1.17/ChunkColumn.js#L262 |
1.7.10: Particle_Named 1.8.9-1.12.2: Particle_VarIntArray 1.13.2-1.14.4: Particle_f32 1.15-1.17.1: Particle_f64
Protocol parsing is now working well, or at least it does not crash as often, but chunk data handling still needs a lot of work. Testing with a level-type=FLAT world, with the player on the ground or in the sky, it cannot see any chunk data: compared to with a normal world, where it saw some chunk data. The mask array is only one element, a 64-bit integer but only observed up to 6 bits set, yet still not all the chunk data is loading, have to look into this further.. Dumping the chunk
There appears to be some kind of scaling or offset issue. If I squint I can see the other player far away on a pillar (and he does move correctly, for example when jumping, I can see the jump) - even though I'm directly beneath him: https://wiki.vg/Chunk_Format#Data_structure The palette size is almost always 4, and appears to be read correctly:
but sometimes is:
or:
this is about what I expect, adding a bunch of debugging in src/world/mod.rs: debug-chunk.patch.zip let count = VarInt::read_from(&mut data)?.0;
+ println!("section {} palette size = {}", i, count);
for i in 0..count {
let id = VarInt::read_from(&mut data)?.0;
let bl = self
.id_map
.by_vanilla_id(id as usize, &self.modded_block_ids);
+ println!("\tpalette entry {} = {} = {:?}", i, id, bl);
mappings.insert(i as usize, bl);
}
} and printing the block arrays, no problems found yet, maybe the problem lies elsewhere? I did notice when I login, another player immediately observes the player dies lying on the ground, this could be explained by a position update error. |
This does not include the block additions, so the blocks are wrong but the world is at least recognizable, it's a start. Now for the CI failure… https://github.com/iceiix/stevenarella/pull/605/checks?check_run_id=3518938444 it doesn't seem to be related to anything I changed here:
.github/workflows/build.yaml - name: Install wasm-pack
uses: jetli/wasm-pack-action@v0.3.0
with:
version: 'latest'
- name: Build binary
run: |
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli
wasm-pack build --dev https://github.com/jetli/wasm-pack-action last changed on Mar 30, 2020 and has 8 open pull requests - unmaintained? Documentation links to an alternative: https://rustwasm.github.io/docs/wasm-bindgen/wasm-bindgen-test/continuous-integration.html#github-actions - name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: cargo test
- run: wasm-pack test --headless --chrome
- run: wasm-pack test --headless --firefox There was a wasm-pack 0.10.1 release within the past hour: rustwasm/wasm-pack@b1e67d3 - reported: rustwasm/wasm-pack#1057 |
1.7.1 (756) vs 1.16.4 (754) https://wiki.vg/index.php?title=Protocol&type=revision&diff=16918&oldid=16681
1.16.4 (754, currently supported): https://wiki.vg/index.php?title=Protocol&oldid=16681#Chunk_Data
1.7.1 (756) https://wiki.vg/index.php?title=Protocol&oldid=16918#Chunk_Data