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 /plot teleport [plot] command #39

Merged
merged 2 commits into from
May 11, 2021
Merged

Conversation

tyler569
Copy link
Contributor

@tyler569 tyler569 commented May 9, 2021

This adds the ability to teleport to an arbitrary plot by its x,z "id"

This change also adds a new completion parser, "Greedy", which
corresponds to brigadier:string with flags indicating that it accepts
anything from the argument to the end of the line. This is necessary
because the plot id doesn't seem to be anything Minecraft can parse by
itself, and is you use brigadier:string in "one word" mode, the parser
believes the argument ends at the comma and shows an error for valid
input.

I use the "x,z" format to match plotsquared's command API, but if people
don't like that it's easy enough to swap out for separate arguments.

I mostly wanted to move parse_id out into a separate function because
without access to ? parsing that was starting to get ugly.

This adds the ability to teleport to an arbitrary plot by its x,z "id"

This change also adds a new completion parser, "Greedy", which
corresponds to `brigadier:string` with flags indicating that it accepts
anything from the argument to the end of the line. This is necessary
because the plot id doesn't seem to be anything Minecraft can parse by
itself, and is you use `brigadier:string` in "one word" mode, the parser
believes the argument ends at the comma and shows an error for valid
input.

I use the "x,z" format to match plotsquared's command API, but if people
don't like that it's easy enough to swap out for seperate arguments.
@AL1L
Copy link
Contributor

AL1L commented May 10, 2021

I think it would be better to do /plot tp X Y (with a space) that way it's consistent with the tp command

Removes Greedy (no longer necessary)
Removes Plot::parse_id (no longer used)
Adds brigadier::vec2 for 2d position
@tyler569
Copy link
Contributor Author

Updated to swap over to x z format

@StackDoubleFlow StackDoubleFlow merged commit 1a269b1 into MCHPR:master May 11, 2021
@tyler569 tyler569 deleted the plot_tp branch May 12, 2021 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants