-
Notifications
You must be signed in to change notification settings - Fork 1
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: add option to format the star text in the list #1
base: master
Are you sure you want to change the base?
Conversation
Hi there, thank you for the pull request. The main repository for this plugin is actually located here: https://github.com/Jannyboy11/F2P-Star-Assist. Even though usually I am open to new features, I cannot really see what a configurable starinfo format accomplishes. The 'T' and 'W' are also still hardcoded, so it's not even truly configurable. In order for me to accept this PR, I would like the T and W to be user-configurable as well (so, part of the format string). |
section = MISCELLANEOUS | ||
) | ||
default String callOutFormat() { | ||
return "{world} {tier} {location}"; |
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.
Should be "W{world} T{tier} {location}" then, right?
final String text = "T" + star.getTier().getSize() + " W" + star.getWorld() + " " + star.getLocation(); | ||
final String text = this.config.callOutFormat | ||
|
||
if(text.contains("{world}") && text.contains("{tier}") && text.contains("{location}")){ // if provided format is valid |
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.
In this codebase I use spaces before and after keywords, so this should be if (
at the beginning of the line, and at the end of the line ) {
.
text.replace("{world}", star.getWorld()); | ||
text.replace("{tier}", "T"+star.getTier().getSize()); | ||
text.replace("{location}", star.getLocation()); | ||
}else{ // otherwise default |
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.
spaces: } else {
.
added an option to format the text in the star list
with tags {world} {tier} {location}
so you can swap their places or have any custom formatting