-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
Feat: adding "last" argument for Visit cmd to choose the highest number #4219
Feat: adding "last" argument for Visit cmd to choose the highest number #4219
Conversation
What if as well as adding |
Do you mean the argument Example:
|
I'd say |
I'm not sure about the negative values. It might make sense for us, but I don't know if it is user-friendly. Python has a similar feature for lists, but there Maybe it would be better to have a flag (e.g. |
I'd still think having the |
I'll add the But I don't think that a "reverse flag" is much more very user-friendly, as the command already has a very complex syntax. Especially because the order of the arguments also plays a role here, so that we can classify the individual command inputs. In the end, the
|
|
@@ -326,6 +317,29 @@ public CompletableFuture<Boolean> execute( | |||
return CompletableFuture.completedFuture(true); | |||
} | |||
|
|||
private boolean isInvalidPageNr(String arg) { | |||
if (MathMan.isInteger(arg)) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the code style requires all ifs etc. these have the braces applied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I have changed it.
I'm looking forward to the merge. I can make good use of the command. When this has been merged, I'll add a "last" to the "/p home" command too. |
…er (IntellectualSites#4219) * Refactoring, Adding "last" argument to visit cmd * Adding reversed plot format * fixing tab-completion of "last" argument * reformatting the code-style
Overview
With this PR it is allowed to use the
last
orn
argument to choose the highest possible (last) plot number of the target. For this purpose, parts of the algorithm were also outsourced to a private method and extended.If this is accepted so far, I can build the same for the Home command:
/p h last
.EDIT (21.12.2023): Support for inverted plot numbers has also been added.
Description
Examples:
/p v <username> last
/p v <username> <area> last
--> Teleports the player to the x plot of
<username>
if he has a total of x.EDIT (21.12.2023):
/p v <username> -#
/p v <username> <area> -#
Submitter Checklist