Skip to content

Commit

Permalink
minor meta clean-up
Browse files Browse the repository at this point in the history
"li@" spam
  • Loading branch information
mcmonkey4eva committed Jan 2, 2020
1 parent 7ca0e4a commit aa4b0a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ public static void registerTags() {
// @returns ElementTag
// @description
// returns the list formatted, with each item separated by the defined text.
// For example: <li@bob|joe|john.separated_by[ and ]> will return "bob and joe and john".
// For example: <list[bob|joe|john].separated_by[ and ]> will return "bob and joe and john".
// -->
registerTag("separated_by", (attribute, object) -> {
ListTag list = object;
Expand Down Expand Up @@ -622,7 +622,7 @@ public static void registerTags() {
// @returns ListTag or ElementTag
// @description
// Interprets a list of "key/value" pairs as a map, and returns the value for the given key.
// For example: li@one/a|two/b.map_get[one] returns a.
// For example: one/a|two/b.map_get[one] returns a.
// Optionally, specify a list of keys to get a list back. If any listed keys are not present, will give null.
// -->
registerTag("map_get", (attribute, object) -> {
Expand All @@ -636,7 +636,7 @@ public static void registerTags() {
// @returns ListTag or ElementTag
// @description
// Interprets a list of "key" + "value" pairs split by the input symbol as a map, and returns the value for the given key.
// For example: li@one/a|two/b.map_get[one].split_by[/] returns a.
// For example: one/a|two/b.map_get[one].split_by[/] returns a.
// Optionally, specify a list of keys to get a list back. If any listed keys are not present, will give null.
// -->
String split = "/";
Expand Down Expand Up @@ -674,7 +674,7 @@ else if (input.size() > 1) {
// @returns ElementTag
// @description
// Interprets a list of "key/value" pairs as a map, and returns the key for the given value.
// For example: li@one/a|two/b.map_find_key[a] returns one.
// For example: one/a|two/b.map_find_key[a] returns one.
// -->
registerTag("map_find_key", (attribute, object) -> {
String input = attribute.getContext(1);
Expand All @@ -684,7 +684,7 @@ else if (input.size() > 1) {
// @returns ElementTag
// @description
// Interprets a list of "key" + "value" pairs split by the input symbol as a map, and returns the value for the given key.
// For example: li@one/a|two/b.map_find_key[a].split_by[/] returns one.
// For example: one/a|two/b.map_find_key[a].split_by[/] returns one.
// -->

String split = "/";
Expand Down Expand Up @@ -1832,8 +1832,8 @@ else if (marks == 0 && c == '|' && tag.charAt(i + 1) == '|') {
// @returns ElementTag
// @description
// Returns the item in the list that seems closest to the given value.
// Particularly useful for command handlers, "<li@c1|c2|c3|[...].closest_to[<argument>]>" to get the best option as "did you mean" suggestion.
// For example, "<li@dance|quit|spawn.closest_to[spwn]>" returns "spawn".
// Particularly useful for command handlers, "<list[c1|c2|c3|...].closest_to[<argument>]>" to get the best option as "did you mean" suggestion.
// For example, "<list[dance|quit|spawn].closest_to[spwn]>" returns "spawn".
// Be warned that this will always return /something/, excluding the case of an empty list, which will return an empty element.
// Uses the logic of tag "ElementTag.difference"!
// You can use that tag to add an upper limit on how different the strings can be.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class SQLCommand extends AbstractCommand implements Holdable {
// as this will delay the commands following the SQL command until after the SQL operation is complete.
//
// @Tags
// <entry[saveName].result> returns a ListTag of all rows from a query or update command, of the form li@escaped_text/escaped_text|escaped_text/escaped_text
// <entry[saveName].result> returns a ListTag of all rows from a query or update command, of the form escaped_text/escaped_text|escaped_text/escaped_text
// <entry[saveName].affected_rows> returns how many rows were affected by an update command.
//
// @Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class ForeachCommand extends BracedCommand {
//
// @Usage
// Use to run commands 'for each entry' in a list of objects/elements.
// - foreach li@<[some_entity]>|<[some_npc]>|<[player]>:
// - foreach <[some_entity]>|<[some_npc]>|<[player]>:
// - announce "There's something at <[value].location>!"
//
// @Usage
Expand Down

0 comments on commit aa4b0a5

Please sign in to comment.