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

Feature/short travel staff teleport #542

Conversation

DoctorNefario
Copy link
Contributor

Description

The short travel feature now makes use of vanilla methods to discover the target block.

The search code is split into two halves:

  1. Find which block the player is targeting
  2. If that block is too close, step through blocks along the look vector until there's a free spot

Unfortunately this code will miss some edge cases where a teleport could be performed, but I believe it will be enough for the vast majority of players.

Resolves #502

Checklist:

  • My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you).
  • I have performed a self-review of my own code.
  • I have commented my code in areas it may be challenging to understand.
  • I have made corresponding changes to the documentation.
  • My changes are ready for review from a contributor.

@Rover656 Rover656 added Type-Enhancement New feature or enhancement to existing feature. MC-1.20.1 Area-Parity 1.12.2 missing features labels Oct 19, 2023
Copy link
Member

@Rover656 Rover656 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good - going to run it shortly to check function.
Just a requested change on a comment as I don't think it's as clear as it could be at a first glance :)
Nice work though - thanks a lot!

@Rover656 Rover656 force-pushed the feature/short-travel-staff-teleport branch from 76730ca to 6dd2ac2 Compare November 15, 2023 20:46
@Rover656
Copy link
Member

I'm happy with how this looks - I've just rebased to update your branch and I'll merge this once the builds succeed. Nice work, thanks a lot!

@Rover656 Rover656 merged commit 0809a32 into Team-EnderIO:dev/1.20.1 Nov 15, 2023
3 checks passed
@DoctorNefario DoctorNefario deleted the feature/short-travel-staff-teleport branch November 16, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Parity 1.12.2 missing features MC-1.20.1 Type-Enhancement New feature or enhancement to existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Staff of Travel travel through objects goes too far
2 participants