-
Notifications
You must be signed in to change notification settings - Fork 17
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
taking minecraft: and no start with minecraft: in loadDimensionCodec #35
Conversation
Can you update the accompanying write method? |
do you mean you want me to make "if it's 1.20.5+ then call other method if it is 1.20.4 or lower then call this method" |
No, there is a |
oh ok, I didn't understand what is |
One way is to check on every assignment, or to simplify a function can be used to resolve the name based on a version branch: const id = str => version[>=](1.20.5) ? str : ('minecraft:' + str)
codec[id('dimension_type')] = nbt.comp({ |
cool, now we just have to update |
lib/pc/index.js
Outdated
@@ -5,13 +5,15 @@ nbt.float = value => ({ type: 'float', value }) | |||
const { networkBiomesToMcDataSchema, mcDataSchemaToNetworkBiomes } = require('./transforms') | |||
|
|||
module.exports = (data, staticData) => { | |||
const id = str => data.version['>=']('1.20.5') ? str : ('minecraft:' + str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a mc data feature instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean using data.supportFeature()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok
now we need someone to make this in mcdata |
This seems unrelated to 1.20.5. 1.20.5 per dumped packet data still uses |
no man, the dimensionCodec field shouldn't exist in the loginPacket anymore |
You can ask complains to Mojang if you think they should stop sending that field then. |
I am saying it isn't there anymore |
The loginPacket data is accurate, the dimensionCodec data was moved to its own registry_data packet but we still merge it into the loginPacket in minecraft-data for compatibility with existing code. I don't know about 1.20.6 but for 1.20.5 it is working with #37 now. |
The server I play on sent packet like that, so I assumed that the 1.20.5 have some behaviour like that. |
@@ -5,13 +5,15 @@ nbt.float = value => ({ type: 'float', value }) | |||
const { networkBiomesToMcDataSchema, mcDataSchemaToNetworkBiomes } = require('./transforms') | |||
|
|||
module.exports = (data, staticData) => { | |||
const id = str => data.supportFeature('registryKeysStartWithMinecraft') ? str : ('minecraft:' + str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feature is not defined in minecraft data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can someone define it for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a PR to minecraft-data to add it
But I don't really get what you want to do here since Minecraft prefixes are there for all versions
in what case is the minecraft prefix missing? |
Some cases, I don’t know what are all the cases but one of them is joining a server with higher version with the via version plugin Not sure if write is affected, we can revert that if it isn’t. |
Packets like this are valid packets and can be handled by the Minecraft client, as an identifier namespace defaults to minecraft: if it’s not provided |
bump, this project fixes connection issues with ViaProxy to 1.21.1. |
Update: this merge needs to be done in order for https://github.com/GenerelSchwerz/mineflayer-viaproxy to be stable. I can patch the code into prismarine-registry manually right now, but I'd rather not. |
let hasDynamicDimensionData = false | ||
|
||
return { | ||
loadDimensionCodec (codec) { | ||
const dimensionCodec = nbt.simplify(codec) | ||
|
||
const chat = dimensionCodec['minecraft:chat_type']?.value | ||
const chat = dimensionCodec['minecraft:chat_type']?.value ?? dimensionCodec.chat_type?.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use function id here
@@ -30,7 +32,7 @@ module.exports = (data, staticData) => { | |||
} | |||
} | |||
|
|||
const dimensions = dimensionCodec['minecraft:dimension_type']?.value | |||
const dimensions = dimensionCodec['minecraft:dimension_type']?.value ?? dimensionCodec.dimension_type?.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use function id
@@ -46,7 +48,7 @@ module.exports = (data, staticData) => { | |||
} | |||
} | |||
|
|||
const biomes = dimensionCodec['minecraft:worldgen/biome']?.value | |||
const biomes = dimensionCodec['minecraft:worldgen/biome']?.value ?? dimensionCodec['worldgen/biome']?.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use function id
@rom1504 the read function is used by mineflayer to handle that packet, according to wiki.vg, that part is a identifier and a identifier defaults to the minecraft namespace if not specified, but it doesn’t mean that servers should always send that identifier starts with minecraft or not. |
done in #37 |
#34 fix