1.20 support
rom1504 opened this issue · 20 comments
Okay getting an: TypeError: world is null
in the Web Console. Entitys are being rendered (Skins and Items not)
Trying to dig into that now.
Also commenting #398
@rom1504
I generally do not understand the use of just adding another object to the JSON without really adding Support.
By the way Lamas as entitys dont work (At least the wandering Trader ones)
Back to Digging
I think it has to do something with prismarine-chunk.
I was aber to follow the definitions back to prismarine-chunk\src\index.js
Where I found this:
...
pc: {
1.8: require('./pc/1.8/chunk'),
1.9: require('./pc/1.9/chunk'),
'1.10': require('./pc/1.9/chunk'),
1.11: require('./pc/1.9/chunk'),
1.12: require('./pc/1.9/chunk'),
1.13: require('./pc/1.13/chunk'),
1.14: require('./pc/1.14/chunk'),
1.15: require('./pc/1.15/chunk'),
1.16: require('./pc/1.16/chunk'),
1.17: require('./pc/1.17/chunk'),
1.18: require('./pc/1.18/chunk'),
1.19: require('./pc/1.18/chunk'),
'1.20': require('./pc/1.18/chunk')
},
...
But when I try to do the same thing as with te 1.19 (so removet the ' from 1.20)
Im getting the Following Error (ignore the relative paths)
TypeError: chunkImplementations[version.type][version.majorVersion] is not a function
at loader (node_modules\prismarine-chunk\src\index.js:40:68)
at inject (node_modules\mineflayer\lib\plugins\blocks.js:25:44)
at node_modules\mineflayer\lib\plugin_loader.js:41:7
at Array.forEach (<anonymous>)
at injectPlugins (node_modules\mineflayer\lib\plugin_loader.js:40:16)
at EventEmitter.onInjectAllowed (node_modules\mineflayer\lib\plugin_loader.js:12:5)
at Object.onceWrapper (node:events:627:28)
at EventEmitter.emit (node:events:513:28)
at Timeout._onTimeout (node_modules\mineflayer\lib\loader.js:127:26)
at listOnTimeout (node:internal/timers:564:17)
node_modules\prismarine-chunk\src\index.js:44
throw new Error('[Prismarine-chunk] No chunk implementation for ${version?.type} ${version?.majorVersion} found')
It looks like it related to the following piece of code in the same file: (Yeah there is an Error message being defined here but i ignored it before due to information more than what you can see here)
function loader (registryOrVersion) {
const registry = typeof registryOrVersion === 'string' ? require('prismarine-registry')(registryOrVersion) : registryOrVersion
const version = registry.version
if (!version) throw new Error('Specified version does not exist')
try {
return chunkImplementations[version.type][version.majorVersion](registry)
} catch (e) {
if (e instanceof TypeError) {
console.error(e)
throw new Error('[Prismarine-chunk] No chunk implementation for ${version?.type} ${version?.majorVersion} found')
} else {
console.log('Error while loading ${version.type} - ${version.majorVersion}')
throw e
}
}
}
Next ive tried to follow this require('prismarine-registry')(registryOrVersion) : registryOrVersion
and run into node_modules\prismarine-registry\index.d.ts
Here we have this piece of code:
import {IndexedData} from 'minecraft-data'
import {NBT} from 'prismarine-nbt'
interface PCRegistry extends IndexedData {
loadDimensionCodec(codec: NBT): void
writeDimensionCodec(): NBT
}
interface BedrockRegistry extends IndexedData {
}
type Registry = PCRegistry & BedrockRegistry
declare function loader(mcVersion: string): Registry
export = loader
To me this looks like he is pulling NBT data from Minecraft and prismarine (Took a look into the minecraft-data
)
Know I am not sure if I misunderstand something or if I took some wrong way at any point? May anyone can help me in this situation.
By the way ive also once tried adding the texture in node_modules\prismarine-viewer\public\textures
without any luck.
I generally do not understand the use of just adding another object to the JSON without really adding Support.
I am not suggesting that.
I am suggesting to fail hard for non supported versions with an explicit check
For the actual support, the first step is to update Minecraft assets repo
But when I try to do the same thing as with te 1.19 (so removet the ' from 1.20)
The quotes are there for a reason, (eg to avoid the interpreter confusing 1.2 and 1.20), no need to remove them
I generally do not understand the use of just adding another object to the JSON without really adding Support.
I am not suggesting that.
I am suggesting to fail hard for non supported versions with an explicit check
Could you explain how to do an "explicit check" for this? Ive never done something like it before.
if (version == "1.20.0") { console.log ("1.20.0 is not supported"); process.exit();}
Could you explain this further?
What more is there to explain?
if (version == "1.20.0") { console.log ("1.20.0 is not supported"); process.exit();}
This is just saying that 1.20 is not supportet but dont we want to add Support for it?
if (version == "1.20.0") { console.log ("1.20.0 is not supported"); process.exit();}
This is just saying that 1.20 is not supportet but dont we want to add Support for it?
This isn't the best way to go about doing this. You should instead push a message saying that x version isnt supported and that we need people to contribute to add support.
@BlockyBlockling Have you made any progress.
I was not getting the right solution. I first wanted to force it to use 1.19 Textures on 1.20 and ignore the Missing ones. But it didnt really work. May you can help me or give me an example from a different version, how they did it.
I was not getting the right solution. I first wanted to force it to use 1.19 Textures on 1.20 and ignore the Missing ones. But it didnt really work. May you can help me or give me an example from a different version, how they did it.
Have you seen that only some entities were showing? In 1.20 I saw the netherstriders working
I didnt get it to work at all. But I came to the idea cause I saw missing textures on Lamas on the 1.19 which is officially supported
Mc assets has 1.20 now, this needs to be tested and done
I tried Testing it and ran into the Following Error Message:
Chunk size is 172 but only 54 was read ; partial packet : {"name":"spawn_entity","params":{"entityId":169,"objectUUID":"7b227472-616e-736c-6174-65223a226469","type":115,"x":9.489665354112813e+170,"y":1.1935881242136542e+190,"z":2.262901882749459e+180,"pitch":119,"yaw":105,"headPitch":116,"objectData":104,"velocityX":8762,"velocityY":23330,"velocityZ":18798}}; buffer :01a9017b227472616e736c617465223a22646973636f6e6e6563742e67656e65726963526561736f6e222c2277697468223a5b22496e7465726e616c20457863657074696f6e3a20696f2e6e657474792e68616e646c65722e636f6465632e456e636f646572457863657074696f6e3a206a6176612e696f2e494f457863657074696f6e3a2043616e27742073657269616c697a6520756e72656769737465726564207061636b6574225d7d
I want to use this library. However, because the compatible version is old, when loading the 1.19 schematic, it is clearly replaced with the wrong block and drawn.
How are resource packs applied? I'd like to know your goals for making it compatible with 1.20, even if it doesn't go as far as being easily rewritten like a resource pack.
done