MCHPR / MCHPRS

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

Add /plot visit [player] command #38

Closed tyler569 closed 3 years ago

tyler569 commented 3 years ago

This adds the ability to visit a player's claimed plot.

To accomplish this, I add a new function to database that can find a plot's x, z coordinates by name, a new option to handle_plot_command, and new entries to the completion tree.

I tested this to work for multiple players, and it does not break if someone has multiple plots, though you will always only go to one.

AL1L commented 3 years ago

How does it handle if a player has more than one plot? It just get the first one it finds?

tyler569 commented 3 years ago

Currently, if a player has more than one plot /p v player will take you to the first one SQLite returns, likely the first one they claimed. We could make it any with /p v player [number] or something and some more complicated SQL, but I see that more as an improvement for later than super necessary. I can work on it if people feel differently though.

I've updated the branch to check argument count.