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

Add elytra flying support and rocket support #3163

Merged
merged 8 commits into from
Aug 31, 2023

Conversation

lkwilson
Copy link
Contributor

No description provided.

@lkwilson lkwilson mentioned this pull request Aug 19, 2023
@SilkePilon
Copy link
Contributor

does this work?

@lkwilson
Copy link
Contributor Author

does this work?

It does but not super well tested

@SilkePilon
Copy link
Contributor

will test it with https://github.com/SilkePilon/OpenDeliveryBot

@lkwilson lkwilson force-pushed the elytra-support branch 2 times, most recently from 3d40053 to 75b6562 Compare August 21, 2023 04:16
lib/plugins/inventory.js Outdated Show resolved Hide resolved
@lkwilson
Copy link
Contributor Author

It seems that entity_metadata packets can report whether the player is flying or not. The code as it is will sometimes get kicked when the server rejects its elytra request

@lkwilson lkwilson force-pushed the elytra-support branch 3 times, most recently from 48214ec to 28c1f87 Compare August 24, 2023 00:15
@lkwilson
Copy link
Contributor Author

Turns out I had to pull the elytra is flying state and the firework attached to entity state from entity update msgs. I changed it to only set elytra flying / rockets when it detects them via that (similar to crouch). This fixes the occational kicked for flying issue I was seeing (now that server actually confirms flying and fireworks). There's also a test for using elytra in all the versions, and it seems to pass (but requires a minecraft-data bump, which I wasn't sure how to run in github)

@lkwilson
Copy link
Contributor Author

This is ready pending the following prs:

@rom1504
Copy link
Member

rom1504 commented Aug 25, 2023

merged mcdata and p-entity because they were trivial

for prismarine-physics and here we need proper reviews

docs/api.md Outdated Show resolved Hide resolved
index.d.ts Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
lib/plugins/physics.js Outdated Show resolved Hide resolved
@frej4189
Copy link
Contributor

I see no breaking changes so should be relatively safe to merge. Elytra test itself looks fine so given that's passing I believe the PR is good to go.

@lkwilson
Copy link
Contributor Author

lkwilson commented Aug 26, 2023

I see no breaking changes so should be relatively safe to merge. Elytra test itself looks fine so given that's passing I believe the PR is good to go.

One thing I should point out is that the elytra test is passing since it doesn’t have the feature flags from minecraft data, so when we bump to that version we have to reevaluate whether I got the entity metadata parsing correct for all versions. As far as I can tell, its correct, but the entity id field switches between optvarint and varint, and the bot's entity id in the system tests is 0, so its hard to tell whether i'm seeing a firework being used vs applied in older versions.

@lkwilson lkwilson force-pushed the elytra-support branch 2 times, most recently from d4bcb09 to 4628c1c Compare August 26, 2023 14:17
package.json Show resolved Hide resolved
@rom1504 rom1504 merged commit 010460e into PrismarineJS:master Aug 31, 2023
18 checks passed
@rom1504
Copy link
Member

rom1504 commented Aug 31, 2023

thanks for the PR!

Out of curiosity, why did you need elytra support / how do you intend to use it ?

@rom1504
Copy link
Member

rom1504 commented Aug 31, 2023

/makerelease

@rom1504bot rom1504bot mentioned this pull request Aug 31, 2023
@lkwilson
Copy link
Contributor Author

thanks for the PR!

Out of curiosity, why did you need elytra support / how do you intend to use it ?

Thanks for merging! It started with wanting an afk bot that I could run on my raspberry pi instead of leaving my laptop on, but without letting it mine or build, it couldn't reach afk spots high in the sky or really far away. tp commands work but felt a bit cheaty, so implementing elytra seemed like a fun project. Plus it's really cool watching the bot elytra fly in ways that I can't think fast enough to do myself

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

Successfully merging this pull request may close these issues.

5 participants