Skip to content
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 worlds aren't writable #73

Open
Pandapip1 opened this issue Jan 8, 2024 · 6 comments
Open

1.17 worlds aren't writable #73

Pandapip1 opened this issue Jan 8, 2024 · 6 comments

Comments

@Pandapip1
Copy link

Pandapip1 commented Jan 8, 2024

I'm currently working on 1.17 support for flying-squid. It seems to mostly be working, except that the following error appears whenever the world attempts to save:

TypeError: palette is not iterable
    at writePalette (/home/gavin/repos/flying-squid/node_modules/prismarine-provider-anvil/src/1.14/chunk.js:200:27)
    at writeSection (/home/gavin/repos/flying-squid/node_modules/prismarine-provider-anvil/src/1.14/chunk.js:184:18)
    at writeSections (/home/gavin/repos/flying-squid/node_modules/prismarine-provider-anvil/src/1.14/chunk.js:65:36)
    at prismarineChunkToNbt (/home/gavin/repos/flying-squid/node_modules/prismarine-provider-anvil/src/1.14/chunk.js:26:25)
    at Anvil.save (/home/gavin/repos/flying-squid/node_modules/prismarine-provider-anvil/src/anvil.js:44:19)
    at World.saveNow (/home/gavin/repos/flying-squid/node_modules/prismarine-world/src/world.js:152:30)
    at Timeout._onTimeout (/home/gavin/repos/flying-squid/node_modules/prismarine-world/src/world.js:167:20)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)

From my debugging, it appears that the chunk palette is sometimes null. I'm relatively sure this is a prismarine-provider-anvil bug, but it could also be a prismarine-chunk bug.

NOTE: It appears that palette is set to null here:

https://github.com/PrismarineJS/prismarine-chunk/blob/0631db23c79f63d0bd37cb2764a9d6364c95688c/src/pc/common/CommonChunkSection.js#L108C15-L108C15

@rom1504
Copy link
Member

rom1504 commented Jan 8, 2024 via email

@Pandapip1
Copy link
Author

Pandapip1 commented Jan 8, 2024

PrismarineJS/flying-squid#650. No tests fail, because there aren't any tests to make sure that the world is saved, and because the error is handled.

@rom1504
Copy link
Member

rom1504 commented Jan 12, 2024

Can you add a test ?

@rom1504
Copy link
Member

rom1504 commented Jan 12, 2024

@rom1504
Copy link
Member

rom1504 commented Jan 14, 2024

ok so additional issue is sectionMask changing from a number to a BitMask between 1.16 and 1.17

#75 is the root cause though, setting .sectionMask is not the right way to load. Using the load method is the correct way

@rom1504
Copy link
Member

rom1504 commented Jan 14, 2024

1.8 is doing it right but 1.13 - 1.17 are not

1.18 is better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants