-
-
Notifications
You must be signed in to change notification settings - Fork 950
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
Support 1.21.3. #3489
Support 1.21.3. #3489
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/[email protected], npm/[email protected] |
@rom1504 thanks for you huge work around this amazing project 🙏 is it possible in some way to maintain/provide in home page (ex. root readme) the latest version tested & supported I know that there is already 1.21 but it would be great to know current major.minor.patch to install without having to check patch one by one 🙏 |
* Fix gamemode test and implementation * Add gamemode test related comments * Fix gamemode tests Add test function to kill the bot * Add gamemode out of bounds checks * Simplify gameMode parsing and check against spawnRespawnWorldDataField feature
current error is TypeError: SizeOf error for undefined : Cannot read properties of undefined (reading '_value') just need to change how this is sent |
We could do a basic PR to mineflayer so basic things work like chat without blocking on PrismarineJS/minecraft-data#948. The things that are currently broken (like Slots in #3526) would remain broken as they are pending that PR. But we don't have to block on basically a refactor |
Pretty much everything is working now minus setCreativeSlot. No idea why this is failing, there is nothing I see unusual in code diffs. I checked out vanilla clients with flying squid and didn't see anything abnormal there either (worked fine). It's possibly something is wrong with bot environment. Otherwise if people want try 1.21.3 support can do
I'm not going to have much more time to work on this but I'll try to look into this some more when if I get the time. |
lib/plugins/creative.js
Outdated
assert(slot >= 0 && slot <= 44) | ||
|
||
if (Item.equal(bot.inventory.slots[slot], item, true)) return | ||
|
||
if (bot.registry.version['>=']('1.21.3')) { |
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.
should be a feature
Looks like still need an update on https://github.com/PrismarineJS/mineflayer/blob/master/test/internalTest.js#L560 and then it's done |
Yeah, I looked into the internal failing test and it seems to be because it's expecting a display name, so it sends a display name update but then immediately erases the display name in another player_info packet. Not sure why old versions are passing. But I think we can disable the display name check for now. Or make a new test just this that doesn't have this problem. Either way the player_info packet is going to be refactor with PrismarineJS/minecraft-data#948 to be same across versions so it will be revisited |
This is the problem:
|
lib/plugins/entities.js
Outdated
@@ -583,8 +598,65 @@ function inject (bot) { | |||
}) | |||
|
|||
bot._client.on('player_info', (packet) => { | |||
console.dir(packet, { depth: null }) |
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.
Remove
lib/plugins/physics.js
Outdated
yaw: 0, | ||
pitch: 0, | ||
onGround: false, | ||
time: 0 | ||
time: 0, | ||
flags: bot.registry.version['>=']('1.21.3') ? {} : 0 |
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.
Should probably be a feature
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.
I reverted this, I messed up the client and serverbound position packets (serverbound doesn't have dx/dy/dz and changed onGround bool to a packed flag int so we dont need a version check)
|
||
let newYaw, newPitch | ||
|
||
if (bot.registry.version['>=']('1.21.3')) { |
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.
Should be a feature
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.
The below features can be removed after PrismarineJS/minecraft-data#948 so if there is a feature added here it would just be temporary
Left a few minor comments but otherwise LGTM |
I hope 1.21.4 is more minor than this |
/makerelease |
Mojang said earlier they plan to do breaking changes in minor versions now so I think they will probably not worry much about big changes anymore. Probably won't get much better until LLMs can take the (java diff, current protocol spec) and apply the updates directly to the protocol spec and lib code. I looked at 1.21.4 earlier and there are some big changes to the internals for refactoring but network changes are not that bad. But there might still be behavior updates (like the one related to creative set slot) that could be annoying. But I think since this is the new normal i think it's probably a good time to simplify as much as possible/add abstractions where needed so the code doesn't get too messy with lots of version/feature based branching |
No description provided.