MCHPR / MCHPRS

A multithreaded Minecraft server built for redstone.
MIT License
1.59k stars 69 forks source link

Add /plot teleport [plot] command #39

Closed tyler569 closed 3 years ago

tyler569 commented 3 years ago

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.

AL1L commented 3 years ago

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

tyler569 commented 3 years ago

Updated to swap over to x z format