You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using flying-squid and prismarine-web-client to view some existing maps. It's working well for the most part, except that some of the data seems to be missing, and I had to make a change to this package in order for it to work.
The maps I am using is Greefield v0.5.3.
First, the change I made ignores some chunks. Without the change, these chunks to not deserialize correctly on the web client. No data is written for the last section and this throws off the deserializer. Here is the change. This is in chunk.js in the 1.14 dir.
function readSection (chunk, section) {
if (section.Y >= 0 && section.Y <= 16) {
let chunkSection = chunk.sections[section.Y]
if (!chunkSection) {
chunkSection = new ChunkSection()
chunk.sections[section.Y] = chunkSection
chunk.sectionMask |= 1 << section.Y
}
// console.log('readSection', section.Y, chunk.sectionMask)
readPalette(chunkSection, section.Palette)
// Empty (filled with air) sections can be stored, but make the client crash if
// they are sent over. Remove them as soon as possible
I'm using flying-squid and prismarine-web-client to view some existing maps. It's working well for the most part, except that some of the data seems to be missing, and I had to make a change to this package in order for it to work.
The maps I am using is Greefield v0.5.3.
First, the change I made ignores some chunks. Without the change, these chunks to not deserialize correctly on the web client. No data is written for the last section and this throws off the deserializer. Here is the change. This is in chunk.js in the 1.14 dir.
==> // if (chunkSection.palette.length === 0) console.log('strange chunk section', chunkSection)
==> if (chunkSection.palette.length === 0 || (chunkSection.palette.length === 1 && chunkSection.palette[0] === 0)) {
chunk.sections[section.Y] = null
chunk.sectionMask &= ~(1 << section.Y)
// console.log('empty section', chunk.sectionMask, section.Y)
return
}
readBlocks(chunkSection, section.BlockStates)
The sections with a non null but zero length palette cause problems, so I ignore them. With this fix in, Greenfield renders nicely.
Maybe someone can help me out and point me in the right direction?
The text was updated successfully, but these errors were encountered: