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.1 support #650

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

1.17.1 support #650

wants to merge 10 commits into from

Conversation

Pandapip1
Copy link
Contributor

@Pandapip1 Pandapip1 commented Jan 8, 2024

@rom1504
Copy link
Member

rom1504 commented Jan 12, 2024

Looks like tests are passing.

Do things seem to work?

@rom1504 rom1504 marked this pull request as ready for review January 12, 2024 20:29
}
}, // FIXME: fake heightmap
chunkData: chunk.dump(),
blockEntities: []
})
if (registry.supportFeature('lightSentSeparately')) {
if (registry.supportFeature('dimensionDataIsAvailable')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the feature seems unrelated with the content of this if

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied directly from mineflayer code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pandapip1
Copy link
Contributor Author

Pandapip1 commented Jan 12, 2024

Looks like tests are passing.

Do things seem to work?

THINGS DO NOT WORK. Particularly, world saving is completely borked and sometimes the server crashes when trying to send chunk packets (all to do with the palette set to null error).

@Pandapip1 Pandapip1 marked this pull request as draft January 12, 2024 22:03
@rom1504
Copy link
Member

rom1504 commented Jan 14, 2024

I made PrismarineJS/prismarine-provider-anvil#74 which I think should fix this anvil problem

Can you check if that helps the error you were seeing @Pandapip1 ?

Copy link

socket-security bot commented Jan 14, 2024

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: npm/[email protected]

View full report↗︎

@Pandapip1
Copy link
Contributor Author

I'm still getting the following error, even after updating:

January 14th 2024, 16:30:13 [ERROR]: -------------------------------
January 14th 2024, 16:30:13 [ERROR]: Please report this flying-squid! This is bug (mabye)
January 14th 2024, 16:30:13 [ERROR]: Something went wrong!
January 14th 2024, 16:30:13 [ERROR]: Error: TypeError: this.sectionMask.toLongArray is not a function
    at ChunkColumn.getMask (/home/gavin/repos/flying-squid/node_modules/prismarine-chunk/src/pc/1.17/ChunkColumn.js:244:31)
    at /home/gavin/repos/flying-squid/src/lib/plugins/world.js:188:23
    at Entity.behavior (/home/gavin/repos/flying-squid/src/lib/behavior.js:24:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async player.login (/home/gavin/repos/flying-squid/src/lib/plugins/login.js:222:5)
    at async Server.<anonymous> (/home/gavin/repos/flying-squid/src/lib/plugins/login.js:29:7)
January 14th 2024, 16:30:13 [ERROR]: Report this error here: https://github.com/PrismarineJS/flying-squid/issues
January 14th 2024, 16:30:13 [ERROR]: -------------------------------
January 14th 2024, 16:30:13 Server shutting down...

@rom1504
Copy link
Member

rom1504 commented Jan 14, 2024

ok that's a different error than the palette

@rom1504
Copy link
Member

rom1504 commented Jan 14, 2024

would be great to have a test showing this, would make it faster to debug

@rom1504
Copy link
Member

rom1504 commented Feb 26, 2024

@rom1504 rom1504 mentioned this pull request Mar 29, 2024
@privt00
Copy link
Contributor

privt00 commented Mar 29, 2024

hey
i think i made progress

getting now this error

March 29th 2024, 18:47:08 [ERROR]: Error: TypeError: this.skyLightMask.toLongArray is not a function
at ChunkColumn.dumpLight (C:\Users\Noah\Documents\mclient\node_modules\prismarine-chunk\src\pc\1.17\ChunkColumn.js:379:61)
at C:\Users\Noah\Documents\mclient\src\lib\plugins\world.js:245:20
at Entity.behavior (C:\Users\Noah\Documents\mclient\fly-high\src\lib\behavior.js:24:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

after world safe in 1.17.1 but yeah im tryng to fix it at moment i just dont know if its has somthing to do whit the anvil or just whit the chunkColumn.js

@privt00
Copy link
Contributor

privt00 commented Mar 29, 2024

i also try fixing redstone like piston activated and all stuff

@privt00
Copy link
Contributor

privt00 commented Mar 29, 2024

i fixed this error

@privt00
Copy link
Contributor

privt00 commented Mar 29, 2024

just need to fix the lightnigs

@privt00
Copy link
Contributor

privt00 commented Mar 29, 2024

ok made now the 1.17.1 support

@privt00
Copy link
Contributor

privt00 commented Mar 29, 2024

oh no relised world dosnt safe you just can join and build but nothing gets saved

@privt00
Copy link
Contributor

privt00 commented Mar 29, 2024

@rom1504 in which file is the savin logik?

@rom1504
Copy link
Member

rom1504 commented Mar 29, 2024

@FabioSmuu
Copy link

image

I'm coming to the conclusion that the problem is not in player.sendChunk, but in the generation of the chunk using Anvil

I could observe that at some moments, sectionMask and skyLightMask stop being a BitArray and become Number.

If you put a try/catch to temporarily hide this action, the world works perfectly, but it only renders what is in memory and some random chunks.

It is also noticeable that the map is not being saved and there is no log confirming that the save was made.

I thought about doing a /save command to force this action.

The conclusion I came to is that the creation of the chunk is breaking (it is obvious that you have also noticed, right?)

image

@FabioSmuu
Copy link

FabioSmuu commented Nov 23, 2024

Apparently I discovered the problem with the chunks!

Because some BitArrays return as numbers, it ends up implying in the lighting dump.

The first thing I did regarding sectionMask is to just change Prismarine-Chunk so that the getMask method returns undefined if sectionMask is not an object (or a BitArray)

And for skyLightMask, you can simply ignore the supportFeature dimensionDataIsAvailable and lightSentSeparately (JUST FOR TESTING OK?)

Now, every time we turn on the server, the world will remain intact, but a new problem appears.

The new problem is that now, if a player joins/leaves the server (I'm not sure), the chunk automatically corrupts and the save will be empty.

Summary:
The problem is not in the save, but in the chunk.

Pandapip1@3416217

https://imgur.com/Fl7iJ6Q

@FabioSmuu
Copy link

I found something interesting.

The problem seems to be in world.js, but nothing related to chunk or anvil (but we can't rule out this hypothesis).

Look carefully at the save method of player.

If we put any item in the inventory and click to destroy it, it will work perfectly.

But if you log out of the server and log back in, you will notice that it will no longer be possible to destroy items in the inventory.

This problem only occurs if you follow these steps. I've tried restarting the server and it only works when the user logs back in.

Could the problem be with the player logging out or some save method?

@rom1504
Copy link
Member

rom1504 commented Nov 24, 2024

I still think PrismarineJS/prismarine-provider-anvil#73 (comment) this is the issue

@FabioSmuu
Copy link

I'll follow your line of reasoning and explore Anvil then.

I'll explore 1.18 and see what I can adapt.

@FabioSmuu
Copy link

You're right @rom1504 , it's about the anvil

I just copied /src/1.14/chunk.js to create a completely modified one.

Writing chunk for 1.17.1 is being affected, the problem is in writing the chunks and not in reading them.

The test I just did was to copy the writeSections function from /src/1.18/chunk.js and make some adaptations.

The mask errors disappeared, now I just need to adapt them to save correctly, but now there are no crashes when rendering the map and no chunks are corrupted (not like before)

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

Successfully merging this pull request may close these issues.

4 participants